From b8d7c87175b28cbdac948140b219a88746b3f9c5 Mon Sep 17 00:00:00 2001 From: Erkam Yaman Date: Wed, 21 Oct 2026 14:46:15 +0000 Subject: [PATCH 01/10] ci: retry a cell install once after a registry fetch error The first weekly e2e run failed in the Analog cell because the local registry could not fetch `@oozcitak/url` from npmjs during `pnpm install`. The same cell passes when run again. The local registry fetches every dependency except the package under test from npmjs, so one failed fetch should not fail the run: a fetch error now retries the install once, and the step notes that it did. --- scripts/e2e-install.mjs | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/scripts/e2e-install.mjs b/scripts/e2e-install.mjs index 60ed162a..27ca1694 100644 --- a/scripts/e2e-install.mjs +++ b/scripts/e2e-install.mjs @@ -234,6 +234,25 @@ function useRegistry(dir) { const pmRun = (cell, [cmd, args], cwd) => run(cmd, args, cwd, pmEnv()); +/** What a package manager prints when the registry could not fetch a package from npmjs. */ +const REGISTRY_FETCH_ERROR = + /is not in the npm registry|ERR_PNPM_FETCH|ERR_PNPM_META_FETCH|ETIMEDOUT|ECONNRESET|EAI_AGAIN|socket hang up/; + +/** + * The cell's dependency install. The local registry fetches every dependency except the package + * under test from npmjs, and one fetch can fail on the way, so a fetch error is retried once. + */ +function installDependencies(cell, app) { + try { + return pmRun(cell, PM[cell.pm].install(), app); + } catch (error) { + if (!REGISTRY_FETCH_ERROR.test(String(error))) throw error; + log(cell, 'the registry could not fetch a package from npmjs; installing again'); + pmRun(cell, PM[cell.pm].install(), app); + return 'installed on the second try, after a registry fetch error'; + } +} + /** A port in this cell's block that nothing listens on, or an error naming it. */ async function freePort(port) { await new Promise((done, fail) => { @@ -446,7 +465,7 @@ async function newAngularApp(cell, { ssr }) { writeFileSync(file, `${JSON.stringify(pkg, null, 2)}\n`); } useRegistry(app); - await step(cell, `${cell.pm} install`, () => pmRun(cell, PM[cell.pm].install(), app)); + await step(cell, `${cell.pm} install`, () => installDependencies(cell, app)); return app; } @@ -638,7 +657,7 @@ async function analog(cell) { ); }); } - await step(cell, `${cell.pm} install`, () => pmRun(cell, PM[cell.pm].install(), app)); + await step(cell, `${cell.pm} install`, () => installDependencies(cell, app)); // vite.md: "Add @pangular-inspector/devtools as a dev dependency." await step(cell, 'install the package', () => { pmRun(cell, PM[cell.pm].add([manifest.name], true), app); From c560c0bf9bc582e5b63849aeabf553aa8d0a5950 Mon Sep 17 00:00:00 2001 From: Erkam Yaman Date: Wed, 21 Oct 2026 15:26:18 +0000 Subject: [PATCH 02/10] fix(hub): keep the redaction config behind pairing and load devframe at runtime `__connection.json` answers before the panel is paired, and it carried the redaction config: the `secretNames` and `unmask` lists. It now leaves `redaction` out. A new shared RPC, `redaction-config`, returns the lists to a paired client only, and every overlay asks for them before it reads anything from the app (#419). The published `/devframe` entry bundled devframe's own files, which declare `createRequire` at the top level and collide with the banner Angular 20 adds to a server bundle. The entry is now a small loader that requires the built server code from the installed package, as the Express hub already does (#427). The Express and other servers pages say which port the WebSocket side-car uses and how to pin it with `ws: {port}` or serve it on the app's own server with `attach(server)`, with tests for each (#426). --- .../src/content/contributing/publishing.md | 2 + .../content/getting-started/configuration.md | 4 +- .../src/content/getting-started/express.md | 22 ++- .../content/getting-started/other-servers.md | 3 +- .../src/content/getting-started/overlay.md | 2 +- apps/docs/src/content/guides/capacitor.md | 2 +- apps/docs/src/content/security.md | 4 +- packages/devtools/CHANGELOG.md | 8 + packages/devtools/build/entries.ts | 21 ++- .../src/__tests__/build-entries.test.ts | 57 ++++++- .../devtools/src/__tests__/config.test.ts | 5 +- .../__tests__/connection-redaction.test.ts | 55 +++++++ .../src/__tests__/devframe-loader.test.ts | 83 ++++++++++ packages/devtools/src/__tests__/hub.test.ts | 89 ++++++++++- .../__tests__/overlay-angular-native.test.ts | 32 +++- .../src/__tests__/overlay-page-key.test.ts | 3 +- .../src/__tests__/overlay-redaction.test.ts | 146 ++++++++++++++++++ .../devtools/src/__tests__/public-api.test.ts | 20 ++- packages/devtools/src/config.ts | 14 ++ packages/devtools/src/devframe-entry.ts | 24 +++ packages/devtools/src/devframe.ts | 49 +++--- .../devtools/src/entries/devframe-loader.ts | 20 +++ packages/devtools/src/hub-entry.ts | 103 ++---------- .../devtools/src/overlay-angular-native.ts | 4 +- packages/devtools/src/overlay-connection.ts | 2 +- packages/devtools/src/overlay-nativescript.ts | 4 +- packages/devtools/src/overlay-redaction.ts | 74 +++++++++ packages/devtools/src/overlay.ts | 8 +- packages/devtools/src/package-loader.ts | 109 +++++++++++++ packages/devtools/tsdown.config.ts | 7 +- 30 files changed, 830 insertions(+), 146 deletions(-) create mode 100644 packages/devtools/src/__tests__/connection-redaction.test.ts create mode 100644 packages/devtools/src/__tests__/devframe-loader.test.ts create mode 100644 packages/devtools/src/__tests__/overlay-redaction.test.ts create mode 100644 packages/devtools/src/devframe-entry.ts create mode 100644 packages/devtools/src/entries/devframe-loader.ts create mode 100644 packages/devtools/src/overlay-redaction.ts create mode 100644 packages/devtools/src/package-loader.ts diff --git a/apps/docs/src/content/contributing/publishing.md b/apps/docs/src/content/contributing/publishing.md index ed6f130e..e626e410 100644 --- a/apps/docs/src/content/contributing/publishing.md +++ b/apps/docs/src/content/contributing/publishing.md @@ -36,6 +36,8 @@ The package publishes `dist/`, `skills/` (the [agent skills](../agents/skills.md | `@pangular-inspector/devtools/ssr` | `dist/ssr.mjs` | | `@pangular-inspector/devtools/vite` | `dist/vite.mjs` | +`dist/hub.mjs` and `dist/devframe.mjs` are loaders that import no package. They load `dist/hub-server.mjs` and `dist/devframe-server.mjs` from the installed package at runtime, so an app's server bundle doesn't take in Devframe. The build fails when a loader reaches a package or a Node builtin. + The `pangular` binary is `bin.mjs`. In the workspace, the exports point at the TypeScript sources instead. ### How the package builds diff --git a/apps/docs/src/content/getting-started/configuration.md b/apps/docs/src/content/getting-started/configuration.md index 6fa98b9d..9ff5b735 100644 --- a/apps/docs/src/content/getting-started/configuration.md +++ b/apps/docs/src/content/getting-started/configuration.md @@ -176,7 +176,7 @@ The server refuses a blocked action, and with `actions.components` the page refu | `redaction.secretNames` | `[]` | Extra field names to treat as secret, on top of the built-in list. They match by words, like the built-in list, so `passport` also covers `passportNumber`. | | `redaction.unmask` | `[]` | Field names to show even when they look secret. They join the `unmask` list of `window.__PANGULAR_FORMS__`. | -Forms, the router, component inputs, signals, NgRx, pipes, Analog previews, SSR & HTTP URLs and Capacitor plugin calls use the extra secret names. Each list keeps up to 100 names. See [Access and redaction](../security.md#what-is-redacted) for what is redacted and what unmasking allows. +Forms, the router, component inputs, signals, NgRx, pipes, Analog previews, SSR & HTTP URLs and Capacitor plugin calls use the extra secret names. Each list keeps up to 100 names. The server sends both lists to a page only after the page is trusted, so they are not in `__connection.json`. See [Access and redaction](../security.md#what-is-redacted) for what is redacted and what unmasking allows. ### Limits @@ -195,7 +195,7 @@ Values outside the bounds are clamped to the nearest one. When a timeline reaches its limit, the oldest entries are dropped. The timeline then shows a note above the list, such as "Showing the latest 200 HTTP calls. 12 older entries were dropped." with the limit to raise. This applies to the **SSR & HTTP** timeline, the router navigation timeline, the forms timeline, the NgRx change log, the change detection recording and the Capacitor plugin calls. The `explain-navigation`, `list-form-changes` and `change-detection` agent tools add the same note, and the `pangular:ngrx-store` resource reports a `dropped` count per page. -On Angular 20 and later, the page reads the app about 250 ms after Angular runs change detection, and again every 4 seconds in case it missed a change. `refreshMs` doesn't change that. The page polls every `refreshMs` instead when it can't follow change detection, such as until the app bootstraps. The Analog inspector also reads the page every `refreshMs`. At any value, the page sends a small heartbeat every 10 seconds instead of data that didn't change, so the server never drops a page that is still open. If the server lost the page (it restarted, or the page went quiet for more than 15 seconds), the page sends all of its data again. +On Angular 20 and later, the page reads the app about 250 ms after Angular runs change detection, and again every 4 seconds in case it missed a change. `refreshMs` doesn't change that. The page polls every `refreshMs` instead when it can't follow change detection, such as until the app bootstraps. The Analog inspector also reads the page every `refreshMs`. At any value, the page sends a small heartbeat every 10 seconds instead of data that didn't change, so the server never drops a page that is still open. If the server lost the page (it restarted, or the page went quiet for more than 30 seconds), the page sends all of its data again. ### Performance diff --git a/apps/docs/src/content/getting-started/express.md b/apps/docs/src/content/getting-started/express.md index fc5f575f..7a6fd944 100644 --- a/apps/docs/src/content/getting-started/express.md +++ b/apps/docs/src/content/getting-started/express.md @@ -87,7 +87,23 @@ const devtools = initPangularHub({ws: {sidecar: true}}); With `ws: false` there is no WebSocket, and the browser connects over SSE on the same port. It is the simplest choice: every request goes through your Express server, including under `ng serve`. -With `ws: {sidecar: true}`, the WebSocket runs on its own port, picked automatically. +With `ws: {sidecar: true}`, the WebSocket runs on its own port. The hub takes the first free port from 9777 to 9877, whatever port your app uses, and advertises it in `__connection.json`. Two apps started at once get different ports from that range. + +If a firewall or a container only lets known ports through, pin the port with `ws: {port}`. The hub then listens on that port only, and fails to start when it is taken, instead of moving to another one. To keep it next to the app's port, derive it from the port the app listens on: + +```ts +// src/server.ts +const port = Number(process.env['PORT'] ?? 4000); +const devtools = initPangularHub({ws: {port: port + 1}}); +``` + +To use no second port at all, run the WebSocket on the app's own server: leave out `ws` and pass the server that `app.listen()` returns to `devtools.attach()`. Upgrades to `__ws` then go to the hub, behind the same request gate as `nodeMiddleware`. Under `ng serve`, `server.ts` doesn't start a server of its own, so use `ws: false` or a side-car there. + +```ts +// src/server.ts +const server = app.listen(port); +devtools.attach(server); +``` ### Rebuilds under `ng serve` @@ -100,7 +116,7 @@ With `ws: {sidecar: true}`, the WebSocket runs on its own port, picked automatic | Option | Default | What it does | | ---------------- | ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `base` | `'/__devframes/'` | Where the hub is mounted. The devtools panel lives at `pangular/`. | -| `ws` | | `false` uses server-sent events only. `{ sidecar: true }` runs the WebSocket on its own port. | +| `ws` | | `false` uses server-sent events only. `{sidecar: true}` runs the WebSocket on its own port, the first free one from 9777. `{port: 4001}` pins that port. See [Pick a transport](#pick-a-transport). | | `enabled` | on unless this is production | `false` mounts nothing: the middlewares only call `next()`. `true` mounts the hub in production too, with a warning. See [Production](#production). | | `auth` | on | `false` turns off the one-time code. `{tokens: [...]}` keeps it on and trusts clients that send one of the [pairing tokens](../security.md#pairing-tokens). | | `allowedOrigins` | loopback origins and the Chrome extension | Extra origins allowed to reach the hub, such as a tunnel. `false` turns the origin check and the request gate off. | @@ -293,6 +309,8 @@ app.use(devtools.nodeMiddleware); The overlay looks for `/__pangular/` too. Without the hub, every tab sits in one tab bar. +Like `@pangular-inspector/devtools/hub`, the devframe entry point loads Devframe from `node_modules` when it is imported, instead of being bundled into your server. That keeps the Angular 20 server build working: Angular 20 adds a top-level `createRequire` import to every server chunk, which collides with the same import in Devframe's own files. Install the package as a dependency of the app that runs the server. + ## Troubleshooting diff --git a/apps/docs/src/content/getting-started/other-servers.md b/apps/docs/src/content/getting-started/other-servers.md index b6d1479c..20d96f90 100644 --- a/apps/docs/src/content/getting-started/other-servers.md +++ b/apps/docs/src/content/getting-started/other-servers.md @@ -201,7 +201,8 @@ A web handler never sees WebSocket upgrades, and neither does a server that `ng | Setting | Use it when | | ----------------------------------------- | -------------------------------------------------------------------------------------------------------- | | `ws: false` | Always works. The browser connects over server-sent events on the same port, including under `ng serve`. | -| `ws: {sidecar: true}` | You want a WebSocket. It runs on its own port, picked automatically. | +| `ws: {sidecar: true}` | You want a WebSocket. It runs on its own port, the first free one from 9777 to 9877. | +| `ws: {port: 4001}` | You want the side-car WebSocket on a port you choose, such as one a firewall or container lets through. | | No `ws` option, `devtools.attach(server)` | You start a Node server yourself, such as `serve()` from `@hono/node-server` or Fastify's `app.server`. | `attach(server)` routes the server's `upgrade` events to the hub's WebSocket at `__ws`: diff --git a/apps/docs/src/content/getting-started/overlay.md b/apps/docs/src/content/getting-started/overlay.md index 2a0f6221..55253ba5 100644 --- a/apps/docs/src/content/getting-started/overlay.md +++ b/apps/docs/src/content/getting-started/overlay.md @@ -163,7 +163,7 @@ await initOverlay({ With `connectionMeta`, the overlay resolves paths against one `baseURL`, so pass a single URL. `initOverlay` rejects a list, or no `baseURL`, with an error that says so. -Without `configs`, the page runs every inspector with the default limits and redaction, and the server's `redaction.secretNames` are not applied on the page. The overlay logs a warning once. To use the server's config, pass the whole `__connection.json` of the server as `connectionMeta`. +Without `configs`, the page runs every inspector with the default limits. The overlay logs a warning once. To use the server's config, pass the whole `__connection.json` of the server as `connectionMeta`. The server's `redaction` config is not in that file: the page asks the server for it once it is trusted, with or without `connectionMeta`. The endpoints must still accept the page's origin. [Set up Capacitor](../guides/capacitor.md) uses this for an app in a mobile WebView. diff --git a/apps/docs/src/content/guides/capacitor.md b/apps/docs/src/content/guides/capacitor.md index 33607678..16ddab80 100644 --- a/apps/docs/src/content/guides/capacitor.md +++ b/apps/docs/src/content/guides/capacitor.md @@ -128,7 +128,7 @@ Without `connectionMeta`, the overlay first fetches `__connection.json` from `ba - The hub's WebSocket side-car (`ws: {sidecar: true}`) listens on `localhost` on a port it picks, so a device can't reach it. Use `ws: false`. - With the Vite plugin, add `capacitor://localhost` to its `allowedOrigins` for iOS. Android's `https://localhost` needs no entry, but only reaches Vite through the emulator or `adb reverse`. -The short forms above carry no `configs`, so the overlay uses the default inspectors, limits and redaction, and logs a warning. The server's `redaction.secretNames` are then not applied on the page. The warning only says that the page runs with the defaults, so it can be ignored when the server has no config. If your server has a [config](../getting-started/configuration.md), open its `__connection.json` in your desktop browser and pass the whole object as `connectionMeta`: `http://localhost:9999/__connection.json` for the CLI, or `http://localhost:4000/__devframes/pangular/__connection.json` for the hub. +The short forms above carry no `configs`, so the overlay uses the default inspectors and limits, and logs a warning. The server's `redaction` config still applies: the page asks the server for it once it is trusted. The warning only says that the page runs with the defaults, so it can be ignored when the server has no config. If your server has a [config](../getting-started/configuration.md), open its `__connection.json` in your desktop browser and pass the whole object as `connectionMeta`: `http://localhost:9999/__connection.json` for the CLI, or `http://localhost:4000/__devframes/pangular/__connection.json` for the hub. | Where the app runs | `
` | | ----------------------- | -------------------------------------------------------------------------- | diff --git a/apps/docs/src/content/security.md b/apps/docs/src/content/security.md index 9c238f19..8612014e 100644 --- a/apps/docs/src/content/security.md +++ b/apps/docs/src/content/security.md @@ -71,6 +71,8 @@ export default defineConfig({ The plugin's `auth` option decides whether the devtools also ask for the one-time code. The server prints the code in the terminal, and a browser reads data only after it exchanges that code. If the server later revokes a page's access, the page stops reporting and logs one warning in the console. It doesn't try to connect again until you reload it and enter a new code, or until a code entered in another tab of the same app trusts it again. +`__connection.json` answers before the code is exchanged, since the page and the panel read it to connect. It leaves out the `redaction` config (`secretNames` and `unmask`), so it doesn't tell anyone which names your app treats as secret. A page gets that config from the server once it is trusted, and reads nothing from the app before that. + | `auth` | One-time code | | --------------- | ------------------------------------------------------------------------------------------------ | | not set, `true` | On. The HTTP MCP endpoint asks for a [token](#mcp-endpoint) too. | @@ -213,7 +215,7 @@ A page reconnects with the same page id after a reload. To take its page back, t | ---------------------------------------- | ---------------------------------------------------------------------------------------- | | It sends the page's secret | At once, even while the old connection is still open. | | The old connection closed | On its next report. | -| The old connection sent nothing for 15 s | On its next report. A tab in the background stays owned while it says it is still there. | +| The old connection sent nothing for 30 s | On its next report. A tab in the background stays owned while it says it is still there. | Agent tools and the panel don't report pages, so these rules don't apply to them. [`ngrx-dispatch`](./agents/tools.md#dispatch-an-action) without `page` is refused while more than one page reports NgRx state. The answer lists those pages, so you can call it again with one. Other tools that act on a page pick one when `page` is left out. `navigate`, for example, acts on the first page that reports a router. Pass `page` when more than one tab is open. diff --git a/packages/devtools/CHANGELOG.md b/packages/devtools/CHANGELOG.md index 9782f0bb..aca00d2a 100644 --- a/packages/devtools/CHANGELOG.md +++ b/packages/devtools/CHANGELOG.md @@ -114,6 +114,7 @@ What remains: `/config` exports `DEFAULT_POPUP_HOTKEY`, `PANGULAR_ACTIONS`, `PAN - Refuse writes when the target tab is unclear, instead of acting on whichever tab changed last. - Pairing tokens (`auth: {tokens}`, `--auth-token`, `PANGULAR_AUTH_TOKEN`) let an app on a device connect without typing the code. The CLI prints only a short hash of each token. - Hide the shared state of a turned-off inspector from agents. +- Leave the `redaction` config (`secretNames`, `unmask`) out of `__connection.json`, which answers before the one-time code. Pages get it from the server once they are trusted (#419). ### Features @@ -190,18 +191,25 @@ What remains: `/config` exports `DEFAULT_POPUP_HOTKEY`, `PANGULAR_ACTIONS`, `PAN - The SSR hydration count is right, and a request is no longer reported as a transfer cache hit when it was not. - A failed write answers with `isError: true`, and a failing call keeps its response body. - The Express hub turns itself off with a warning on a Node.js that can't load it, instead of crashing the server. +- `@pangular-inspector/devtools/devframe` (and the package root) load Devframe from `node_modules` when imported, as the hub entry does, so an Angular 20 server bundle that imports them no longer fails with `Identifier 'createRequire' has already been declared` (#427). - Picking works inside shadow roots and `ShadowDom` components. - Analog server calls link only to the request they ran under (#405). - Signal Forms checkboxes, radios and selects are written in user mode (#360). - Live counts in **Timeline**, **Errors** and **Audit** speak only after a filter change, so they no longer flood screen readers. - Control outlines and **Signals** graph edges meet 3:1 contrast in both themes, and status pills keep their contrast on selected rows. - The extension panel retries the connection on its own. +- A tab that crashes or is killed without `pagehide` leaves `list-pages`, the forms data and the router data with the rest of its data. Every per-page store uses one expiry, 30 seconds after the page's last report or heartbeat (three heartbeat intervals), instead of 150 seconds for forms and router (#422). +- `explain-invalid-forms` no longer says no field has an error when the failing field is past the forms collector's limit of 100 fields per group. A cut group carries `truncatedInvalid` with the invalid fields it left out, `explain-invalid-forms` and `explain-submit` name them, and `inspect-forms` says which group was cut and how many fields it left out (#423). +- `scan-signals` and `scan-components` cap their answer at 200 items or 20,000 characters, say how many items they left out, and take `filter`, `offset` and `limit` to read the rest. A list that fits is still the JSON array alone (#429). +- The panel switches tabs when only the `#tab=` hash changes after load (#425). +- At narrow widths the **Components** toolbar fits on two rows, with its tree actions as icons, and a cut off component name shows its full text on hover and focus (#421). ### Docs - A quick start, and a panel screenshot on every inspector page. - Pages for the command palette, settings, terminals, the popup and hub, configuration, other servers (Hono, h3, Fastify), Capacitor, the timeline, errors, audit, TanStack Query, agent skills, browser agents and writing a plugin. - A roadmap page. +- The Express and other servers pages say which port the WebSocket side-car uses (the first free one from 9777), how to pin it with `ws: {port}`, and how to serve the socket on the app's own server with `attach(server)` (#426). - A **Renamed tools** table in the agent tools page, and the public API and the supported versions in the publishing guide. - Corrected guides and samples from the readiness review: the Vite auth default in the Analog guide and the glossary, JSON samples without a path comment, no separate devframe install in the package README, and `ws: false` for a panel-only devframe host. diff --git a/packages/devtools/build/entries.ts b/packages/devtools/build/entries.ts index 6022c5e7..fd812323 100644 --- a/packages/devtools/build/entries.ts +++ b/packages/devtools/build/entries.ts @@ -34,7 +34,10 @@ export const BROWSER_ENTRIES = { /** Entries that only run in Node: the servers, the Vite plugin and the CLI. */ export const NODE_ENTRIES = { - devframe: 'src/entries/devframe.ts', + // The published `devframe` entry is a loader too: an Angular 20 server bundle can't take in + // devframe's own files (`package-loader.ts`), so it loads `devframe-server` at runtime. + devframe: 'src/entries/devframe-loader.ts', + 'devframe-server': 'src/entries/devframe.ts', vite: 'src/entries/vite.ts', // The published `hub` entry is a loader that imports no package, so an // app's server bundle never takes in the hub's server code (`hub-entry.ts`). @@ -111,9 +114,17 @@ export function assertBrowserSafe( * more, such as the on/off switch, are fine. */ export function assertHubLoaderStandsAlone(chunks: readonly GraphChunk[]): void { + assertLoaderStandsAlone(chunks, 'hub'); +} + +/** The published entries that are loaders: they load their server code from the package at runtime. */ +export const LOADER_ENTRIES = ['hub', 'devframe'] as const; + +/** Throws when the published loader `entry` reaches a package or a builtin. See `assertHubLoaderStandsAlone`. */ +export function assertLoaderStandsAlone(chunks: readonly GraphChunk[], entry: string): void { const byFile = new Map(chunks.filter((c) => c.type !== 'asset').map((c) => [c.fileName, c])); - const hub = [...byFile.values()].find((c) => c.isEntry && c.name === 'hub'); - if (!hub) throw new Error('No `hub` entry chunk was built.'); + const loader = [...byFile.values()].find((c) => c.isEntry && c.name === entry); + if (!loader) throw new Error(`No \`${entry}\` entry chunk was built.`); const outside: string[] = []; const seen = new Set(); const walk = (chunk: GraphChunk): void => { @@ -125,10 +136,10 @@ export function assertHubLoaderStandsAlone(chunks: readonly GraphChunk[]): void else outside.push(`${chunk.fileName} -> ${id}`); } }; - walk(hub); + walk(loader); if (outside.length) { throw new Error( - `The published hub loader must not import packages or builtins, but it reaches:\n ${outside.join('\n ')}`, + `The published ${entry} loader must not import packages or builtins, but it reaches:\n ${outside.join('\n ')}`, ); } } diff --git a/packages/devtools/src/__tests__/build-entries.test.ts b/packages/devtools/src/__tests__/build-entries.test.ts index d47f8684..08e3a8b2 100644 --- a/packages/devtools/src/__tests__/build-entries.test.ts +++ b/packages/devtools/src/__tests__/build-entries.test.ts @@ -1,6 +1,7 @@ -import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'; +import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'; import { tmpdir } from 'node:os'; import { join } from 'node:path'; +import { pathToFileURL } from 'node:url'; import { afterAll, describe, expect, it } from 'vitest'; import { build, type UserConfig } from 'tsdown'; import { @@ -8,6 +9,7 @@ import { NODE_ENTRIES, assertBrowserSafe, assertHubLoaderStandsAlone, + assertLoaderStandsAlone, nodeImportsFromEntries, type GraphChunk, } from '../../build/entries.ts'; @@ -148,4 +150,57 @@ describe('the real build', () => { // No top-level `createRequire` binding to collide with Angular 20's banner. expect(code).not.toMatch(/^(?:import|const|let|var|function|class)\b[^\n]*\bcreateRequire\b/m); }, 60_000); + + it('builds a devframe loader that imports no package and loads the installed definition', async () => { + const { outDir, chunks } = await buildInto(nodeConfig, 'node-devframe'); + expect(() => assertLoaderStandsAlone(chunks, 'devframe')).not.toThrow(); + // Every chunk the loader reaches: what an app's server bundle takes in. + const graph = chunks as readonly GraphChunk[]; + const byFile = new Map(graph.map((chunk) => [chunk.fileName, chunk])); + const reached = new Set(); + const walk = (fileName: string) => { + if (reached.has(fileName)) return; + reached.add(fileName); + for (const id of byFile.get(fileName)?.imports ?? []) walk(id); + }; + walk(graph.find((chunk) => chunk.isEntry && chunk.name === 'devframe')!.fileName); + for (const fileName of reached) { + const code = readFileSync(join(outDir, fileName), 'utf8'); + expect(code, fileName).not.toMatch(/^import[^\n]*from\s*["'](?!\.\/)/m); + // No top-level `createRequire` binding to collide with Angular 20's banner. + expect(code, fileName).not.toMatch( + /^(?:import|const|let|var|function|class)\b[^\n]*\bcreateRequire\b/m, + ); + } + // Put those chunks in an app's server bundle next to an installed package, as `ng build` does. + const app = join(work, 'devframe-app'); + const pkg = join(app, 'node_modules/@pangular-inspector/devtools'); + mkdirSync(join(pkg, 'dist'), { recursive: true }); + mkdirSync(join(app, 'dist/server'), { recursive: true }); + writeFileSync( + join(pkg, 'package.json'), + JSON.stringify({ + name: '@pangular-inspector/devtools', + type: 'module', + exports: { './package.json': './package.json' }, + }), + ); + writeFileSync( + join(pkg, 'dist/devframe-server.mjs'), + "export const createPangular = () => 'installed';\nexport const initDevframe = () => 'init';\nexport default { id: 'pangular' };\n", + ); + for (const fileName of reached) { + writeFileSync(join(app, 'dist/server', fileName), readFileSync(join(outDir, fileName))); + } + const entry = (await import(pathToFileURL(join(app, 'dist/server/devframe.mjs')).href)) as { + default: { id: string }; + createPangular: () => string; + initDevframe: () => string; + PANGULAR_INSPECTORS: readonly string[]; + }; + expect(entry.default).toEqual({ id: 'pangular' }); + expect(entry.createPangular()).toBe('installed'); + expect(entry.initDevframe()).toBe('init'); + expect(entry.PANGULAR_INSPECTORS).toContain('components'); + }, 60_000); }); diff --git a/packages/devtools/src/__tests__/config.test.ts b/packages/devtools/src/__tests__/config.test.ts index 1a7118c5..95e14630 100644 --- a/packages/devtools/src/__tests__/config.test.ts +++ b/packages/devtools/src/__tests__/config.test.ts @@ -11,6 +11,7 @@ import { SHARED_RPC, agentAllowed, agentSafety, + connectionConfig, pangularConfigProblems, pickPangularConfig, resolvePangularConfig, @@ -609,7 +610,9 @@ describe('hub', () => { await hub.handler(new Request('http://localhost/__devframes/pangular/__connection.json')) ).json(); expect(meta.configs['pangular']).toEqual( - resolvePangularConfig({ inspectors: { ngrx: false }, agent: { readOnly: true } }), + connectionConfig( + resolvePangularConfig({ inspectors: { ngrx: false }, agent: { readOnly: true } }), + ), ); }); }); diff --git a/packages/devtools/src/__tests__/connection-redaction.test.ts b/packages/devtools/src/__tests__/connection-redaction.test.ts new file mode 100644 index 00000000..3bbc1e06 --- /dev/null +++ b/packages/devtools/src/__tests__/connection-redaction.test.ts @@ -0,0 +1,55 @@ +import { afterEach, describe, expect, it } from 'vitest'; +import { initPangularHub } from '../hub.ts'; +import { REDACTION_CONFIG_RPC } from '../overlay-redaction.ts'; +import { makeProject } from './analog-fixture.ts'; + +const hubs: { close: () => Promise }[] = []; + +afterEach(async () => { + for (const hub of hubs.splice(0)) await hub.close(); +}); + +async function boot() { + const hub = initPangularHub({ + cwd: makeProject({ 'package.json': '{}' }), + ws: false, + allowedOrigins: false, + inspectors: { ngrx: false }, + redaction: { secretNames: ['passport'], unmask: ['pin'] }, + }); + hubs.push(hub); + await hub.ready; + return { hub, ctx: await hub.context }; +} + +describe('the redaction config and __connection.json', () => { + it('leaves the redaction config out of the connection info served before pairing', async () => { + const { hub } = await boot(); + const response = await hub.handler( + new Request('http://localhost/__devframes/pangular/__connection.json'), + ); + expect(response.status).toBe(200); + const text = await response.text(); + expect(text).not.toContain('passport'); + expect(text).not.toContain('secretNames'); + expect(text).not.toContain('unmask'); + const pangular = JSON.parse(text).configs.pangular; + expect(pangular).not.toHaveProperty('redaction'); + // The rest of the config still reaches the page and the panel. + expect(pangular.inspectors.ngrx).toBe(false); + }); + + it('sends the redaction config through a function only a trusted client can call', async () => { + const { ctx } = await boot(); + const name = `pangular:${REDACTION_CONFIG_RPC}`; + // devframe lets an untrusted client call `anonymous:` functions only. + expect(name.startsWith('anonymous:')).toBe(false); + const invoke = ctx.rpc.invokeLocal.bind(ctx.rpc) as unknown as ( + name: string, + ) => Promise; + expect(await invoke(name)).toEqual({ + secretNames: ['passport'], + unmask: ['pin'], + }); + }); +}); diff --git a/packages/devtools/src/__tests__/devframe-loader.test.ts b/packages/devtools/src/__tests__/devframe-loader.test.ts new file mode 100644 index 00000000..b7c72f9e --- /dev/null +++ b/packages/devtools/src/__tests__/devframe-loader.test.ts @@ -0,0 +1,83 @@ +import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'; +import { createRequire } from 'node:module'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; +import { pathToFileURL } from 'node:url'; +import { afterAll, describe, expect, it } from 'vitest'; +import { loadDevframeServer } from '../devframe-entry.ts'; +import type { PackageLoaderHost } from '../package-loader.ts'; + +const work = mkdtempSync(join(tmpdir(), 'pangular-devframe-entry-')); +afterAll(() => rmSync(work, { recursive: true, force: true })); + +/** + * An app with the package installed and its server bundle in `dist/server`, + * as `ng build` leaves it. The installed `devframe-server.mjs` is a stand-in. + */ +function installedApp(name: string): string { + const app = join(work, name); + const pkg = join(app, 'node_modules/@pangular-inspector/devtools'); + mkdirSync(join(pkg, 'dist'), { recursive: true }); + mkdirSync(join(app, 'dist/server'), { recursive: true }); + writeFileSync( + join(pkg, 'package.json'), + JSON.stringify({ + name: '@pangular-inspector/devtools', + type: 'module', + exports: { './package.json': './package.json' }, + }), + ); + writeFileSync( + join(pkg, 'dist/devframe-server.mjs'), + "export const createPangular = (options) => ({ from: 'installed', options });\nexport default { id: 'pangular' };\n", + ); + return app; +} + +describe('loadDevframeServer', () => { + it('loads the installed devframe definition from inside an app server bundle', () => { + const app = installedApp('bundled'); + const host: PackageLoaderHost = { + createRequire, + from: pathToFileURL(join(app, 'dist/server/chunk-ABC.mjs')).href, + }; + const server = loadDevframeServer(host) as unknown as { + createPangular: (options: unknown) => unknown; + default: { id: string }; + }; + expect(server.createPangular({ inspectors: {} })).toEqual({ + from: 'installed', + options: { inspectors: {} }, + }); + expect(server.default.id).toBe('pangular'); + }); + + it('requires dist/devframe-server.mjs next to the resolved package.json', () => { + const required: string[] = []; + const requireStub = Object.assign( + (id: string) => { + required.push(id); + return {}; + }, + { resolve: () => '/store/@pangular-inspector/devtools/package.json' }, + ); + loadDevframeServer({ createRequire: () => requireStub, from: 'file:///app/server.mjs' }); + expect(required).toEqual(['/store/@pangular-inspector/devtools/dist/devframe-server.mjs']); + }); + + it('names the Node.js versions it needs when require() cannot load ES modules', () => { + const requireStub = Object.assign( + () => { + throw Object.assign(new Error('require() of ES Module'), { code: 'ERR_REQUIRE_ESM' }); + }, + { resolve: () => '/app/node_modules/@pangular-inspector/devtools/package.json' }, + ); + expect(() => + loadDevframeServer({ createRequire: () => requireStub, from: 'file:///app/server.mjs' }), + ).toThrow(/The devframe entry needs Node\.js 20\.19, 22\.12 or later/); + }); + + it('refuses to run off Node', () => { + expect(() => loadDevframeServer({ from: 'file:///app/server.mjs' })).toThrow(/Node\.js only/); + }); +}); diff --git a/packages/devtools/src/__tests__/hub.test.ts b/packages/devtools/src/__tests__/hub.test.ts index 63e715ac..ad685e22 100644 --- a/packages/devtools/src/__tests__/hub.test.ts +++ b/packages/devtools/src/__tests__/hub.test.ts @@ -1,5 +1,6 @@ import { mkdtempSync, readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs'; -import { connect } from 'node:net'; +import { createServer } from 'node:http'; +import { connect, type AddressInfo } from 'node:net'; import { tmpdir } from 'node:os'; import { join } from 'node:path'; import { Hono } from 'hono'; @@ -512,6 +513,92 @@ describe('Pangular Inspector hub on a server that reloads server.ts', () => { }); }); +function freePort(): Promise { + return new Promise((resolve, reject) => { + const server = createServer(); + server.once('error', reject); + server.listen(0, 'localhost', () => { + const { port } = server.address() as AddressInfo; + server.close(() => resolve(port)); + }); + }); +} + +describe('Pangular Inspector hub WebSocket port', () => { + it('runs the side-car WebSocket on the port given in ws.port and advertises it', async () => { + const port = await freePort(); + const hub = initPangularHub({ + cwd: makeProject({ 'package.json': '{}' }), + ws: { port }, + auth: false, + allowedOrigins: false, + }); + hubs.push(hub); + await hub.ready; + const meta = hub.connectionMeta() as { backend: string; websocket: { port: number } }; + expect(meta.backend).toBe('websocket'); + expect(meta.websocket.port).toBe(port); + expect(await listening(port)).toBe(true); + await hub.close(); + expect(await listening(port)).toBe(false); + }); + + it('does not move a pinned port that is taken', async () => { + const taken = createServer(); + await new Promise((resolve) => taken.listen(0, 'localhost', resolve)); + const { port } = taken.address() as AddressInfo; + vi.spyOn(console, 'error').mockImplementation(() => {}); + try { + const hub = initPangularHub({ + cwd: makeProject({ 'package.json': '{}' }), + ws: { port }, + auth: false, + allowedOrigins: false, + }); + hubs.push(hub); + await expect(hub.ready).rejects.toThrow(/EADDRINUSE/); + } finally { + await new Promise((resolve) => taken.close(resolve)); + } + }); + + it('picks the first free port from 9777 for ws: {sidecar: true}', async () => { + const hub = initPangularHub({ + cwd: makeProject({ 'package.json': '{}' }), + ws: { sidecar: true }, + auth: false, + allowedOrigins: false, + }); + hubs.push(hub); + await hub.ready; + const { port } = (hub.connectionMeta() as { websocket: { port: number } }).websocket; + expect(port).toBeGreaterThanOrEqual(9777); + expect(port).toBeLessThanOrEqual(9877); + }); + + it('serves the WebSocket on the app server after attach(server), without a side-car port', async () => { + const server = createServer(); + await new Promise((resolve) => server.listen(0, 'localhost', resolve)); + const hub = initPangularHub({ + cwd: makeProject({ 'package.json': '{}' }), + auth: false, + allowedOrigins: false, + }); + hubs.push(hub); + const detach = hub.attach(server); + try { + await hub.ready; + const meta = hub.connectionMeta() as { websocket: { port?: number; path: string } }; + expect(meta.websocket.port).toBeUndefined(); + expect(meta.websocket.path).toBe('/__devframes/__ws'); + expect(server.listenerCount('upgrade')).toBeGreaterThan(0); + } finally { + detach(); + await new Promise((resolve) => server.close(resolve)); + } + }); +}); + describe('Pangular Inspector hub server state', () => { it('turns off server HTTP capture when the hub that owns it closes', async () => { const { hub, ctx } = await boot(makeProject({ 'package.json': '{}' })); diff --git a/packages/devtools/src/__tests__/overlay-angular-native.test.ts b/packages/devtools/src/__tests__/overlay-angular-native.test.ts index 1c324f52..713945c5 100644 --- a/packages/devtools/src/__tests__/overlay-angular-native.test.ts +++ b/packages/devtools/src/__tests__/overlay-angular-native.test.ts @@ -1,6 +1,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { collectComponentTree, hostPath } from '../component-tree.ts'; import { elementId } from '../element-id.ts'; +import { isSecretKey, setRedaction } from '../forms-privacy.ts'; import { hostBySelector } from '../host-tree.ts'; import { collectInjectorTree } from '../injector-tree.ts'; import { createNgrxCollector } from '../ngrx-collector.ts'; @@ -280,7 +281,7 @@ describe('showOutline', () => { describe('initAngularNativeOverlay', () => { type Handler = (...args: unknown[]) => unknown; - function fakeRpc(trusted = true) { + function fakeRpc(trusted = true, replies: Record = {}) { const calls: [string, unknown][] = []; const handlers = new Map(); const rpc = { @@ -292,7 +293,7 @@ describe('initAngularNativeOverlay', () => { rpc: { call: vi.fn(async (name: string, arg: unknown) => { calls.push([name, arg]); - return { known: true }; + return name in replies ? replies[name] : { known: true }; }), register: (definition: { name: string; handler: Handler }) => handlers.set(definition.name, definition.handler), @@ -366,6 +367,33 @@ describe('initAngularNativeOverlay', () => { expect(session.rpc.close).toHaveBeenCalled(); }); + it('asks the trusted server for its redaction config before the first report', async () => { + const { root, ng } = fixture(); + g['ng'] = ng; + const session = fakeRpc(true, { + 'redaction-config': { secretNames: ['passport'], unmask: [] }, + }); + connectDevframe.mockResolvedValue(session.rpc); + const { initAngularNativeOverlay } = await import('../overlay-angular-native.ts'); + const dispose = initAngularNativeOverlay({ root: asNode(root), intervalMs: 1000 }); + try { + await vi.waitFor(() => + expect(session.calls.some(([name]) => name === 'push-component-tree')).toBe(true), + ); + const names = session.calls.map(([name]) => name); + expect(names.indexOf('redaction-config')).toBeGreaterThan(-1); + expect(names.indexOf('redaction-config')).toBeLessThan( + names.findIndex((name) => name.startsWith('push-')), + ); + expect(session.rpc.ensureTrusted).toHaveBeenCalled(); + expect(isSecretKey('passportNumber')).toBe(true); + } finally { + dispose(); + await vi.advanceTimersByTimeAsync(0); + setRedaction(); + } + }); + it("runs the diagnosis collectors and hears React Native's global errors", async () => { const { root, ng } = fixture(); g['ng'] = ng; diff --git a/packages/devtools/src/__tests__/overlay-page-key.test.ts b/packages/devtools/src/__tests__/overlay-page-key.test.ts index 92ba4718..1cde9718 100644 --- a/packages/devtools/src/__tests__/overlay-page-key.test.ts +++ b/packages/devtools/src/__tests__/overlay-page-key.test.ts @@ -60,7 +60,8 @@ describe.sequential('overlay page key', () => { const [claim] = claims(); expect(claim.pageId).toBe(window.__pangularPageId); expect(claim.key).toMatch(/^[0-9a-f]{32}$/); - expect(calls[0].name).toBe('claim-page'); + // Before any report. Only the redaction config, which the page needs to read anything, comes first. + expect(calls.find((call) => call.name !== 'redaction-config')?.name).toBe('claim-page'); expect(sessionStorage.getItem('pangular-page-key')).toBe(claim.key); dispose(); diff --git a/packages/devtools/src/__tests__/overlay-redaction.test.ts b/packages/devtools/src/__tests__/overlay-redaction.test.ts new file mode 100644 index 00000000..ae32e7c8 --- /dev/null +++ b/packages/devtools/src/__tests__/overlay-redaction.test.ts @@ -0,0 +1,146 @@ +// @vitest-environment jsdom +import '@angular/compiler'; +import { afterEach, describe, expect, it, vi } from 'vitest'; +import { isSecretKey, setRedaction } from '../forms-privacy.ts'; +import { serverRedaction, whenTrusted, type TrustClient } from '../overlay-redaction.ts'; + +type Listener = (status: string) => void; + +/** A devframe client double: trust and status change when the test says so. */ +function fakeClient(trusted: boolean) { + const listeners = new Set(); + const calls: string[] = []; + const replies = new Map(); + const client = { + status: trusted ? 'connected' : 'unauthorized', + isTrusted: trusted, + connectionMeta: { backend: 'websocket', configs: { pangular: {} } }, + events: { + on: (event: string, listener: Listener) => { + if (event !== 'connection:status') return () => {}; + listeners.add(listener); + return () => listeners.delete(listener); + }, + }, + scope: () => ({ + rpc: { + call: async (name: string) => { + calls.push(name); + if (!client.isTrusted) throw new Error('[devframe] Not authorized'); + return replies.get(name); + }, + register: () => {}, + }, + }), + close: () => {}, + trust() { + client.isTrusted = true; + client.status = 'connected'; + for (const listener of [...listeners]) listener('connected'); + }, + }; + return { client, calls, replies, listeners }; +} + +let next: ReturnType['client'] | undefined; + +vi.mock('devframe/client', () => ({ + connectDevframe: async () => next, + forgetDevframeConnection: () => {}, +})); + +const stops: (() => void)[] = []; + +afterEach(() => { + stops.splice(0).forEach((stop) => stop()); + sessionStorage.clear(); + setRedaction(); + next = undefined; +}); + +const tick = (ms = 50) => new Promise((resolve) => setTimeout(resolve, ms)); + +describe('whenTrusted', () => { + it('resolves at once for a trusted client or one that says nothing about trust', async () => { + await expect(whenTrusted(fakeClient(true).client)).resolves.toBeUndefined(); + await expect(whenTrusted({})).resolves.toBeUndefined(); + }); + + it('waits for an untrusted client until it is trusted', async () => { + const { client, listeners } = fakeClient(false); + let done = false; + void whenTrusted(client).then(() => (done = true)); + await tick(10); + expect(done).toBe(false); + client.trust(); + await tick(0); + expect(done).toBe(true); + expect(listeners.size).toBe(0); + }); + + it('stops waiting when the connection drops', async () => { + const listeners: Listener[] = []; + const client: TrustClient = { + status: 'connecting', + isTrusted: false, + events: { on: (_event, listener) => void listeners.push(listener) }, + }; + const waiting = whenTrusted(client); + listeners.forEach((listener) => listener('disconnected')); + await expect(waiting).resolves.toBeUndefined(); + }); +}); + +describe('serverRedaction', () => { + const fallback = { secretNames: ['fallback'], unmask: [] }; + + it('returns the lists the server sends', async () => { + const rpc = { call: async () => ({ secretNames: ['passport'], unmask: ['pin'] }) }; + expect(await serverRedaction(rpc, fallback)).toEqual({ + secretNames: ['passport'], + unmask: ['pin'], + }); + }); + + it('falls back for a server without the function or a malformed answer', async () => { + expect( + await serverRedaction({ call: async () => Promise.reject(new Error('no')) }, fallback), + ).toBe(fallback); + expect(await serverRedaction({ call: async () => undefined }, fallback)).toBe(fallback); + expect(await serverRedaction({ call: async () => ({ secretNames: [1] }) }, fallback)).toBe( + fallback, + ); + }); +}); + +describe('the overlay and the redaction config', () => { + it('applies the server redaction config before its first report', async () => { + const fake = fakeClient(true); + fake.replies.set('redaction-config', { secretNames: ['passport'], unmask: [] }); + next = fake.client; + const { initOverlay } = await import('../overlay.ts'); + stops.push(await initOverlay()); + await tick(100); + const asked = fake.calls.indexOf('redaction-config'); + const firstPush = fake.calls.findIndex((name) => name.startsWith('push-')); + expect(asked).toBeGreaterThanOrEqual(0); + expect(firstPush).toBeGreaterThan(asked); + expect(isSecretKey('passportNumber')).toBe(true); + }); + + it('reads nothing from the app until a page waiting for the code is trusted', async () => { + const fake = fakeClient(false); + fake.replies.set('redaction-config', { secretNames: ['passport'], unmask: [] }); + next = fake.client; + const { initOverlay } = await import('../overlay.ts'); + const started = initOverlay(); + await tick(100); + expect(fake.calls).toEqual([]); + expect(isSecretKey('passportNumber')).toBe(false); + fake.client.trust(); + stops.push(await started); + await tick(100); + expect(fake.calls[0]).toBe('redaction-config'); + expect(isSecretKey('passportNumber')).toBe(true); + }); +}); diff --git a/packages/devtools/src/__tests__/public-api.test.ts b/packages/devtools/src/__tests__/public-api.test.ts index c50a477e..052e678c 100644 --- a/packages/devtools/src/__tests__/public-api.test.ts +++ b/packages/devtools/src/__tests__/public-api.test.ts @@ -1,9 +1,16 @@ import '@angular/compiler'; import { readFileSync } from 'node:fs'; import { join } from 'node:path'; -import { describe, expect, it } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; import { BROWSER_ENTRIES, NODE_ENTRIES } from '../../build/entries.ts'; +// The published `devframe` entry loads the built definition from the installed package; here it +// gets the sources instead, which have no build to load. +vi.mock('../devframe-entry.ts', async () => { + const source = await import('../entries/devframe.ts'); + return { loadDevframeServer: () => source }; +}); + // The values each entry point exports at runtime. Everything an entry exports is frozen by semver // from 1.0, so a new export is a deliberate change to this list and to the docs that cover it. // Types are checked by the published `.d.mts` files (`stripInternal` drops `@internal` ones). @@ -47,15 +54,22 @@ describe('the public API of each entry point', () => { expect(Object.keys(source).sort()).toEqual([...PUBLIC_VALUES['hub']!].sort()); }); + it('exposes the same devframe names inside the workspace as in the published package', async () => { + const source = (await import('../entries/devframe.ts')) as Record; + expect(Object.keys(source).sort()).toEqual([...PUBLIC_VALUES['devframe']!].sort()); + }); + it('points the workspace exports at the same entry files the build publishes', () => { const manifest = JSON.parse(readFileSync(join(packageDir, 'package.json'), 'utf8')) as { exports: Record; publishConfig: { exports: Record }; }; - for (const name of ['config', 'devframe', 'vite', 'cli', 'http']) { + for (const name of ['config', 'vite', 'cli', 'http']) { expect(manifest.exports[`./${name}`]).toBe(`./${entries[name]}`); } - expect(manifest.exports['.']).toBe(`./${entries['devframe']}`); + // The published `devframe` entry is a loader; the workspace points at what it loads. + expect(manifest.exports['./devframe']).toBe(`./${entries['devframe-server']}`); + expect(manifest.exports['.']).toBe(`./${entries['devframe-server']}`); // Internals are a workspace convenience, never published. expect(manifest.exports['./internal/config']).toBeDefined(); expect( diff --git a/packages/devtools/src/config.ts b/packages/devtools/src/config.ts index c693227b..5872bff0 100644 --- a/packages/devtools/src/config.ts +++ b/packages/devtools/src/config.ts @@ -844,6 +844,18 @@ export function pangularConfigWarning(config: unknown): string | undefined { return `[pangular] The devtools config has ${problems.length === 1 ? 'a problem' : `${problems.length} problems`}:\n${problems.map((problem) => ` - ${problem}`).join('\n')}`; } +/** + * The config a server publishes in `__connection.json`, which answers before + * the one-time code: everything but `redaction`, so the names the app treats + * as secret go only to a trusted client (the `redaction-config` function). + */ +export function connectionConfig( + config: ResolvedPangularConfig, +): Omit { + const { redaction: _redaction, ...rest } = config; + return rest; +} + /** Reads the config a server published in its connection info (`connectionMeta.configs`). */ export function configFromConnection( meta: { configs?: object } | undefined, @@ -1263,6 +1275,8 @@ export function actionBlockedMessage(action: PangularAction): string { export const SHARED_RPC: readonly string[] = [ 'build-meta', 'claim-page', + // The redaction config, kept out of `__connection.json`: every page needs it. + 'redaction-config', 'report-page-visibility', // Each page's Angular version and debug API parts, read by every view. 'report-page-angular', diff --git a/packages/devtools/src/devframe-entry.ts b/packages/devtools/src/devframe-entry.ts new file mode 100644 index 00000000..53f777ff --- /dev/null +++ b/packages/devtools/src/devframe-entry.ts @@ -0,0 +1,24 @@ +// The loader behind the published `@pangular-inspector/devtools/devframe` +// entry (`entries/devframe-loader.ts`): it imports no package and loads the +// devframe definition (`entries/devframe.ts`, published as +// `dist/devframe-server.mjs`) from the installed package. +// `package-loader.ts` says why devframe's code must not be bundled into an +// app's server, such as an Angular 20 one. + +import type * as DevframeServer from './entries/devframe.ts'; +import { loadPackageFile, nodeLoaderHost, type PackageLoaderHost } from './package-loader.ts'; + +const SERVER_FILE = 'dist/devframe-server.mjs'; + +/** + * Loads `dist/devframe-server.mjs` from the installed package. The package is + * found from this module's URL: inside an app's server bundle that is the + * bundle's folder, where the app's own dependency on this package resolves. + * + * @internal + */ +export function loadDevframeServer( + host: PackageLoaderHost = nodeLoaderHost(import.meta.url), +): typeof DevframeServer { + return loadPackageFile(SERVER_FILE, 'The devframe entry', host) as typeof DevframeServer; +} diff --git a/packages/devtools/src/devframe.ts b/packages/devtools/src/devframe.ts index efe4feda..96ffd28d 100644 --- a/packages/devtools/src/devframe.ts +++ b/packages/devtools/src/devframe.ts @@ -126,7 +126,6 @@ import { type PageReport, type FormsState, type InspectFormsArgs, - FORMS_PAGE_TTL_MS, UNTRUSTED, untrusted, } from './rpc/forms-tools.ts'; @@ -169,7 +168,6 @@ import { touchRouterPage, type RouterPage, type RouterState, - ROUTER_PAGE_TTL_MS, } from './rpc/router-tools.ts'; import { explainRenderModeText, @@ -259,10 +257,12 @@ import { } from './rpc/open-in-panel.ts'; import { clip } from './text.ts'; import { setRedaction } from './forms-privacy.ts'; +import { REDACTION_CONFIG_RPC } from './overlay-redaction.ts'; import { FORM_WRITE_ACTIONS, FORMLESS_FORM_ACTIONS, PANGULAR_CONFIG_KEY, + connectionConfig, ROUTER_WRITE_ACTIONS, actionBlockedMessage, agentAllowed, @@ -383,7 +383,7 @@ const pangular = defineDevframe({ const on = config.inspectors; const limits = config.limits; const my = ctx.scope('pangular'); - (ctx.staticConfig as Record)[PANGULAR_CONFIG_KEY] = config; + (ctx.staticConfig as Record)[PANGULAR_CONFIG_KEY] = connectionConfig(config); const rootRefusal = info?.notAProject && notAProjectText(info.notAProject); const register: typeof my.rpc.register = (definition) => { if (!rpcAllowed(definition.name, config)) return; @@ -530,9 +530,8 @@ const pangular = defineDevframe({ const pageId = message?.pageId; if (typeof pageId !== 'string' || !pageId || pageId.length >= 50) return undefined; if (!owners.write(pageId)) return undefined; - // The forms timeline and the router history outlive the page, counted - // from its last sign of life, so a beat counts as their report, in - // the shared states too: their tools call a page stale by it. + // The forms and router tools call a page stale by its last report, so + // a beat counts as their report, in the shared states too. const now = Date.now(); touchFormsPage(pageId, now); touchRouter(pageId, now); @@ -571,6 +570,14 @@ const pangular = defineDevframe({ switch: browserToolsSwitch, }); + // Not in `__connection.json`: only a trusted page learns which names are secret. + register({ + name: REDACTION_CONFIG_RPC, + type: 'query', + jsonSerializable: true, + handler: () => config.redaction, + }); + let onPageClaimed = (_pageId: string) => {}; register({ name: 'claim-page', @@ -793,15 +800,7 @@ const pangular = defineDevframe({ jsonSerializable: true, handler: deltaPush(formDeltas, owns, (report) => { if (!isPageReport(report) || !owns(report.pageId)) return false; - applyForms( - mergePageReport( - formPages, - report, - Date.now(), - limits.formTimeline, - visibility.ttl(FORMS_PAGE_TTL_MS), - ), - ); + applyForms(mergePageReport(formPages, report, Date.now(), limits.formTimeline, liveTtl)); feed.ngErrors(report.pageId, 'forms', report.setupErrors ?? []); return true; }), @@ -1048,9 +1047,7 @@ const pangular = defineDevframe({ if (!isRouterReport(report, limits.navigations)) return { hasConfig: false }; if (!owns(report.pageId)) return { hasConfig: true }; try { - applyRouter( - mergeRouterReport(routerPages, report, Date.now(), visibility.ttl(ROUTER_PAGE_TTL_MS)), - ); + applyRouter(mergeRouterReport(routerPages, report, Date.now(), liveTtl)); } catch { routerPages.delete(report.pageId); applyRouter(currentRouter(routerPages)); @@ -1464,14 +1461,9 @@ const pangular = defineDevframe({ for (const [id] of staleInjectors) injectorPages.delete(id); applyInjectorPages(); } - const next = expirePages( - formPages, - now, - limits.formTimeline, - visibility.ttl(FORMS_PAGE_TTL_MS), - ); + const next = expirePages(formPages, now, limits.formTimeline, liveTtl); if (next) applyForms(next); - const nextRouter = expireRouterPages(routerPages, now, visibility.ttl(ROUTER_PAGE_TTL_MS)); + const nextRouter = expireRouterPages(routerPages, now, liveTtl); if (nextRouter) applyRouter(nextRouter); const nextPipes = expirePipePages(pipePages, now, liveTtl); if (nextPipes) applyPipes(nextPipes); @@ -1488,8 +1480,7 @@ const pangular = defineDevframe({ cdDeltas.prune((id) => cdPages.has(id)); formDeltas.prune((id) => formPages.has(id)); // A page that stopped reporting (a closed browser that never said - // goodbye) is gone, so a wake doesn't wait for it. Forms are left out: - // their reports outlive the page to keep the timeline. + // goodbye) is gone, so a wake doesn't wait for it. interest.prune( (id) => owners.alive(id) || componentPages.has(id) || injectorPages.has(id) || cdPages.has(id), @@ -4086,7 +4077,7 @@ const pangular = defineDevframe({ id: 'pangular:inspect-forms', title: 'Inspect forms', description: - 'Forms on the page (Signal Forms, reactive, template-driven). Without `form`: each form with status and error counts. With `form`: the field tree; narrow with `path`, `onlyInvalid`, `includeValues`. Masked; cut at 20,000 characters.', + 'Forms on the page (Signal Forms, reactive, template-driven). Without `form`: each form with status and error counts. With `form`: the field tree; narrow with `path`, `onlyInvalid`, `includeValues`. Reads 100 fields per group and says when it cut one. Masked; cut at 20,000 characters.', inputSchema: { type: 'object', properties: { @@ -4124,7 +4115,7 @@ const pangular = defineDevframe({ id: 'pangular:explain-invalid-forms', title: 'Explain invalid forms', description: - 'Why forms are invalid: each failing field with value, validator, message and touched state, plus pending async validators and disabled reasons. Without `form`, every invalid form.', + 'Why forms are invalid: each failing field with value, validator, message and touched state, plus pending async validators and disabled reasons. Without `form`, every invalid form. Reads 100 fields per group; says when a failing field may be past that.', inputSchema: { type: 'object', properties: { diff --git a/packages/devtools/src/entries/devframe-loader.ts b/packages/devtools/src/entries/devframe-loader.ts new file mode 100644 index 00000000..20d2ab65 --- /dev/null +++ b/packages/devtools/src/entries/devframe-loader.ts @@ -0,0 +1,20 @@ +// The published `@pangular-inspector/devtools` and `/devframe` entries: the public config types +// and defaults, which import nothing, and the devframe definition, `createPangular()` and +// `initDevframe()`, loaded from `node_modules` when the entry is imported (`devframe-entry.ts`). +// Inside this workspace the same names come from `devframe.ts` in this folder. +import { loadDevframeServer } from '../devframe-entry.ts'; + +export * from './config.ts'; +export type { PangularHostOptions } from './devframe.ts'; + +const server = loadDevframeServer(); + +/** The devframe definition with options. */ +export const createPangular: typeof server.createPangular = server.createPangular; + +/** devframe's `initDevframe()`, from the copy this package depends on. */ +export const initDevframe: typeof server.initDevframe = server.initDevframe; + +/** The devframe definition with the default options. */ +const pangular: typeof server.default = server.default; +export default pangular; diff --git a/packages/devtools/src/hub-entry.ts b/packages/devtools/src/hub-entry.ts index 79e015e3..10bc85a9 100644 --- a/packages/devtools/src/hub-entry.ts +++ b/packages/devtools/src/hub-entry.ts @@ -1,81 +1,31 @@ // The published `@pangular-inspector/devtools/hub` entry: a loader that // imports no package and loads the hub (`hub.ts`, published as // `dist/hub-server.mjs`) from the installed package when first called. -// -// The Angular CLI bundles `server.ts` and everything it imports. A bundled -// hub breaks in two ways: Angular 20 adds `import { createRequire } from -// 'node:module'` to every server chunk, which collides with the same import -// in devframe's own files, and devframe resolves its optional -// `@devframes/agentic` peer from the bundle's folder, where pnpm does not -// hoist it. Loaded from `node_modules`, the hub and devframe resolve their -// dependencies from their own folders, as they do under Vite. -// -// The load is synchronous (`require()` of an ES module, Node.js 20.19 and -// 22.12 or later), so `initPangularHub()` keeps returning the hub directly. -// The loader may import the dependency-free `hub-off.ts`, so a server with -// the hub off loads nothing more. +// `package-loader.ts` says why the hub must not be bundled into an app's +// server. The loader may import the dependency-free `hub-off.ts`, so a server +// with the hub off loads nothing more. import type * as HubServer from './hub.ts'; import type { PangularHubOptions } from './hub.ts'; import { disabledHub, hubEnabled, type PangularHub } from './hub-off.ts'; +import { + NODE_TOO_OLD, + loadPackageFile, + nodeLoaderHost, + type PackageLoaderHost, +} from './package-loader.ts'; export type { PangularConfig, PangularHubOptions } from './hub.ts'; export { hubEnabled } from './hub-off.ts'; -const PACKAGE_JSON = '@pangular-inspector/devtools/package.json'; const SERVER_FILE = 'dist/hub-server.mjs'; -/** The part of Node's `require` the loader uses. */ -interface LoaderRequire { - (id: string): unknown; - resolve(id: string): string; -} - /** * What the loader needs from Node, passed in by tests. * * @internal */ -export interface HubLoaderHost { - /** `createRequire` from `node:module`, or undefined off Node. */ - createRequire?: (from: string) => LoaderRequire; - /** The URL the loader resolves the package from: its own module. */ - from: string; - /** `process.versions.node`, when this is Node.js. */ - nodeVersion?: string; -} - -/** The `code` of the error `loadHubServer` throws when this Node.js cannot load the hub. */ -const NODE_TOO_OLD = 'PANGULAR_NODE_TOO_OLD'; - -/** Why the hub cannot load on this Node.js, with the versions it needs. */ -function nodeTooOld(version: string | undefined, cause?: unknown): Error { - return Object.assign( - new Error( - `[pangular] The hub needs Node.js 20.19, 22.12 or later, which can require() ES modules. This is ${version ? `v${version.replace(/^v/, '')}` : 'an older version'}.`, - cause === undefined ? undefined : { cause }, - ), - { code: NODE_TOO_OLD }, - ); -} - -function nodeHost(): HubLoaderHost { - const nodeProcess = ( - globalThis as { - process?: { - getBuiltinModule?: (id: string) => unknown; - versions?: { node?: string }; - }; - } - ).process; - const nodeModule = nodeProcess?.getBuiltinModule?.('node:module') as - { createRequire: (from: string) => LoaderRequire } | undefined; - return { - createRequire: nodeModule?.createRequire, - from: import.meta.url, - nodeVersion: nodeProcess?.versions?.node, - }; -} +export type HubLoaderHost = PackageLoaderHost; /** * Loads `dist/hub-server.mjs` from the installed package. The package is @@ -84,35 +34,10 @@ function nodeHost(): HubLoaderHost { * * @internal */ -export function loadHubServer(host: HubLoaderHost = nodeHost()): typeof HubServer { - if (!host.createRequire) { - // Node.js before 22.3 (and 20.16) has no `process.getBuiltinModule`. - if (host.nodeVersion) throw nodeTooOld(host.nodeVersion); - throw new Error('[pangular] initPangularHub() runs in Node.js only.'); - } - const requireHere = host.createRequire(host.from); - let packageJson: string; - try { - packageJson = requireHere.resolve(PACKAGE_JSON); - } catch (error) { - throw new Error( - `[pangular] Could not find @pangular-inspector/devtools from ${host.from}. Install it as a dependency of the app that runs the server.`, - { cause: error }, - ); - } - const file = packageJson.slice(0, -'package.json'.length) + SERVER_FILE; - try { - return requireHere(file) as typeof HubServer; - } catch (error) { - const code = (error as { code?: string }).code; - if (code === 'ERR_REQUIRE_ESM') { - throw nodeTooOld( - host.nodeVersion ?? (globalThis as { process?: { version?: string } }).process?.version, - error, - ); - } - throw error; - } +export function loadHubServer( + host: HubLoaderHost = nodeLoaderHost(import.meta.url), +): typeof HubServer { + return loadPackageFile(SERVER_FILE, 'The hub', host) as typeof HubServer; } let server: typeof HubServer | undefined; diff --git a/packages/devtools/src/overlay-angular-native.ts b/packages/devtools/src/overlay-angular-native.ts index 8482cdaf..7a81f2b8 100644 --- a/packages/devtools/src/overlay-angular-native.ts +++ b/packages/devtools/src/overlay-angular-native.ts @@ -6,6 +6,7 @@ import { registerComponentValues } from './component-values-overlay.ts'; import { configFromConnection } from './config.ts'; import { elementById } from './element-id.ts'; import { setRedaction } from './forms-privacy.ts'; +import { serverRedaction } from './overlay-redaction.ts'; import { hostBySelector } from './host-tree.ts'; import { collectInjectorTree } from './injector-tree.ts'; import { attachNativeDiagnostics, errorUtilsTarget, nativeDebugApi } from './native-diagnostics.ts'; @@ -188,7 +189,8 @@ async function startSession( const config = configFromConnection(rpc.connectionMeta); const on = config.inspectors; const tickMs = intervalMs ?? config.limits.refreshMs; - setRedaction(config.redaction); + // Sent only to a trusted connection, so it is not in `__connection.json`. + setRedaction(await serverRedaction(my.rpc, config.redaction)); const tree = angularNativeTree(getRoot, angularDebugApi); if (!on.ngrx) uninstallReduxDevtoolsHook(); const diagnostics = attachNativeDiagnostics(my, pageId, { diff --git a/packages/devtools/src/overlay-connection.ts b/packages/devtools/src/overlay-connection.ts index acbf351f..3328f5e1 100644 --- a/packages/devtools/src/overlay-connection.ts +++ b/packages/devtools/src/overlay-connection.ts @@ -88,7 +88,7 @@ export function overlayConnectOptions( if (!meta.configs?.[PANGULAR_CONFIG_KEY] && !warnedNoConfig) { warnedNoConfig = true; console.warn( - "[pangular] connectionMeta has no configs, so the overlay uses the default inspectors, limits and redaction, and the server's redaction.secretNames are not applied on the page. Pass the whole __connection.json of the server as connectionMeta to use its config.", + '[pangular] connectionMeta has no configs, so the overlay uses the default inspectors and limits. Pass the whole __connection.json of the server as connectionMeta to use its config.', ); } } diff --git a/packages/devtools/src/overlay-nativescript.ts b/packages/devtools/src/overlay-nativescript.ts index 346bb2f5..504b4fea 100644 --- a/packages/devtools/src/overlay-nativescript.ts +++ b/packages/devtools/src/overlay-nativescript.ts @@ -15,6 +15,7 @@ import { registerComponentValues } from './component-values-overlay.ts'; import { configFromConnection } from './config.ts'; import { elementById } from './element-id.ts'; import { setRedaction } from './forms-privacy.ts'; +import { serverRedaction } from './overlay-redaction.ts'; import { hostBySelector } from './host-tree.ts'; import { collectInjectorTree } from './injector-tree.ts'; import { @@ -206,7 +207,8 @@ async function startSession( const config = configFromConnection(rpc.connectionMeta); const on = config.inspectors; const tickMs = intervalMs ?? config.limits.refreshMs; - setRedaction(config.redaction); + // Sent only to a trusted connection, so it is not in `__connection.json`. + setRedaction(await serverRedaction(my.rpc, config.redaction)); const title = `NativeScript (${isAndroid ? 'Android' : 'iOS'})`; const tree = nativeScriptTree(angularDebugApi, () => Application.getRootView() as NativeView); diff --git a/packages/devtools/src/overlay-redaction.ts b/packages/devtools/src/overlay-redaction.ts new file mode 100644 index 00000000..1917950c --- /dev/null +++ b/packages/devtools/src/overlay-redaction.ts @@ -0,0 +1,74 @@ +// The redaction config reaches the page over RPC, after the page is trusted. +// +// `__connection.json` answers before the one-time code is exchanged, so it +// leaves the redaction config out: the names an app treats as secret are not +// for anyone who can reach the server. Every overlay asks for them with the +// `redaction-config` function once trusted, before it reads anything from the +// app, and falls back to the config in the connection info for a server that +// predates the function. + +/** The function the overlays call; it is `pangular:redaction-config` on the server. */ +export const REDACTION_CONFIG_RPC = 'redaction-config'; + +export interface RedactionConfig { + secretNames: string[]; + unmask: string[]; +} + +/** The part of a devframe client the overlay waits on. */ +export interface TrustClient { + readonly status?: string; + readonly isTrusted?: boolean | null; + events?: { + on(event: 'connection:status', listener: (status: string) => void): (() => void) | void; + }; +} + +const SETTLED = new Set(['connected', 'disconnected', 'error']); + +/** + * Resolves once `client` is trusted, or once it dropped, so the caller tries + * its call and falls back. A client still waiting for the one-time code + * (`unauthorized`) keeps the promise open until a code entered in another tab + * trusts it. A client that says nothing about trust (a static report, a test + * double) resolves at once. + */ +export function whenTrusted(client: TrustClient): Promise { + if (client.isTrusted !== false || !client.events) return Promise.resolve(); + if (SETTLED.has(client.status ?? '')) return Promise.resolve(); + return new Promise((resolve) => { + const off = client.events?.on('connection:status', (status) => { + if (!SETTLED.has(status)) return; + if (typeof off === 'function') off(); + resolve(); + }); + }); +} + +function names(value: unknown): string[] | undefined { + return Array.isArray(value) && value.every((name) => typeof name === 'string') + ? [...value] + : undefined; +} + +/** + * Asks the server for its redaction config. Returns `fallback` when the + * server has no such function or the call fails, so an older server's + * config in `__connection.json` still applies. + */ +export async function serverRedaction( + rpc: { call(name: string, ...args: unknown[]): Promise }, + fallback: RedactionConfig, +): Promise { + let answer: unknown; + try { + answer = await rpc.call(REDACTION_CONFIG_RPC); + } catch { + return fallback; + } + if (!answer || typeof answer !== 'object') return fallback; + const secretNames = names((answer as { secretNames?: unknown }).secretNames); + const unmask = names((answer as { unmask?: unknown }).unmask); + if (!secretNames || !unmask) return fallback; + return { secretNames, unmask }; +} diff --git a/packages/devtools/src/overlay.ts b/packages/devtools/src/overlay.ts index e67a9473..0926e367 100644 --- a/packages/devtools/src/overlay.ts +++ b/packages/devtools/src/overlay.ts @@ -88,6 +88,7 @@ import { import { serializeNamed } from './serialize.ts'; import { configFromConnection } from './config.ts'; import { setRedaction } from './forms-privacy.ts'; +import { serverRedaction, whenTrusted, type TrustClient } from './overlay-redaction.ts'; import { keepaliveDue, outsideAngular, @@ -321,7 +322,11 @@ async function startOverlay(options: OverlayOptions, own: (cleanup: () => void) const on = devtoolsConfig.inspectors; const limits = devtoolsConfig.limits; allowClientRules(on.http && devtoolsConfig.actions.http); - setRedaction(devtoolsConfig.redaction); + // Before the first read of the app: the server sends its secret names only to a trusted page. + await whenTrusted(rpc as unknown as TrustClient); + if (!own(() => {})) return; + setRedaction(await serverRedaction(my.rpc, devtoolsConfig.redaction)); + if (!own(() => {})) return; setNavigationLimit(limits.navigations); if (on.http) httpRegistry().maxCalls = limits.httpCalls; @@ -1049,6 +1054,7 @@ async function startOverlay(options: OverlayOptions, own: (cleanup: () => void) dropped: leave, restored: async () => { await claimPageOnServer(my.rpc, pageId, pageKey); + setRedaction(await serverRedaction(my.rpc, devtoolsConfig.redaction)); resendConfig(); }, }); diff --git a/packages/devtools/src/package-loader.ts b/packages/devtools/src/package-loader.ts new file mode 100644 index 00000000..546d9418 --- /dev/null +++ b/packages/devtools/src/package-loader.ts @@ -0,0 +1,109 @@ +// Loads one of this package's built files from the installed package, at +// runtime, instead of through an import an app's bundler would follow. +// +// The Angular CLI bundles `server.ts` and everything it imports. Bundled +// devframe code breaks in two ways: Angular 20 adds `import { createRequire } +// from 'node:module'` to every server chunk, which collides with the same +// import in devframe's own files, and devframe resolves its optional +// `@devframes/agentic` peer from the bundle's folder, where pnpm does not +// hoist it. Loaded from `node_modules`, the hub and the devframe definition +// resolve their dependencies from their own folders, as they do under Vite. +// +// The load is synchronous (`require()` of an ES module, Node.js 20.19 and +// 22.12 or later), so the entries keep returning their values directly. This +// module imports nothing at runtime. + +const PACKAGE_JSON = '@pangular-inspector/devtools/package.json'; + +/** The part of Node's `require` the loader uses. */ +interface LoaderRequire { + (id: string): unknown; + resolve(id: string): string; +} + +/** + * What the loader needs from Node, passed in by tests. + * + * @internal + */ +export interface PackageLoaderHost { + /** `createRequire` from `node:module`, or undefined off Node. */ + createRequire?: (from: string) => LoaderRequire; + /** The URL the loader resolves the package from: its own module. */ + from: string; + /** `process.versions.node`, when this is Node.js. */ + nodeVersion?: string; +} + +/** The `code` of the error `loadPackageFile` throws when this Node.js cannot load the file. */ +export const NODE_TOO_OLD = 'PANGULAR_NODE_TOO_OLD'; + +/** Why `what` cannot load on this Node.js, with the versions it needs. */ +function nodeTooOld(what: string, version: string | undefined, cause?: unknown): Error { + return Object.assign( + new Error( + `[pangular] ${what} needs Node.js 20.19, 22.12 or later, which can require() ES modules. This is ${version ? `v${version.replace(/^v/, '')}` : 'an older version'}.`, + cause === undefined ? undefined : { cause }, + ), + { code: NODE_TOO_OLD }, + ); +} + +/** The host for the running Node.js, resolving the package from `from`. */ +export function nodeLoaderHost(from: string): PackageLoaderHost { + const nodeProcess = ( + globalThis as { + process?: { + getBuiltinModule?: (id: string) => unknown; + versions?: { node?: string }; + }; + } + ).process; + const nodeModule = nodeProcess?.getBuiltinModule?.('node:module') as + { createRequire: (from: string) => LoaderRequire } | undefined; + return { + createRequire: nodeModule?.createRequire, + from, + nodeVersion: nodeProcess?.versions?.node, + }; +} + +/** + * Loads `file` (such as `dist/hub-server.mjs`) from the installed package. + * The package is found from `host.from`: inside an app's server bundle that + * is the bundle's folder, where the app's own dependency on this package + * resolves. `what` names the caller in errors, such as "The hub". + * + * @internal + */ +export function loadPackageFile(file: string, what: string, host: PackageLoaderHost): unknown { + if (!host.createRequire) { + // Node.js before 22.3 (and 20.16) has no `process.getBuiltinModule`. + if (host.nodeVersion) throw nodeTooOld(what, host.nodeVersion); + throw new Error(`[pangular] ${what} runs in Node.js only.`); + } + const requireHere = host.createRequire(host.from); + let packageJson: string; + try { + packageJson = requireHere.resolve(PACKAGE_JSON); + } catch (error) { + throw new Error( + `[pangular] Could not find @pangular-inspector/devtools from ${host.from}. Install it as a dependency of the app that runs the server.`, + { cause: error }, + ); + } + const path = packageJson.slice(0, -'package.json'.length) + file; + try { + return requireHere(path); + } catch (error) { + const code = (error as { code?: string }).code; + if (code === 'ERR_REQUIRE_ESM') { + throw nodeTooOld( + what, + host.nodeVersion ?? (globalThis as { process?: { version?: string } }).process?.version, + error, + ); + } + throw error; + } +} diff --git a/packages/devtools/tsdown.config.ts b/packages/devtools/tsdown.config.ts index 2e7708b4..b5528041 100644 --- a/packages/devtools/tsdown.config.ts +++ b/packages/devtools/tsdown.config.ts @@ -3,7 +3,8 @@ import { BROWSER_ENTRIES, NODE_ENTRIES, assertBrowserSafe, - assertHubLoaderStandsAlone, + LOADER_ENTRIES, + assertLoaderStandsAlone, } from './build/entries.ts'; const shared = { @@ -37,7 +38,9 @@ export const nodeConfig = { entry: NODE_ENTRIES, platform: 'node', hooks: { - 'build:done': ({ chunks }) => assertHubLoaderStandsAlone(chunks), + 'build:done': ({ chunks }) => { + for (const entry of LOADER_ENTRIES) assertLoaderStandsAlone(chunks, entry); + }, }, } satisfies UserConfig; From 869bdf1b4c7c576dea841996e45e7918ebb0625a Mon Sep 17 00:00:00 2001 From: Erkam Yaman Date: Wed, 21 Oct 2026 15:26:21 +0000 Subject: [PATCH 03/10] fix(mcp): expire dead tabs on time, name forms past the cap, and cap the scan tools Forms and router kept a page for 150 seconds after its last report, while the other stores used 15. Every per-page store now uses one expiry of 30 seconds, three heartbeat intervals, and the docs say so (#422). The forms collector keeps 100 children per group, and a failing field past that was dropped without a trace, so `explain-invalid-forms` could say no field has an error. A cut group now carries the invalid fields it left out, and the form tools name them (#423). `scan-signals` and `scan-components` answered with the whole scan. They now cap their answer, say how many items they left out, and take `filter`, `offset` and `limit` (#429). --- apps/docs/src/content/agents/mcp-server.md | 2 +- apps/docs/src/content/agents/tools.md | 26 ++-- .../content/getting-started/popup-and-hub.md | 4 +- .../docs/src/content/guides/write-a-plugin.md | 2 +- .../docs/src/content/inspectors/components.md | 4 +- apps/docs/src/content/inspectors/forms.md | 2 + apps/docs/src/content/inspectors/signals.md | 2 +- docs/contributing/coding-standards.md | 2 +- .../src/__tests__/agent-tools.test.ts | 3 +- .../src/__tests__/capacitor-agent.test.ts | 3 +- .../src/__tests__/forms-collector-cap.test.ts | 131 +++++++++++++++++ .../src/__tests__/forms-reported-at.test.ts | 11 +- .../src/__tests__/forms-tools.test.ts | 5 +- packages/devtools/src/__tests__/forms.test.ts | 35 +++++ .../__tests__/page-heartbeat-server.test.ts | 38 +++-- .../__tests__/page-interest-server.test.ts | 7 +- .../src/__tests__/page-visibility.test.ts | 6 +- .../src/__tests__/router-tools.test.ts | 7 +- packages/devtools/src/change-detection.ts | 2 +- packages/devtools/src/forms.ts | 50 ++++++- packages/devtools/src/page-heartbeat.ts | 5 +- .../src/rpc/__tests__/scan-list.test.ts | 138 ++++++++++++++++++ .../devtools/src/rpc/forms-collector-cap.ts | 77 ++++++++++ packages/devtools/src/rpc/forms-explain.ts | 9 ++ packages/devtools/src/rpc/forms-tools.ts | 35 ++++- packages/devtools/src/rpc/page-ttl.ts | 10 +- packages/devtools/src/rpc/router-tools.ts | 5 +- packages/devtools/src/rpc/scan-list.ts | 103 +++++++++++++ packages/devtools/src/rpc/scan-tools.ts | 20 ++- scripts/e2e-mcp.mjs | 4 + scripts/e2e-resilience.mjs | 28 ++-- 31 files changed, 689 insertions(+), 87 deletions(-) create mode 100644 packages/devtools/src/__tests__/forms-collector-cap.test.ts create mode 100644 packages/devtools/src/rpc/__tests__/scan-list.test.ts create mode 100644 packages/devtools/src/rpc/forms-collector-cap.ts create mode 100644 packages/devtools/src/rpc/scan-list.ts diff --git a/apps/docs/src/content/agents/mcp-server.md b/apps/docs/src/content/agents/mcp-server.md index e980e093..4e0f476d 100644 --- a/apps/docs/src/content/agents/mcp-server.md +++ b/apps/docs/src/content/agents/mcp-server.md @@ -271,7 +271,7 @@ The server registers tools with a colon, as `pangular:scan-routes`. MCP clients Each tool also has a short title, such as **List connected pages** for `pangular_list-pages`. The server sends it as the tool's `title` and `annotations.title`, and clients show it in their tool lists and approval prompts. -Every tool answers with one plain text block, the answer as written: markdown for the live tools, and compact JSON for the source scans (`scan-*` and `ngrx-scan`). No tool declares an `outputSchema`, so no answer comes with `structuredContent`. `screenshot-component` adds an image block after its text. A refusal is one text block with `isError: true`. +Every tool answers with one plain text block, the answer as written: markdown for the live tools, and compact JSON for the source scans (`scan-*` and `ngrx-scan`). A cut `scan-components` or `scan-signals` answer adds a note after its JSON with the `offset` of the next part. No tool declares an `outputSchema`, so no answer comes with `structuredContent`. `screenshot-component` adds an image block after its text. A refusal is one text block with `isError: true`. ### Read and action tools diff --git a/apps/docs/src/content/agents/tools.md b/apps/docs/src/content/agents/tools.md index aa518f2f..f7ea5980 100644 --- a/apps/docs/src/content/agents/tools.md +++ b/apps/docs/src/content/agents/tools.md @@ -99,7 +99,7 @@ When the page's Angular lacks the debug API a tool needs, the tool answers **Uns Lists the tabs, [Angular Native](../getting-started/angular-native.md) apps, [NativeScript](../getting-started/nativescript.md) apps and [Capacitor](../guides/capacitor.md) apps that report to the server, default page first (see [The page argument](#the-page-argument)): page id, URL, title, platform (`browser`, `Angular Native`, `NativeScript`, or `Capacitor (android)` and `Capacitor (ios)` for an app in a native WebView, followed by the page's Angular version when it reported one, as in `browser, Angular 15.2`), seconds since the last report or heartbeat, and which inspectors report. Takes no arguments. Reads: page. Use it to find the id to pass as `page`. -The URL comes from the HTTP or router report. A page that sends neither (no router, and no [HTTP setup](../getting-started/express.md)) still shows the URL its component tree reports, which also stands in when the other reports are more than 15 seconds older. A tab in the background stops reporting until it is shown again, so its last report is marked `(background)`: an old time there means the data is the last known state, not that the page is gone. +The URL comes from the HTTP or router report. A page that sends neither (no router, and no [HTTP setup](../getting-started/express.md)) still shows the URL its component tree reports, which also stands in when the other reports are more than 30 seconds older. A tab in the background stops reporting until it is shown again, so its last report is marked `(background)`: an old time there means the data is the last known state, not that the page is gone. A tab that closes leaves the list at once. A tab that crashes or is killed without closing leaves it, with all its data, 30 seconds after its last report or heartbeat. ### snapshot @@ -188,17 +188,19 @@ The server decides which tools exist. Set `agent.readOnly` to keep only the `rea ## Source scan -These seven tools take no arguments. They all read your source, and answer compact JSON. Every tool that reads only your files starts with `scan-` (after its library prefix, as in `ngrx-scan` and `analog-scan-routes`). +These seven tools read your source and answer compact JSON. Every tool that reads only your files starts with `scan-` (after its library prefix, as in `ngrx-scan` and `analog-scan-routes`). -| Tool | What it answers | -| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `scan-routes` | Angular routes from your route files, with full URL path (parents and `loadChildren` prefixes included), kind (page, group, redirect or wildcard), guards, resolvers, and file and line. | -| `scan-components` | Components and directives from `@Component` and `@Directive` classes, with class name, selector, kind, inputs, outputs, change detection (components only), and file and line. | -| `scan-signals` | `signal()`, `computed()`, `linkedSignal()`, `effect()`, `toSignal()` and resource declarations (`resource`, `httpResource`, `rxResource`), plus signal inputs, models and queries. | -| `scan-providers` | DI providers: `@Injectable` services, `inject()` calls, constructor parameters and `providers` arrays, with token, file and where each one is provided. | -| `ngrx-scan` | NgRx declarations: `@ngrx/store` actions (with their type strings in `types`), reducers, effects, selectors, features and store setup, and `@ngrx/signals` `signalStore` (with its members), `signalState` and `signalMethod`. | -| `scan-pipes` | Custom `@Pipe` classes, and built-in pipes from `@angular/common` in use in templates, with purity, standalone status, and where each is declared or used. | -| `scan-build` | The project name, the Angular and TypeScript versions, SSR status, the Analog version in Analog apps, and a `builtAt` timestamp. | +| Tool | What it answers | Arguments | +| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------- | +| `scan-routes` | Angular routes from your route files, with full URL path (parents and `loadChildren` prefixes included), kind (page, group, redirect or wildcard), guards, resolvers, and file and line. | None | +| `scan-components` | Components and directives from `@Component` and `@Directive` classes, with class name, selector, kind, inputs, outputs, change detection (components only), and file and line. | `filter`, `offset`, `limit` | +| `scan-signals` | `signal()`, `computed()`, `linkedSignal()`, `effect()`, `toSignal()` and resource declarations (`resource`, `httpResource`, `rxResource`), plus signal inputs, models and queries. | `filter`, `offset`, `limit` | +| `scan-providers` | DI providers: `@Injectable` services, `inject()` calls, constructor parameters and `providers` arrays, with token, file and where each one is provided. | None | +| `ngrx-scan` | NgRx declarations: `@ngrx/store` actions (with their type strings in `types`), reducers, effects, selectors, features and store setup, and `@ngrx/signals` `signalStore` (with its members), `signalState` and `signalMethod`. | None | +| `scan-pipes` | Custom `@Pipe` classes, and built-in pipes from `@angular/common` in use in templates, with purity, standalone status, and where each is declared or used. | None | +| `scan-build` | The project name, the Angular and TypeScript versions, SSR status, the Analog version in Analog apps, and a `builtAt` timestamp. | None | + +`scan-components` and `scan-signals` answer at most `limit` items (default 200, at most 1,000) and at most 20,000 characters. A list that fits is the JSON array alone. A cut list is followed by a note with the items shown, the total and the `offset` of the next part, such as `Showing signals 1-200 of 450; 250 more not shown. Pass offset: 200 for the next part`. `filter` keeps the items whose fields contain the text, in any case: class name, selector, kind and file for components, and name, kind, file and component for signals. ## Components, signals and DI @@ -756,6 +758,8 @@ Answers about large forms are cut to keep an agent's context small. Each cut end With `path`, `inspect-forms`, `explain-invalid-forms` and `inspect-form-payload` start at that group or field, so a cut part of the form can be read one group at a time. +The page itself reads at most 100 fields per group or array, and 8 levels deep. A group cut there carries `truncated` (the fields left out) and `truncatedInvalid` (up to 20 paths of invalid fields left out). The tools then say which group was cut, as in `keeps the first 100 of 150 fields (50 more not read)`, and `path` can't reach those fields. `explain-invalid-forms` and `explain-submit` name each invalid field past the cap, with its error when a Signal Form's `errorSummary` has it. If the form is invalid and no field the page read has an error, `explain-invalid-forms` says the failing field may be past the cap. + ### Track changes | Tool | What it answers | Arguments | diff --git a/apps/docs/src/content/getting-started/popup-and-hub.md b/apps/docs/src/content/getting-started/popup-and-hub.md index bbc9412e..6c2ecf40 100644 --- a/apps/docs/src/content/getting-started/popup-and-hub.md +++ b/apps/docs/src/content/getting-started/popup-and-hub.md @@ -211,7 +211,7 @@ Without the hub (for example the standalone CLI, or a panel mounted with `initDe ### Tab hashes -The URL hash selects a tab. Open `/__devframes/pangular/#tab=signals` to land on the Signals tab. Switching tabs updates the hash, so you can copy the URL at any time. +The URL hash selects a tab. Open `/__devframes/pangular/#tab=signals` to land on the Signals tab. Switching tabs updates the hash, so you can copy the URL at any time. The panel also follows a hash that changes after it loads, such as a link inside the panel or `location.hash = '#tab=forms'`. | Tab | Hash | | ---------- | ----------------- | @@ -265,7 +265,7 @@ If the panel cannot reach the server when it opens, it says so and tries again a ### Tabs in the background -A browser tab in the background runs its timers about once a minute. The app page stops reading itself while its tab is hidden and tells the server, and the server keeps its last data instead of dropping it. The panel then says **Page in background, showing the last data.** When you switch back, the page sends fresh data. If a hidden tab stops answering for 5 minutes, the server drops it. +A browser tab in the background runs its timers about once a minute. The app page stops reading itself while its tab is hidden and tells the server, and the server keeps its last data instead of dropping it. The panel then says **Page in background, showing the last data.** When you switch back, the page sends fresh data. If a hidden tab stops answering for 5 minutes, the server drops it. A visible tab that crashes or is killed without closing is dropped, with the data of every inspector, 30 seconds after its last report or heartbeat. ## Troubleshooting diff --git a/apps/docs/src/content/guides/write-a-plugin.md b/apps/docs/src/content/guides/write-a-plugin.md index f391a224..82600399 100644 --- a/apps/docs/src/content/guides/write-a-plugin.md +++ b/apps/docs/src/content/guides/write-a-plugin.md @@ -304,7 +304,7 @@ A `read` tool that calls `runPageAction` gets a refusal instead. Every answer st | Concern | How | | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Redaction | The page and the server run every view through `serialize()`, so `redaction.secretNames`, JWTs and bearer tokens are masked. | -| Pages | Each report carries the page id. The server keeps one entry per page, drops it 15 seconds after the page's last report or heartbeat, and forgets it when the tab closes. | +| Pages | Each report carries the page id. The server keeps one entry per page, drops it 30 seconds after the page's last report or heartbeat, and forgets it when the tab closes. | | Cost | `collect` runs while someone watches, at most once a second for page updates and `refresh()`. It also runs right away for the first report, even while nobody watches, and when someone starts watching. While someone watches, a finished page action or a plugin registering runs it right away too. An unchanged report is skipped, and the page heartbeat keeps an idle page listed. | | Size | Up to 20 sections, 12 columns, 200 rows or items per section, and 2,000 characters per text. Unknown section kinds are dropped. | | Failures | A plugin that throws shows as **Failed** with its message. The other plugins keep running. | diff --git a/apps/docs/src/content/inspectors/components.md b/apps/docs/src/content/inspectors/components.md index 07bb3f82..40adb112 100644 --- a/apps/docs/src/content/inspectors/components.md +++ b/apps/docs/src/content/inspectors/components.md @@ -25,6 +25,8 @@ Each row shows the class name and the host tag. Routed components get a chip wit - **Click** a row, or press Enter or Space, to select it. Click it again to clear the selection. - **Expand all** opens every row and **Collapse all** closes them down to the top level. Both are off while you filter, because the filter already opens every row that leads to a match. - **Pick component on page** selects the component behind an element you click in the app. See [Pick a component on the page](#pick-a-component-on-the-page). +- In a panel narrower than 600px, **Directive hosts**, **Expand all**, **Collapse all** and **Pick component on page** show as icons next to the count. Hover an icon to see its name. Screen readers still hear the full name. +- A name or tag that doesn't fit its row ends with an ellipsis. Hover it to see the full text, or focus the row to show the full name and tag below it. Press Escape to hide it. ### Directive hosts @@ -317,7 +319,7 @@ The live tree reads `window.ng`, which only development builds expose. It uses t ### Refresh rate -On Angular 20 and later, the page reads the tree about 250 ms after Angular runs change detection, and every 4 seconds as a heartbeat. Until the app bootstraps, it reads the tree every 3 seconds. It also reads it at once when you select an instance. It reads the detail block only for the selected instance. The server drops a page after 15 seconds without a report or a heartbeat, unless its tab is in the background. See [Tabs in the background](../getting-started/popup-and-hub.md#tabs-in-the-background). +On Angular 20 and later, the page reads the tree about 250 ms after Angular runs change detection, and every 4 seconds as a heartbeat. Until the app bootstraps, it reads the tree every 3 seconds. It also reads it at once when you select an instance. It reads the detail block only for the selected instance. The server drops a page after 30 seconds without a report or a heartbeat, unless its tab is in the background. See [Tabs in the background](../getting-started/popup-and-hub.md#tabs-in-the-background). ## How to use it diff --git a/apps/docs/src/content/inspectors/forms.md b/apps/docs/src/content/inspectors/forms.md index 50cf8f22..e02f0ca7 100644 --- a/apps/docs/src/content/inspectors/forms.md +++ b/apps/docs/src/content/inspectors/forms.md @@ -261,6 +261,8 @@ If you load `/examples/forms` directly, the form registers before the overlay lo The agent tools cut answers about large forms, so one form cannot fill an agent's context. A cut answer says how many fields or lines it left out and how to narrow the answer, for example with `path`, `form` or a later `since` marker. See [Tools](../agents/tools.md#read-form-state) for each limit. +The page reads at most 100 fields per group or array, so a form with a wider group never sends the rest. The agent tools say which group was cut and how many fields it left out, and `explain-invalid-forms` names the invalid fields past the cap. + ### Snapshot limits The page keeps up to 20 snapshots, and a reload clears them. Restore fails when the form's shape has changed, and it keeps the current value of secret fields. diff --git a/apps/docs/src/content/inspectors/signals.md b/apps/docs/src/content/inspectors/signals.md index b0217ed4..57752f5f 100644 --- a/apps/docs/src/content/inspectors/signals.md +++ b/apps/docs/src/content/inspectors/signals.md @@ -246,7 +246,7 @@ The `pangular:highlight` tool also switches the graph to the component it highli | Tool or resource | Kind | What it does | | -------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------- | -| `pangular:scan-signals` | tool | Signal declarations from source, with signal inputs, models and queries. | +| `pangular:scan-signals` | tool | Signal declarations from source, with signal inputs, models and queries. Pages through a large project with `filter` and `offset`. | | `pangular:inspect-signals` | tool | The graph the page reported, with edges, resources and history. Takes a host tag, class name, instance id, `root` or a route path. | | `pangular:watch-signal` | tool | Watches a signal and turns write stacks on or off on a page. | | `pangular:highlight` | tool | Highlights a component and makes it the target of the graph. | diff --git a/docs/contributing/coding-standards.md b/docs/contributing/coding-standards.md index b3d39907..0eb84012 100644 --- a/docs/contributing/coding-standards.md +++ b/docs/contributing/coding-standards.md @@ -34,7 +34,7 @@ The overlay runs inside the user's app, so it must be correct, cheap and invisib - **Don't match `_nghost-*` or `_ngcontent-*` attributes** with exact selectors; their names carry a suffix. Start from `[ng-version]` roots and the debug APIs. - **Keep pushes cheap.** Skip unchanged reports (compare with the last JSON sent); the page heartbeat (`page-heartbeat.ts`) keeps every store of the page alive, and `keepaliveDue` or `keepaliveAfter` says when the server lost the page and a report must go again, and avoid `querySelectorAll('*')` on a timer; cache and rescan on a `MutationObserver` signal. - **Serialize safely** with `serialize()` from `serialize.ts`: it limits depth and size and handles `Map`, `Set`, `Date`, class instances, cycles and Angular's signal sentinels. -- **Every report carries a `pageId`.** The server keeps one entry per page, expires it after 15 seconds without a push or a `page-heartbeat` (pass the TTL from `visibility.ttl()`, which honours both), and forgets it on `pagehide` (`forget--page`). Two open tabs must never overwrite each other. +- **Every report carries a `pageId`.** The server keeps one entry per page, expires it after 30 seconds (`PAGE_TTL_MS`, three heartbeat intervals) without a push or a `page-heartbeat` (pass the TTL from `visibility.ttl()`, which honours both; every store uses the same one), and forgets it on `pagehide` (`forget--page`). Two open tabs must never overwrite each other. - **One connection owns each `pageId`.** Push, ping and forget handlers go through the shared owner check in `rpc/page-owners.ts` (`owners.write(pageId)` before storing a report, `owners.forget(pageId)` before dropping one), never an ad hoc check. The first connection to report a page owns it. A push or forget for that page from another connection is ignored, unless the owner closed or went quiet past the page expiry. The overlay mints a secret with the `pageId` and keeps it next to it (`sessionStorage` in a browser, memory in the native overlays), and shows it with `claim-page` before its first report. A connection that shows the matching secret takes the page over at once, so a reloaded tab gets its own `pageId` back while the old connection is still open. In-process calls (no RPC session) are allowed. - **Stay out of the Angular zone.** Hooks the app's own code calls (a signal write, a `console` call, a router event, a store or form change, a plugin's `ctx.push`) run inside the Angular zone, and a timer or microtask they start there makes a zone.js app tick again and keeps `NgZone.isStable` false. Schedule through `outside-angular.ts` (`setTimeoutOutside`, `queueMicrotaskOutside`, `outsideAngular`), never the bare globals; `__tests__/zone-collectors.test.ts` checks each collector under a real `NgZone`. - **Don't change app behavior.** Don't run the app's validators, guards or effects to learn something unless the user asked for it (recording, instrumenting), and say so in the UI. diff --git a/packages/devtools/src/__tests__/agent-tools.test.ts b/packages/devtools/src/__tests__/agent-tools.test.ts index 961969a4..9f3dbd6c 100644 --- a/packages/devtools/src/__tests__/agent-tools.test.ts +++ b/packages/devtools/src/__tests__/agent-tools.test.ts @@ -4,6 +4,7 @@ import pangular from '../devframe.ts'; import { UNTRUSTED } from '../rpc/forms-tools.ts'; import { answerText } from './tool-answer.ts'; import { ToolRefusal } from '../rpc/refusal.ts'; +import { PAGE_TTL_MS } from '../rpc/page-ttl.ts'; async function boot() { const host = { @@ -1052,7 +1053,7 @@ describe('agent tools', () => { vi.useFakeTimers({ toFake: ['Date', 'setInterval', 'clearInterval'] }); const { push, call } = await boot(); await push('push-injector-tree', { pageId: 'p1', roots: [injectorRoot('A')], environment: [] }); - vi.advanceTimersByTime(10_000); + vi.advanceTimersByTime(PAGE_TTL_MS - 5000); expect(await call('inspect-providers', '')).toMatch(/`p1`/); vi.advanceTimersByTime(10_000); expect(await call('inspect-providers', '')).toMatch(/no injector data/i); diff --git a/packages/devtools/src/__tests__/capacitor-agent.test.ts b/packages/devtools/src/__tests__/capacitor-agent.test.ts index 8fab2a4c..707be7ae 100644 --- a/packages/devtools/src/__tests__/capacitor-agent.test.ts +++ b/packages/devtools/src/__tests__/capacitor-agent.test.ts @@ -13,6 +13,7 @@ import { type CapacitorReport, } from '../rpc/capacitor-tools.ts'; import { answerText } from './tool-answer.ts'; +import { PAGE_TTL_MS } from '../rpc/page-ttl.ts'; // The demo project does not depend on @capacitor/core, so the tools are turned on here. async function boot(definition = createPangular({ inspectors: { capacitor: true } })) { @@ -526,7 +527,7 @@ describe('capacitor pages over time', () => { await push('push-capacitor', report()); expect(Object.keys((await state()).pages)).toEqual(['cap1']); - await vi.advanceTimersByTimeAsync(30_000); + await vi.advanceTimersByTimeAsync(PAGE_TTL_MS + 6000); expect((await state()).pages).toEqual({}); }); diff --git a/packages/devtools/src/__tests__/forms-collector-cap.test.ts b/packages/devtools/src/__tests__/forms-collector-cap.test.ts new file mode 100644 index 00000000..68914c52 --- /dev/null +++ b/packages/devtools/src/__tests__/forms-collector-cap.test.ts @@ -0,0 +1,131 @@ +import { describe, expect, it } from 'vitest'; +import type { CollectedForm, FormFieldNode } from '../forms.ts'; +import { MAX_CHILDREN } from '../forms.ts'; +import { explainSubmitText } from '../rpc/forms-explain.ts'; +import { COLLECTOR_MAX_CHILDREN, cutGroups } from '../rpc/forms-collector-cap.ts'; +import { + explainFormsText, + inspectFormsText, + isPageReport, + type FormsState, +} from '../rpc/forms-tools.ts'; + +// #423: the forms collector keeps 100 children per group. The tools must say +// so, and explain-invalid-forms must never call an invalid form error-free. + +function control(path: string, overrides: Partial = {}): FormFieldNode { + return { + key: path.split('.').pop()!, + path, + type: 'control', + status: 'VALID', + touched: false, + dirty: false, + bound: true, + value: 'ok', + errors: [], + ...overrides, + }; +} + +/** What the collector sends for a group of 150 controls whose control 140 is invalid. */ +function cappedForm(named: boolean, kind: CollectedForm['kind'] = 'reactive'): CollectedForm { + const root: FormFieldNode = { + ...control(''), + key: '', + type: 'group', + status: 'INVALID', + bound: false, + value: undefined, + children: Array.from({ length: 100 }, (_, i) => control(`f${i}`)), + truncated: 50, + ...(named ? { truncatedInvalid: ['f140'] } : {}), + }; + return { + id: 'Wide.form@p1', + kind, + owner: 'Wide', + label: 'Wide.form', + root, + ...(kind === 'signal' + ? { errorSummary: [{ path: 'f140', kind: 'required', message: 'is required' }] } + : {}), + }; +} + +const stateOf = (...forms: CollectedForm[]): FormsState => ({ forms, events: [], reportedAt: 1 }); + +describe('forms past the collector cap', () => { + it('uses the collector cap the page uses', () => { + expect(COLLECTOR_MAX_CHILDREN).toBe(MAX_CHILDREN); + }); + + it('counts kept and total fields of each cut group', () => { + expect(cutGroups(cappedForm(true).root)).toEqual([ + { path: '', kept: 100, total: 150, invalid: ['f140'] }, + ]); + }); + + it('names a failing field past the cap', () => { + const text = explainFormsText(stateOf(cappedForm(true)), { form: 'Wide.form' }); + expect(text).not.toContain('No field reports an error'); + expect(text).toContain('`f140` is INVALID'); + expect(text).toContain('keeps the first 100 of 150 fields'); + }); + + it('quotes the error summary of a Signal Form for a field past the cap', () => { + const text = explainFormsText(stateOf(cappedForm(true, 'signal')), { form: 'Wide.form' }); + expect(text).toContain('`f140` is INVALID: [required] is required'); + }); + + it('says the failing field may be past the cap when the page did not name it', () => { + const text = explainFormsText(stateOf(cappedForm(false)), {}); + expect(text).not.toContain('No field reports an error'); + expect(text).toContain('the failing field may be past its limit'); + expect(text).toContain('keeps the first 100 of 150 fields (50 more not read)'); + }); + + it('lists a cut form with the fields it read and the ones it left out', () => { + const list = inspectFormsText(stateOf(cappedForm(true)), {}); + expect(list).toContain("101 fields read and 50 more past the collector's limit"); + const tree = inspectFormsText(stateOf(cappedForm(true)), { form: 'Wide.form' }); + expect(tree).toContain('not every field was read'); + expect(tree).toContain('keeps the first 100 of 150 fields'); + // `onlyInvalid` prunes the kept fields, but the note still counts what the page read. + const invalid = inspectFormsText(stateOf(cappedForm(true)), { + form: 'Wide.form', + onlyInvalid: true, + }); + expect(invalid).toContain('keeps the first 100 of 150 fields'); + }); + + it('names the field past the cap among the reasons a submit is blocked', () => { + const text = explainSubmitText(stateOf(cappedForm(true)), { form: 'Wide.form' }); + expect(text).toContain("Also invalid, past the collector's limit: `f140`."); + }); + + it('says nothing about a cap when no group was cut', () => { + const form = cappedForm(false); + delete form.root.truncated; + form.root.children![3] = control('f3', { + status: 'INVALID', + errors: [{ kind: 'required', message: 'is required' }], + }); + const text = explainFormsText(stateOf(form), {}); + expect(text).toContain('`f3`'); + expect(text).not.toContain('not read'); + }); + + it('accepts the cap fields in a report and refuses malformed ones', () => { + const report = (root: FormFieldNode) => ({ + pageId: 'p1', + forms: [{ ...cappedForm(true), root }], + events: [], + }); + expect(isPageReport(report(cappedForm(true).root))).toBe(true); + expect(isPageReport(report({ ...cappedForm(true).root, truncatedInvalid: [1] as never }))).toBe( + false, + ); + expect(isPageReport(report({ ...cappedForm(true).root, truncated: '5' as never }))).toBe(false); + }); +}); diff --git a/packages/devtools/src/__tests__/forms-reported-at.test.ts b/packages/devtools/src/__tests__/forms-reported-at.test.ts index a6274494..15c7263d 100644 --- a/packages/devtools/src/__tests__/forms-reported-at.test.ts +++ b/packages/devtools/src/__tests__/forms-reported-at.test.ts @@ -1,13 +1,8 @@ import { describe, expect, it } from 'vitest'; import type { CollectedForm, FormFieldNode } from '../forms.ts'; -import { - explainFormsText, - FORMS_PAGE_TTL_MS, - inspectFormsText, - mergePageReport, -} from '../rpc/forms-tools.ts'; +import { explainFormsText, inspectFormsText, mergePageReport } from '../rpc/forms-tools.ts'; import { explainSubmitText } from '../rpc/forms-explain.ts'; -import { createPageVisibility } from '../rpc/page-ttl.ts'; +import { PAGE_TTL_MS, createPageVisibility } from '../rpc/page-ttl.ts'; const STALE = 'The page may have closed'; @@ -43,7 +38,7 @@ describe('forms staleness note with a background tab', () => { // so its old `reportedAt` must not make answers about the live tab look stale. const visibility = createPageVisibility(); const pages = new Map(); - const ttl = visibility.ttl(FORMS_PAGE_TTL_MS); + const ttl = visibility.ttl(PAGE_TTL_MS); visibility.set('bg', true, 0); mergePageReport(pages, { pageId: 'bg', forms: [form('bg')], events: [] }, 0, 200, ttl); const now = 120_000; diff --git a/packages/devtools/src/__tests__/forms-tools.test.ts b/packages/devtools/src/__tests__/forms-tools.test.ts index c0f482f8..b73f4907 100644 --- a/packages/devtools/src/__tests__/forms-tools.test.ts +++ b/packages/devtools/src/__tests__/forms-tools.test.ts @@ -13,6 +13,7 @@ import { mergePageReport, } from '../rpc/forms-tools.ts'; import { formHistoryText } from '../rpc/forms-explain.ts'; +import { PAGE_TTL_MS } from '../rpc/page-ttl.ts'; function control(path: string, overrides: Partial = {}): FormFieldNode { return { @@ -287,8 +288,8 @@ describe('mergePageReport', () => { expect(later.forms.map((f) => f.id)).toEqual(['form-1@bbbb']); expect(later.reportedAt).toBe(200_000); - expect(expirePages(pages, 300_000)).toBeNull(); - const gone = expirePages(pages, 400_000); + expect(expirePages(pages, 200_000 + PAGE_TTL_MS)).toBeNull(); + const gone = expirePages(pages, 200_000 + PAGE_TTL_MS + 1); expect(gone).toEqual({ forms: [], events: [], diff --git a/packages/devtools/src/__tests__/forms.test.ts b/packages/devtools/src/__tests__/forms.test.ts index 2afc5b40..7106f26b 100644 --- a/packages/devtools/src/__tests__/forms.test.ts +++ b/packages/devtools/src/__tests__/forms.test.ts @@ -217,6 +217,22 @@ describe('reactive serialization', () => { ); }); + it('names the invalid controls a wide group leaves out past the cap (#423)', () => { + const controls = Object.fromEntries( + Array.from({ length: 150 }, (_, i) => [`f${i}`, new FormControl('ok', Validators.required)]), + ); + const form = new FormGroup(controls); + form.controls['f140'].setValue(''); + const root = serializeControl(form); + expect(root.status).toBe('INVALID'); + expect(root.children).toHaveLength(100); + expect(root.truncated).toBe(50); + expect(root.truncatedInvalid).toEqual(['f140']); + // Nothing past the cap is invalid: no list. + form.controls['f140'].setValue('back'); + expect(serializeControl(form).truncatedInvalid).toBeUndefined(); + }); + it('keeps an own "…" key when adding the overflow marker to a wide value', () => { const wide = (extra: Record) => Object.assign(extra, Object.fromEntries(Array.from({ length: 25 }, (_, i) => [`k${i}`, i]))); @@ -266,6 +282,25 @@ describe('signal serialization', () => { expect(node.children!.map((c) => c.key)).not.toContain('gone'); }); + it('names the invalid fields a wide group leaves out past the cap (#423)', () => { + const value: Record = {}; + const children: Record = {}; + for (let i = 0; i < 150; i++) { + value[`f${i}`] = i === 140 ? '' : 'ok'; + children[`f${i}`] = fakeField({ + value: value[`f${i}`], + errors: i === 140 ? [{ kind: 'required' }] : [], + }); + } + // One more field Angular has not created: it is never read, so never named. + value['later'] = ''; + const node = serializeField(fakeField({ value, children }).node); + expect(node.status).toBe('INVALID'); + expect(node.children).toHaveLength(100); + expect(node.truncated).toBe(51); + expect(node.truncatedInvalid).toEqual(['f140']); + }); + it('does not create children that Angular has not created', () => { const child = fakeField({ value: 'a' }); const root = fakeField({ value: { a: 'a' }, children: { a: child }, materialized: false }); diff --git a/packages/devtools/src/__tests__/page-heartbeat-server.test.ts b/packages/devtools/src/__tests__/page-heartbeat-server.test.ts index bff1316b..c1b4bb6b 100644 --- a/packages/devtools/src/__tests__/page-heartbeat-server.test.ts +++ b/packages/devtools/src/__tests__/page-heartbeat-server.test.ts @@ -1,11 +1,11 @@ import { createHostContext } from 'devframe/node'; import { afterEach, describe, expect, it, vi } from 'vitest'; import pangular from '../devframe.ts'; -import { ROUTER_PAGE_TTL_MS } from '../rpc/router-tools.ts'; -import { FORMS_PAGE_TTL_MS } from '../rpc/forms-tools.ts'; import { createPageHeartbeats } from '../rpc/page-heartbeats.ts'; import { PAGE_TTL_MS, createPageVisibility } from '../rpc/page-ttl.ts'; import { PAGE_HEARTBEAT_MS } from '../page-heartbeat.ts'; +import { expirePages, mergePageReport } from '../rpc/forms-tools.ts'; +import { expireRouterPages } from '../rpc/router-tools.ts'; // The page heartbeat on the server: while a page beats, none of its reports // expire, however long ago it sent them. Without beats they expire as before. @@ -108,19 +108,20 @@ describe('page heartbeat on the server', () => { const reported = await holding('tab1'); expect(reported).toEqual([...STATES]); - // Longer than every store's expiry, the forms timeline and router included. - const idleMs = Math.max(FORMS_PAGE_TTL_MS, ROUTER_PAGE_TTL_MS) + 30_000; + // Several times the page expiry, which every store shares. + const idleMs = 5 * PAGE_TTL_MS; for (let at = 0; at < idleMs; at += PAGE_HEARTBEAT_MS) { vi.advanceTimersByTime(PAGE_HEARTBEAT_MS); expect(await call('page-heartbeat', { pageId: 'tab1' })).toMatchObject({ known: true }); } expect(await holding('tab1')).toEqual(reported); - // The tab died without a word: its reports go with the expiry. The forms - // timeline and the router history stay for their own while, counted from the last beat. - vi.advanceTimersByTime(PAGE_TTL_MS + 6000); - expect(await holding('tab1')).toEqual(['forms', 'router']); - vi.advanceTimersByTime(Math.max(FORMS_PAGE_TTL_MS, ROUTER_PAGE_TTL_MS) - PAGE_TTL_MS); + // The tab died without a word (#422): every report, the forms timeline and + // the router history included, goes with the one expiry, counted from the + // last beat, plus one 5 s sweep. + vi.advanceTimersByTime(PAGE_TTL_MS - 1000); + expect(await holding('tab1')).toEqual(reported); + vi.advanceTimersByTime(6000); expect(await holding('tab1')).toEqual([]); // Its next beat says the server lost it, so it sends everything again. expect(await call('page-heartbeat', { pageId: 'tab1' })).toMatchObject({ known: false }); @@ -156,3 +157,22 @@ describe('page heartbeat on the server', () => { expect(beats.seenAt('p3')).toBeUndefined(); }); }); + +describe('one page expiry for every store (#422)', () => { + it('leaves room for two late or lost heartbeats', () => { + expect(PAGE_TTL_MS).toBeGreaterThanOrEqual(3 * PAGE_HEARTBEAT_MS); + }); + + it('expires forms and router pages after the shared expiry by default', () => { + const forms = new Map(); + mergePageReport(forms, { pageId: 'p1', forms: [], events: [] }, 0); + expect(expirePages(forms, PAGE_TTL_MS)).toBeNull(); + expect(expirePages(forms, PAGE_TTL_MS + 1)).not.toBeNull(); + expect(forms.size).toBe(0); + + const router = new Map([['p1', { pageId: 'p1', reportedAt: 0 }]]); + expect(expireRouterPages(router as never, PAGE_TTL_MS)).toBeNull(); + expect(expireRouterPages(router as never, PAGE_TTL_MS + 1)).not.toBeNull(); + expect(router.size).toBe(0); + }); +}); diff --git a/packages/devtools/src/__tests__/page-interest-server.test.ts b/packages/devtools/src/__tests__/page-interest-server.test.ts index c0262341..f1a55cc8 100644 --- a/packages/devtools/src/__tests__/page-interest-server.test.ts +++ b/packages/devtools/src/__tests__/page-interest-server.test.ts @@ -1,6 +1,7 @@ import { createHostContext } from 'devframe/node'; import { afterEach, describe, expect, it, vi } from 'vitest'; import pangular from '../devframe.ts'; +import { PAGE_TTL_MS } from '../rpc/page-ttl.ts'; // The activity lease as devframe.ts wires it: pages that left are not waited // for, and an idle forms page keeps itself alive with a ping. @@ -57,9 +58,9 @@ describe('page interest on the server', () => { }); await push('page-interest', { pageId: 'closed' }); await push('push-forms', formsReport('closed')); - // The browser closed without a pagehide: it stops reporting. Its forms - // timeline is kept for a while, but the page is not waited for. - await vi.advanceTimersByTimeAsync(30_000); + // The browser closed without a pagehide: it stops reporting, and once its + // reports expire the page is not waited for. + await vi.advanceTimersByTimeAsync(PAGE_TTL_MS + 6000); let answered = false; const reading = ctx.agent.invoke('pangular:inspect-forms', {}).then(() => (answered = true)); await vi.advanceTimersByTimeAsync(0); diff --git a/packages/devtools/src/__tests__/page-visibility.test.ts b/packages/devtools/src/__tests__/page-visibility.test.ts index acfbad8f..0df54e6e 100644 --- a/packages/devtools/src/__tests__/page-visibility.test.ts +++ b/packages/devtools/src/__tests__/page-visibility.test.ts @@ -1,7 +1,7 @@ import { createHostContext } from 'devframe/node'; import { afterEach, describe, expect, it, vi } from 'vitest'; import pangular from '../devframe.ts'; -import { HIDDEN_PAGE_TTL_MS, createPageVisibility } from '../rpc/page-ttl.ts'; +import { HIDDEN_PAGE_TTL_MS, PAGE_TTL_MS, createPageVisibility } from '../rpc/page-ttl.ts'; async function boot() { const host = { @@ -47,7 +47,7 @@ describe('pages in a background tab', () => { const { report, shown } = await boot(); await report(); expect(await shown()).toEqual(all); - vi.advanceTimersByTime(20_000); + vi.advanceTimersByTime(PAGE_TTL_MS + 6000); expect(await shown()).toEqual(none); }); @@ -67,7 +67,7 @@ describe('pages in a background tab', () => { await push('report-page-visibility', { pageId: 'p1', hidden: false }); expect(await state('page-visibility')).toEqual({ hidden: [] }); await report(); - vi.advanceTimersByTime(20_000); + vi.advanceTimersByTime(PAGE_TTL_MS + 6000); expect(await shown()).toEqual(none); }); diff --git a/packages/devtools/src/__tests__/router-tools.test.ts b/packages/devtools/src/__tests__/router-tools.test.ts index 083acf70..e87c4924 100644 --- a/packages/devtools/src/__tests__/router-tools.test.ts +++ b/packages/devtools/src/__tests__/router-tools.test.ts @@ -23,6 +23,7 @@ import { type RouterPage, type RouterReport, } from '../rpc/router-tools.ts'; +import { PAGE_TTL_MS } from '../rpc/page-ttl.ts'; function route(path: string, extra: Partial = {}): ActiveRoute { return { path, url: path, outlet: 'primary', params: {}, data: {}, children: [], ...extra }; @@ -283,8 +284,10 @@ describe('router reports', () => { mergeRouterReport(pages, { pageId: 'a', snapshot: null, navigations: [] }, 1_000); const both = mergeRouterReport(pages, { pageId: 'b', snapshot, navigations: [] }, 2_000); expect(both.pages.map((p) => p.pageId)).toEqual(['b', 'a']); - expect(expireRouterPages(pages, 100_000)).toBeNull(); - expect(expireRouterPages(pages, 151_500)?.pages.map((p) => p.pageId)).toEqual(['b']); + expect(expireRouterPages(pages, 1_000 + PAGE_TTL_MS)).toBeNull(); + expect(expireRouterPages(pages, 1_500 + PAGE_TTL_MS)?.pages.map((p) => p.pageId)).toEqual([ + 'b', + ]); }); }); diff --git a/packages/devtools/src/change-detection.ts b/packages/devtools/src/change-detection.ts index 7d0dc5c8..2e93d645 100644 --- a/packages/devtools/src/change-detection.ts +++ b/packages/devtools/src/change-detection.ts @@ -17,7 +17,7 @@ export const POLL_MS = 3000; export const HEARTBEAT_MS = 4000; /** * Without the page heartbeat (`page-heartbeat.ts`), an unchanged report is - * sent again this often, well inside the server's 15 s TTL. + * sent again this often, well inside the server's 30 s TTL. */ export const KEEPALIVE_MS = 8000; diff --git a/packages/devtools/src/forms.ts b/packages/devtools/src/forms.ts index b02fceeb..a8f43735 100644 --- a/packages/devtools/src/forms.ts +++ b/packages/devtools/src/forms.ts @@ -66,7 +66,10 @@ export interface FormFieldNode { accessor?: string; errors: FormFieldError[]; children?: FormFieldNode[]; + /** Children left out by the collector's caps (`MAX_CHILDREN` per group, `MAX_DEPTH` levels). */ truncated?: number; + /** Paths of invalid children left out by `MAX_CHILDREN`, at most `MAX_INVALID_PAST_CAP`. */ + truncatedInvalid?: string[]; uid?: string; skipped?: SkipReason; asyncWaiting?: boolean; @@ -162,7 +165,10 @@ export interface FoundForms { } const MAX_DEPTH = 8; -const MAX_CHILDREN = 100; +/** Children kept per group or array. The rest are counted in `truncated`. */ +export const MAX_CHILDREN = 100; +/** Invalid children past {@link MAX_CHILDREN} that a group still names. */ +const MAX_INVALID_PAST_CAP = 20; const MAX_STRING = 200; const MAX_REDACT_WINDOW = 65536; const MAX_VALUE_ITEMS = 20; @@ -602,10 +608,36 @@ export function serializeControl( .map(([childKey, child]) => serializeControl(child, elements, childKey, childPath(path, childKey), depth + 1, secret), ); - if (entries.length > MAX_CHILDREN) node.truncated = entries.length - MAX_CHILDREN; + if (entries.length > MAX_CHILDREN) { + node.truncated = entries.length - MAX_CHILDREN; + keepInvalidPastCap( + node, + entries.slice(MAX_CHILDREN), + ([, child]) => read(() => child['status'], 'VALID') === 'INVALID', + ([childKey]) => childPath(path, childKey), + ); + } return node; } +/** + * Names the invalid children a group left out past {@link MAX_CHILDREN}, so the + * tools can point at a failing field the tree doesn't hold. Reads only status. + */ +function keepInvalidPastCap( + node: FormFieldNode, + rest: T[], + invalid: (child: T) => boolean, + pathOf: (child: T) => string, +): void { + const paths: string[] = []; + for (const child of rest) { + if (paths.length >= MAX_INVALID_PAST_CAP) break; + if (invalid(child)) paths.push(pathOf(child)); + } + if (paths.length) node.truncatedInvalid = paths; +} + function fieldStatus(state: AnyRecord): FieldStatus { if (read(() => state['disabled'](), false)) return 'DISABLED'; if (read(() => state['invalid'](), false)) return 'INVALID'; @@ -810,7 +842,19 @@ export function serializeField( ? serializeField(child, elements, childKey, nextPath, depth + 1, secret) : unmaterializedField((value as AnyRecord)[childKey], childKey, nextPath, secret); }); - if (fieldKeys.length > MAX_CHILDREN) node.truncated = fieldKeys.length - MAX_CHILDREN; + if (fieldKeys.length > MAX_CHILDREN) { + node.truncated = fieldKeys.length - MAX_CHILDREN; + // Only fields Angular already created can be invalid; their status is a computed it keeps. + keepInvalidPastCap( + node, + fieldKeys.slice(MAX_CHILDREN), + (childKey) => { + const child = created.get(childKey); + return !!child && fieldStatus(child) === 'INVALID'; + }, + (childKey) => childPath(path, childKey), + ); + } return node; } diff --git a/packages/devtools/src/page-heartbeat.ts b/packages/devtools/src/page-heartbeat.ts index c55ef1c8..7354ed15 100644 --- a/packages/devtools/src/page-heartbeat.ts +++ b/packages/devtools/src/page-heartbeat.ts @@ -10,8 +10,9 @@ interface Rpc { } /** - * How often the page says it is there. Under the server's page expiry - * (`PAGE_TTL_MS`, 15 s) with room for a late timer, and at most 6 calls a minute. + * How often the page says it is there. A third of the server's page expiry + * (`PAGE_TTL_MS`, 30 s), so a late or lost beat doesn't drop the page, and at + * most 6 calls a minute. */ export const PAGE_HEARTBEAT_MS = 10_000; diff --git a/packages/devtools/src/rpc/__tests__/scan-list.test.ts b/packages/devtools/src/rpc/__tests__/scan-list.test.ts new file mode 100644 index 00000000..41d20833 --- /dev/null +++ b/packages/devtools/src/rpc/__tests__/scan-list.test.ts @@ -0,0 +1,138 @@ +import { createHostContext } from 'devframe/node'; +import { describe, expect, it } from 'vitest'; +import { createPangular } from '../../devframe.ts'; +import { + SCAN_LIST_DEFAULT_LIMIT, + SCAN_LIST_MAX_CHARS, + scanListAnswer, + type ScanList, +} from '../scan-list.ts'; +import { scanTool } from '../scan-tools.ts'; +import { guardHandler } from '../tool-input.ts'; + +// #429: scan-signals and scan-components cap their answer, say how much they +// left out, and take `filter`, `offset` and `limit` to read the rest. + +const SIGNALS: ScanList = { noun: 'signals', fields: ['name', 'kind', 'file', 'component'] }; + +function signals(count: number) { + return Array.from({ length: count }, (_, i) => ({ + name: i % 10 === 0 ? `Total${i}` : `value${i}`, + kind: i % 2 ? 'computed' : 'signal', + file: `src/app/feature-${Math.floor(i / 50)}.ts`, + line: i + 1, + })); +} + +/** The JSON part of an answer, before its note. */ +const items = (text: string) => JSON.parse(text.split('\n\n')[0]) as { line: number }[]; + +describe('scanListAnswer', () => { + it('answers a small list as the JSON array alone, as before', () => { + const list = signals(12); + expect(scanListAnswer(list, {}, SIGNALS)).toBe(JSON.stringify(list)); + expect(scanListAnswer([], {}, SIGNALS)).toBe('[]'); + }); + + it('cuts a long list at the default limit and gives the next offset', () => { + const text = scanListAnswer(signals(450), {}, SIGNALS); + expect(items(text)).toHaveLength(SCAN_LIST_DEFAULT_LIMIT); + expect(text).toContain('_Showing signals 1-200 of 450; 250 more not shown.'); + expect(text).toContain('Pass `offset: 200` for the next part, or `filter` to narrow it.'); + + const last = scanListAnswer(signals(450), { offset: 400 }, SIGNALS); + expect(items(last).map((s) => s.line)).toEqual(Array.from({ length: 50 }, (_, i) => 401 + i)); + expect(last).toContain('Showing signals 401-450 of 450'); + expect(last).toContain('This is the last part.'); + }); + + it('pages with offset and limit without losing or repeating items', () => { + const all = signals(95); + const seen: number[] = []; + let offset = 0; + for (;;) { + const text = scanListAnswer(all, { offset, limit: 30 }, SIGNALS); + seen.push(...items(text).map((s) => s.line)); + const next = /offset: (\d+)/.exec(text)?.[1]; + if (!next) break; + offset = Number(next); + } + expect(seen).toEqual(all.map((s) => s.line)); + }); + + it('filters on the listed fields, in any case', () => { + const text = scanListAnswer(signals(450), { filter: 'total' }, SIGNALS); + expect(items(text)).toHaveLength(45); + expect(text).not.toContain('\n'); + expect(scanListAnswer(signals(450), { filter: 'FEATURE-8' }, SIGNALS)).not.toContain('\n'); + expect(scanListAnswer(signals(450), { filter: 'nothing like it' }, SIGNALS)).toBe( + '[]\n\n_No signals match `filter`; the scan found 450 in all._', + ); + }); + + it('says where the list ends when the offset is past it', () => { + expect(scanListAnswer(signals(450), { offset: 900 }, SIGNALS)).toBe( + '[]\n\n_No signals at `offset` 900; there are 450, so the last part starts at 250._', + ); + }); + + it('keeps the whole answer, note included, under the character cap', () => { + const wide = signals(150).map((s) => ({ ...s, file: `src/${'deep/'.repeat(60)}x.ts` })); + const text = scanListAnswer(wide, { limit: 150 }, SIGNALS); + expect(text.length).toBeLessThanOrEqual(SCAN_LIST_MAX_CHARS); + const kept = items(text).length; + expect(kept).toBeGreaterThan(1); + expect(kept).toBeLessThan(150); + expect(text).toContain(`${150 - kept} more not shown. Pass \`offset: ${kept}\``); + }); +}); + +describe('listed scan tools', () => { + const fake = (result: unknown[]) => + scanTool( + { + id: 'pangular:scan-signals', + title: 'Scan', + description: 'Fake scan', + definition: { name: 'fake', setup: () => ({ handler: async () => result }) }, + list: SIGNALS, + }, + {}, + ); + + it('checks filter, offset and limit against the input schema', async () => { + const tool = fake(signals(300)); + const guarded = guardHandler(tool.inputSchema, tool.handler, tool.id); + for (const bad of [ + { offset: -1 }, + { limit: 0 }, + { limit: 5000 }, + { filter: 3 }, + { offset: 1.5 }, + ]) { + await expect(guarded(bad), JSON.stringify(bad)).rejects.toThrow(); + } + const text = (await guarded({ offset: 290, limit: 5 })) as string; + expect(items(text).map((s) => s.line)).toEqual([291, 292, 293, 294, 295]); + }); + + it('gives scan-signals and scan-components the paging arguments and leaves the other scans alone', async () => { + const host = { + mountStatic: () => {}, + resolveOrigin: () => 'http://localhost', + getStorageDir: () => '', + }; + const ctx = await createHostContext({ cwd: process.cwd(), mode: 'dev', host: host as never }); + await createPangular({}).setup(ctx as never); + const tools = new Map(ctx.agent.list().tools.map((tool) => [tool.id, tool])); + for (const id of ['pangular:scan-signals', 'pangular:scan-components']) { + const properties = (tools.get(id)?.inputSchema as { properties?: object })?.properties; + expect(Object.keys(properties ?? {}).sort(), id).toEqual(['filter', 'limit', 'offset']); + } + const build = (tools.get('pangular:scan-build')?.inputSchema as { properties?: object }) + ?.properties; + expect(build).toEqual({}); + const text = (await ctx.agent.invoke('pangular:scan-signals', { limit: 1 })) as string; + expect(items(text).length).toBeLessThanOrEqual(1); + }); +}); diff --git a/packages/devtools/src/rpc/forms-collector-cap.ts b/packages/devtools/src/rpc/forms-collector-cap.ts new file mode 100644 index 00000000..f1495126 --- /dev/null +++ b/packages/devtools/src/rpc/forms-collector-cap.ts @@ -0,0 +1,77 @@ +import type { CollectedForm, FormFieldNode } from '../forms.ts'; + +/** + * Children the forms collector keeps per group or array (`MAX_CHILDREN` in + * `forms.ts`). The rest never reach the server; the group counts them in + * `truncated` and names the invalid ones in `truncatedInvalid`. + */ +export const COLLECTOR_MAX_CHILDREN = 100; + +/** A group the collector cut: how many of its direct children it kept, of how many. */ +export interface CutGroup { + path: string; + kept: number; + total: number; + /** Paths of invalid children left out, as far as the collector named them. */ + invalid: string[]; +} + +/** The groups under `node` (itself included) that the collector cut, in tree order. */ +export function cutGroups(node: FormFieldNode): CutGroup[] { + const groups: CutGroup[] = []; + const visit = (n: FormFieldNode) => { + if (n.truncated) { + const kept = n.children?.length ?? 0; + groups.push({ + path: n.path, + kept, + total: kept + n.truncated, + invalid: n.truncatedInvalid ?? [], + }); + } + for (const child of n.children ?? []) visit(child); + }; + visit(node); + return groups; +} + +const MAX_NAMED = 3; +const where = (path: string) => `\`${path || '(form)'}\``; + +/** + * One sentence on the groups the collector cut, such as "`items` keeps the + * first 100 of 150 fields (the collector's limit of 100 per group); 50 more + * are not read." Empty when nothing was cut. + */ +export function cutSentence(groups: CutGroup[]): string { + if (!groups.length) return ''; + const named = groups + .slice(0, MAX_NAMED) + .map( + (g) => + `${where(g.path)} keeps the first ${g.kept} of ${g.total} fields (${g.total - g.kept} more not read)`, + ); + const more = groups.length > MAX_NAMED ? `, and ${groups.length - MAX_NAMED} more groups` : ''; + return `${named.join('; ')}${more}. The collector reads at most ${COLLECTOR_MAX_CHILDREN} fields per group and 8 levels deep.`; +} + +/** + * The lines `explain-invalid-forms` adds for fields the collector left out: + * each invalid field it named, with the error the form's `errorSummary` has + * for it (Signal Forms), and a note on the cut groups. + */ +export function pastCapLines(form: CollectedForm, start: FormFieldNode): string[] { + const groups = cutGroups(start); + const lines: string[] = []; + const summary = form.errorSummary ?? []; + for (const path of groups.flatMap((g) => g.invalid)) { + const errors = summary.filter((e) => e.path === path); + const detail = errors.length + ? errors.map((e) => `[${e.kind}] ${e.message}`).join('; ') + : 'its errors are not in the report'; + lines.push( + `- ${where(path)} is INVALID: ${detail} (past the collector's limit of ${COLLECTOR_MAX_CHILDREN} fields per group)`, + ); + } + return lines; +} diff --git a/packages/devtools/src/rpc/forms-explain.ts b/packages/devtools/src/rpc/forms-explain.ts index 8139f006..320709bc 100644 --- a/packages/devtools/src/rpc/forms-explain.ts +++ b/packages/devtools/src/rpc/forms-explain.ts @@ -33,6 +33,7 @@ import { valueJson, } from './forms-cap.ts'; import { refusal } from './refusal.ts'; +import { cutGroups, cutSentence } from './forms-collector-cap.ts'; export interface FieldArgs { form?: string; @@ -325,6 +326,14 @@ export function explainSubmitText(state: FormsState, args: FieldArgs, now = Date if (pending.length) { lines.push(`Pending: ${pending.map((n) => code(n.path || '(form)')).join(', ')}.`); } + const cut = cutGroups(form.root); + const pastCap = cut.flatMap((g) => g.invalid); + if (pastCap.length) { + lines.push( + `Also invalid, past the collector's limit: ${pastCap.map((p) => code(p)).join(', ')}.`, + ); + } + if (cut.length) lines.push(`Not every field was read: ${cutSentence(cut)}`); const submits = state.events.filter((e) => e.formId === form.id && e.type === 'submit').slice(-5); if (submits.length) lines.push('Recent submits:', ...submits.map(eventLine)); return `${UNTRUSTED}\n\n**${form.label.replace(/[`*]/g, "'")}** (${form.id})\n${lines.join('\n')}${freshness(state, now, [form])}`; diff --git a/packages/devtools/src/rpc/forms-tools.ts b/packages/devtools/src/rpc/forms-tools.ts index 7d89231d..abf4b26f 100644 --- a/packages/devtools/src/rpc/forms-tools.ts +++ b/packages/devtools/src/rpc/forms-tools.ts @@ -17,7 +17,8 @@ import { capText, pathHint, } from './forms-cap.ts'; -import { fixedTtl, type PageTtl } from './page-ttl.ts'; +import { PAGE_TTL_MS, fixedTtl, type PageTtl } from './page-ttl.ts'; +import { cutGroups, cutSentence, pastCapLines } from './forms-collector-cap.ts'; import { clip } from '../text.ts'; import { RESOURCE_UNTRUSTED, withUntrustedNotice } from './resource-text.ts'; import { refusal } from './refusal.ts'; @@ -54,8 +55,7 @@ export interface PageReport { } const STALE_AFTER_MS = 10_000; -export const FORMS_PAGE_TTL_MS = 150_000; -const PAGE_EXPIRES_MS = FORMS_PAGE_TTL_MS; +const PAGE_EXPIRES_MS = PAGE_TTL_MS; const MAX_EVENTS = 200; const MAX_TOOL_CHARS = FORM_TOOL_MAX_CHARS; const RESOURCE_EVENTS = 50; @@ -226,6 +226,9 @@ export function explainForm(form: CollectedForm, now = Date.now(), path?: string }; const start = path ? subtreeAt(form.root, path) : form.root; if (start) visit(start); + if (start) lines.push(...pastCapLines(form, start)); + // Groups the collector cut: a failing field can be among the fields it left out. + const cut = start ? cutSentence(cutGroups(start)) : ''; const submitted = form.submitted === undefined ? '' : form.submitted ? ', submitted' : ', not submitted'; const header = `**${form.label.replace(/[`*]/g, "'")}** (${form.kind}, id ${form.id}) is ${form.root.status}${submitted}.`; @@ -234,15 +237,22 @@ export function explainForm(form: CollectedForm, now = Date.now(), path?: string return `${header} No field at ${code(path ?? '')}; top-level fields: ${top}.`; } if (!lines.length) { - if (start !== form.root) return `${header} No field under ${code(start.path)} has an error.`; + const failing = start.status === 'INVALID' || start.status === 'PENDING'; + if (cut && failing) { + return `${header} No field the collector read reports an error, but the failing field may be past its limit: ${cut}`; + } + const note = cut ? ` ${cut}` : ''; + if (start !== form.root) + return `${header} No field under ${code(start.path)} has an error.${note}`; return form.root.status === 'VALID' - ? `${header} No field has an error.` - : `${header} No field reports an error of its own; check disabled, hidden or not-yet-created fields.`; + ? `${header} No field has an error.${note}` + : `${header} No field reports an error of its own; check disabled, hidden or not-yet-created fields.${note}`; } const narrow = start === form.root ? '`path`' : 'a deeper `path`'; return [ header, ...capLines(lines, `pass ${narrow} to explain one group${pathHint(cutPaths(start, lines))}`), + ...(cut ? [`_Not every field was read: ${cut}_`] : []), ].join('\n'); } @@ -264,7 +274,11 @@ export function inspectFormsText( const lines = forms.map((f) => { const fields = countNodes(f.root, () => 1); const errors = countNodes(f.root, (n) => n.errors.length); - return `- ${f.id} ${code(f.label)} (${f.kind}): ${f.root.status}, ${fields} fields, ${errors} errors${webMcpLine(f)}`; + const notRead = countNodes(f.root, (n) => n.truncated ?? 0); + const read = notRead + ? `${fields} fields read and ${notRead} more past the collector's limit` + : `${fields} fields`; + return `- ${f.id} ${code(f.label)} (${f.kind}): ${f.root.status}, ${read}, ${errors} errors${webMcpLine(f)}`; }); return `${UNTRUSTED}\n\n${forms.length} form(s) on the page. Pass \`form\` for a field tree, or use explain-invalid-forms for validation problems.\n\n${lines.join('\n')}${webMcpNotes(state, args.page)}${stale}`; } @@ -341,6 +355,10 @@ function renderTrees( clipped += capped.clipped; trimmed += capped.trimmed; } + // Read the cut from the unpruned tree: `onlyInvalid` drops kept fields too. + const whole = root && subtreeAt(f.root, root.path); + const cut = whole ? cutSentence(cutGroups(whole)) : ''; + if (cut) notes.push(`_${f.id}: not every field was read: ${cut}_`); if (capped && capped.shown < capped.total) { notes.push( `_${f.id}: showing ${capped.shown} of ${capped.total} fields; ${capped.total - capped.shown} more not shown. Groups that lost fields carry \`notShown\`. Pass \`path\` to start the tree at a group or field${pathHint(capped.cut)}, or \`onlyInvalid\` to keep only failing fields._`, @@ -439,6 +457,7 @@ const OPTIONAL_TYPES: Record = { changed: 'boolean', redacted: 'string', pendingSince: 'number', + truncated: 'number', rules: 'object', binding: 'object', dom: 'object', @@ -452,7 +471,7 @@ function optionalOk(node: Record): boolean { if (value === undefined) continue; if (type === 'object' ? !isRecord(value) : typeof value !== type) return false; } - for (const key of ['validatorNames', 'asyncValidatorNames', 'stale']) { + for (const key of ['validatorNames', 'asyncValidatorNames', 'stale', 'truncatedInvalid']) { if (node[key] !== undefined && !isStringArray(node[key])) return false; } if (node['metadata'] !== undefined && !Array.isArray(node['metadata'])) return false; diff --git a/packages/devtools/src/rpc/page-ttl.ts b/packages/devtools/src/rpc/page-ttl.ts index 1b9b0060..897b3682 100644 --- a/packages/devtools/src/rpc/page-ttl.ts +++ b/packages/devtools/src/rpc/page-ttl.ts @@ -1,5 +1,11 @@ -/** How long a page may go without a report before its data is dropped. */ -export const PAGE_TTL_MS = 15_000; +/** + * How long a page may go without a report or a heartbeat before its data is + * dropped. Every per-page store uses it. Three heartbeat intervals + * (`PAGE_HEARTBEAT_MS`, 10 s), so one or two late or lost beats don't drop a + * page that is still open, and a tab that died without `pagehide` goes within + * half a minute. + */ +export const PAGE_TTL_MS = 30_000; /** * How long a tab in the background may go without saying it is still there. diff --git a/packages/devtools/src/rpc/router-tools.ts b/packages/devtools/src/rpc/router-tools.ts index 901f662d..40f56c3a 100644 --- a/packages/devtools/src/rpc/router-tools.ts +++ b/packages/devtools/src/rpc/router-tools.ts @@ -4,7 +4,7 @@ import type { RouteNode } from '../router-config.ts'; import type { RouterSetup } from '../router-setup.ts'; import type { LinkInfo, OutletInfo } from '../router-links.ts'; import type { PreloadRecord } from '../router-actions.ts'; -import { fixedTtl, type PageTtl } from './page-ttl.ts'; +import { PAGE_TTL_MS, fixedTtl, type PageTtl } from './page-ttl.ts'; import { code, UNTRUSTED } from './forms-tools.ts'; import { callerPage } from './page-scope.ts'; import { unknownPageText } from './pages.ts'; @@ -56,8 +56,7 @@ export interface RouterState { type Pages = Map; const STALE_AFTER_MS = 10_000; -export const ROUTER_PAGE_TTL_MS = 150_000; -const PAGE_EXPIRES_MS = ROUTER_PAGE_TTL_MS; +const PAGE_EXPIRES_MS = PAGE_TTL_MS; const MAX_NAVIGATIONS = 50; const MAX_PAGES = 20; const MAX_RESOURCE_CHARS = 100_000; diff --git a/packages/devtools/src/rpc/scan-list.ts b/packages/devtools/src/rpc/scan-list.ts new file mode 100644 index 00000000..6c6a500f --- /dev/null +++ b/packages/devtools/src/rpc/scan-list.ts @@ -0,0 +1,103 @@ +import type { ToolInputSchema } from './tool-input.ts'; + +/** Longest answer of a listed source scan, note included, as for the live tools. */ +export const SCAN_LIST_MAX_CHARS = 20_000; +/** Room the note after a cut part takes, so the whole answer fits {@link SCAN_LIST_MAX_CHARS}. */ +const NOTE_ROOM = 300; +const JSON_ROOM = SCAN_LIST_MAX_CHARS - NOTE_ROOM; +/** Items a listed source scan answers when the call sets no `limit`. */ +export const SCAN_LIST_DEFAULT_LIMIT = 200; +/** The most items one call can ask for. */ +export const SCAN_LIST_MAX_LIMIT = 1_000; + +/** How a scan that answers a list is filtered and paged. */ +export interface ScanList { + /** What the items are, plural, for the notes: `signals`. */ + noun: string; + /** The item fields `filter` searches. */ + fields: readonly string[]; +} + +export interface ScanListArgs { + filter?: string; + offset?: number; + limit?: number; +} + +/** The `filter`, `offset` and `limit` arguments of a listed scan. */ +export function scanListSchema(list: ScanList): Record { + return { + filter: { + type: 'string', + maxLength: 200, + description: `Only ${list.noun} whose ${list.fields.join(', ')} contains this text, any case.`, + }, + offset: { + type: 'integer', + minimum: 0, + description: `How many matching ${list.noun} to skip (default 0). A cut answer says the offset of the next part.`, + }, + limit: { + type: 'integer', + minimum: 1, + maximum: SCAN_LIST_MAX_LIMIT, + description: `How many ${list.noun} to answer (1-${SCAN_LIST_MAX_LIMIT}, default ${SCAN_LIST_DEFAULT_LIMIT}). The answer also stops at ${SCAN_LIST_MAX_CHARS.toLocaleString('en-US')} characters.`, + }, + }; +} + +function matches(item: unknown, fields: readonly string[], needle: string): boolean { + if (!item || typeof item !== 'object') return false; + return fields.some((field) => { + const value = (item as Record)[field]; + const text = Array.isArray(value) ? value.join(' ') : value; + return typeof text === 'string' && text.toLowerCase().includes(needle); + }); +} + +/** + * One part of a scan's list as compact JSON. An answer that holds every + * matching item is the JSON array alone, as before; a cut one is followed by + * a note with how many items it left out and the `offset` of the next part. + */ +export function scanListAnswer(items: unknown[], args: ScanListArgs, list: ScanList): string { + const needle = args.filter?.trim().toLowerCase() ?? ''; + const matched = needle ? items.filter((item) => matches(item, list.fields, needle)) : items; + const offset = args.offset ?? 0; + const limit = args.limit ?? SCAN_LIST_DEFAULT_LIMIT; + const which = needle ? `${list.noun} matching \`filter\`` : list.noun; + const narrow = needle ? '' : ', or `filter` to narrow it'; + + if (!matched.length) { + return needle + ? `[]\n\n_No ${list.noun} match \`filter\`; the scan found ${items.length} in all._` + : '[]'; + } + if (offset >= matched.length) { + return `[]\n\n_No ${which} at \`offset\` ${offset}; there are ${matched.length}, so the last part starts at ${Math.max(0, matched.length - limit)}._`; + } + + let part = matched.slice(offset, offset + limit); + let json = JSON.stringify(part); + if (json.length > JSON_ROOM && part.length > 1) { + // The most items that fit, found by bisection; at least one. + let low = 1; + let high = part.length - 1; + while (low < high) { + const mid = Math.ceil((low + high) / 2); + if (JSON.stringify(part.slice(0, mid)).length <= JSON_ROOM) low = mid; + else high = mid - 1; + } + part = part.slice(0, low); + json = JSON.stringify(part); + } + if (offset === 0 && part.length === matched.length) return json; + + const end = offset + part.length; + const left = matched.length - part.length; + const next = + end < matched.length + ? ` Pass \`offset: ${end}\` for the next part${narrow}.` + : ' This is the last part.'; + return `${json}\n\n_Showing ${which} ${offset + 1}-${end} of ${matched.length}; ${left} more not shown.${next}_`; +} diff --git a/packages/devtools/src/rpc/scan-tools.ts b/packages/devtools/src/rpc/scan-tools.ts index f674229e..a2a52cc6 100644 --- a/packages/devtools/src/rpc/scan-tools.ts +++ b/packages/devtools/src/rpc/scan-tools.ts @@ -5,11 +5,13 @@ import { getPipes } from './get-pipes.ts'; import { getProviders } from './get-providers.ts'; import { getRoutes } from './get-routes.ts'; import { getSignals } from './get-signals.ts'; +import { scanListAnswer, scanListSchema, type ScanList, type ScanListArgs } from './scan-list.ts'; /** * The source scan agent tools (`scan-*`, `ngrx-scan`). Each runs the RPC * function the panel reads (`get-routes`, `build-meta` and so on) and - * answers with its result as compact JSON, one text block. The RPC functions + * answers with its result as compact JSON, one text block. A scan with a + * `list` answers one capped part of its list (`scan-list.ts`). The RPC functions * keep their names for the panel; only the agent tool is named after the * scan rule (a tool that reads only the project's files starts with `scan-`). */ @@ -24,6 +26,8 @@ interface ScanToolSpec { title: string; description: string; definition: ScanDefinition; + /** A scan that answers a list: it takes `filter`, `offset` and `limit`, and caps its answer. */ + list?: ScanList; } export const SCAN_TOOLS: readonly ScanToolSpec[] = [ @@ -38,8 +42,9 @@ export const SCAN_TOOLS: readonly ScanToolSpec[] = [ id: 'pangular:scan-components', title: 'Scan Angular components', description: - 'Source scan of @Component and @Directive classes as JSON: class, selector (empty for routed components), `kind`, inputs, outputs, file and line. pangular:list-components reads the live instances.', + 'Source scan of @Component and @Directive classes as JSON: class, selector (empty for routed components), `kind`, inputs, outputs, file and line. At most 200 items or 20,000 characters; a cut answer gives the next `offset`. Narrow with `filter`.', definition: getComponents as unknown as ScanDefinition, + list: { noun: 'components', fields: ['className', 'selector', 'kind', 'file'] }, }, { id: 'pangular:scan-pipes', @@ -52,8 +57,9 @@ export const SCAN_TOOLS: readonly ScanToolSpec[] = [ id: 'pangular:scan-signals', title: 'Scan Angular signals', description: - 'Source scan as JSON of signal(), computed(), linkedSignal(), effect(), toSignal(), resources, signal inputs, models and queries: name, kind, file and line. pangular:inspect-signals reads the live graph.', + 'Source scan as JSON of signal(), computed(), linkedSignal(), effect(), toSignal(), resources, signal inputs, models and queries: name, kind, file and line. At most 200 items or 20,000 characters; a cut answer gives the next `offset`. Narrow with `filter`.', definition: getSignals as unknown as ScanDefinition, + list: { noun: 'signals', fields: ['name', 'kind', 'file', 'component'] }, }, { id: 'pangular:scan-providers', @@ -97,13 +103,17 @@ export function scanTool(spec: ScanToolSpec, ctx: unknown) { id: spec.id, title: spec.title, description: spec.description, - inputSchema: { type: 'object', properties: {} }, - handler: async () => { + inputSchema: { + type: 'object', + properties: spec.list ? scanListSchema(spec.list) : {}, + }, + handler: async (args: ScanListArgs = {}) => { run ??= handlerOf().catch((error: unknown) => { run = undefined; throw error; }); const result = await (await run)(); + if (spec.list && Array.isArray(result)) return scanListAnswer(result, args ?? {}, spec.list); return JSON.stringify(result); }, }; diff --git a/scripts/e2e-mcp.mjs b/scripts/e2e-mcp.mjs index e1a6603f..b789a2b0 100644 --- a/scripts/e2e-mcp.mjs +++ b/scripts/e2e-mcp.mjs @@ -376,6 +376,8 @@ const CAPS = { 'export-form': 20_000, 'capacitor-list-calls': 20_000, 'capacitor-list-plugins': 20_000, + 'scan-components': 20_000, + 'scan-signals': 20_000, 'ngrx-export-session': 60_000, 'change-detection': 100_000, }; @@ -611,8 +613,10 @@ const READ_PLAN = [ ['scan-build', null, () => ({})], ['scan-routes', null, () => ({})], ['scan-components', null, () => ({})], + ['scan-components', null, () => ({ filter: 'example', limit: 3 })], ['scan-pipes', null, () => ({})], ['scan-signals', null, () => ({})], + ['scan-signals', null, () => ({ filter: 'signal', offset: 1, limit: 5 })], ['scan-providers', null, () => ({})], ['ngrx-scan', null, () => ({})], ['devframes_plugin_messages_list', null, () => ({})], diff --git a/scripts/e2e-resilience.mjs b/scripts/e2e-resilience.mjs index f1b210bc..ddd3a068 100644 --- a/scripts/e2e-resilience.mjs +++ b/scripts/e2e-resilience.mjs @@ -766,7 +766,7 @@ async function checkExpiry() { } if (hiddenMarked === null && last[ids.hidden].background) hiddenMarked = s; const done = ['close', 'crash'].every((w) => !last[ids[w]].listed && !last[ids[w]].keys.length); - if (done && Date.now() - t0 > 40_000) break; + if (done && Date.now() - t0 > 45_000) break; await sleep(2000); } const elapsed = Math.round((Date.now() - t0) / 1000); @@ -787,17 +787,15 @@ async function checkExpiry() { Object.values(firstGone.close).every((s) => s <= 20) && !last[ids.close].keys.length, JSON.stringify(firstGone.close), ); - // #422: a tab that dies without pagehide stays listed for about 150 s. - knownFailure( - 422, - 'a crashed tab leaves list-pages within the 15 s expiry (+5 s sweep)', - listedGone.crash !== undefined && listedGone.crash <= 22, + // A tab that dies without pagehide goes with the one page expiry (#422). + assert( + 'a crashed tab leaves list-pages within the 30 s expiry (+5 s sweep)', + listedGone.crash !== undefined && listedGone.crash <= 37, `${listedGone.crash ?? 'never'} s`, ); - knownFailure( - 422, - 'a crashed tab leaves every shared state within the 15 s expiry (+5 s sweep)', - Object.values(firstGone.crash).every((s) => s <= 22) && !last[ids.crash].keys.length, + assert( + 'a crashed tab leaves every shared state within the 30 s expiry (+5 s sweep)', + Object.values(firstGone.crash).every((s) => s <= 37) && !last[ids.crash].keys.length, JSON.stringify(firstGone.crash), ); assert('the open tab is still listed', last[ids.keep].listed); @@ -807,7 +805,7 @@ async function checkExpiry() { `after ${hiddenMarked} s`, ); assert( - 'a background tab keeps its last data past the 15 s expiry', + 'a background tab keeps its last data past the 30 s expiry', last[ids.hidden].listed && before[ids.hidden].keys.every((k) => last[ids.hidden].keys.includes(k)), `missing: ${before[ids.hidden].keys.filter((k) => !last[ids.hidden].keys.includes(k))}`, @@ -1101,9 +1099,8 @@ async function checkStress() { formDetail.match(/"truncated":\d+/g) ?? [], ); const listed = Number(/(\d+) fields/.exec(formsList)?.[1]); - // #423: the forms collector keeps 100 children per group and does not say so. - knownFailure( - 423, + // The forms collector keeps 100 children per group and says so (#423). + assert( 'inspect-forms counts the 300 controls of the form (or says it stopped at a limit)', listed >= 300 || formNotes.some((l) => /300|200 more|limit of 100|first 100/i.test(l)), `${listed} fields; ${formNotes[0] ?? ''}`, @@ -1112,8 +1109,7 @@ async function checkStress() { await sleep(2500); const invalid = await mcp.tool('explain-invalid-forms', { page: id, form: formId }); record('explain-invalid-forms with field250 failing', invalid.replace(/\s+/g, ' ').slice(0, 300)); - knownFailure( - 423, + assert( 'explain-invalid-forms names a failing field past the 100th control', invalid.includes('field250'), ); From ee5a6ae44091a63b9a44aa98a3f3372402aee512 Mon Sep 17 00:00:00 2001 From: Erkam Yaman Date: Wed, 21 Oct 2026 15:26:25 +0000 Subject: [PATCH 04/10] fix(ui): follow a hash change and fit the components toolbar at narrow widths The panel read `#tab=` only on load. It now follows a hash that changes after load, the same way (#425). At 360 px the Components toolbar wrapped to four rows. Below 600 px its tree actions are icon buttons with their names kept for screen readers, so it fits on two rows, and a cut off component name shows its full text on hover and focus (#421). --- .../__tests__/component-tree-narrow.test.ts | 124 ++++++++++++ app/src/__tests__/shell-deep-link.test.ts | 19 ++ app/src/app.ts | 15 ++ app/src/pages/component-tree.ts | 183 ++++++++++++++---- 4 files changed, 298 insertions(+), 43 deletions(-) create mode 100644 app/src/__tests__/component-tree-narrow.test.ts diff --git a/app/src/__tests__/component-tree-narrow.test.ts b/app/src/__tests__/component-tree-narrow.test.ts new file mode 100644 index 00000000..ea324947 --- /dev/null +++ b/app/src/__tests__/component-tree-narrow.test.ts @@ -0,0 +1,124 @@ +import { TestBed, type ComponentFixture } from '@angular/core/testing'; +import type { DevframeRpcClient } from 'devframe/client'; +import { afterEach, describe, expect, it, vi } from 'vitest'; +import { ComponentTree } from '../pages/component-tree'; + +const LONG = 'CustomerOrderHistoryTableWithInlineFiltersComponent'; + +const roots = [ + { + id: 'app', + name: 'App', + tag: 'app-root', + children: [{ id: 'long', name: LONG, tag: 'app-customer-order-history-table', children: [] }], + }, +]; + +function client(): DevframeRpcClient { + const state: Record = { + 'component-tree': { + pages: { + a: { pageId: 'a', title: 'a', url: '/', roots, count: 2, detail: null, reportedAt: 1 }, + }, + }, + }; + const rpc = { + call: () => Promise.resolve([]), + callEvent: () => Promise.resolve(), + sharedState: (name: string) => + Promise.resolve({ value: () => state[name] ?? null, on: () => () => {} }), + }; + return { connectionMeta: {}, scope: () => ({ rpc }) } as unknown as DevframeRpcClient; +} + +async function settle(fixture: ComponentFixture) { + for (let i = 0; i < 3; i++) { + await new Promise((resolve) => setTimeout(resolve)); + await fixture.whenStable(); + } +} + +async function setup() { + const fixture = TestBed.createComponent(ComponentTree); + fixture.componentRef.setInput('rpc', client()); + document.body.appendChild(fixture.nativeElement); + await settle(fixture); + return { fixture, root: fixture.nativeElement as HTMLElement }; +} + +/** jsdom has no layout, so names that are cut off report a wider content than their box. */ +function cutOff(names: string[]) { + vi.spyOn(HTMLElement.prototype, 'scrollWidth', 'get').mockImplementation(function ( + this: HTMLElement, + ) { + return names.includes(this.textContent?.trim() ?? '') ? 400 : 0; + }); + vi.spyOn(HTMLElement.prototype, 'clientWidth', 'get').mockReturnValue(120); +} + +afterEach(() => { + vi.restoreAllMocks(); + document.body.innerHTML = ''; + TestBed.resetTestingModule(); +}); + +describe('component tree at narrow widths', () => { + it('keeps a name and a hover title on every toolbar action', async () => { + const { fixture, root } = await setup(); + const actions = Array.from( + root.querySelectorAll('.toolbar .tree-action, .toolbar .pick'), + ); + expect(actions.map((b) => b.querySelector('.label')?.textContent?.trim())).toEqual([ + 'Expand all', + 'Collapse all', + 'Pick component on page', + ]); + for (const action of actions) { + expect(action.title).toBe(action.textContent?.trim()); + } + fixture.destroy(); + }); + + it('gives each name and tag its full text as a hover title', async () => { + const { fixture, root } = await setup(); + const row = root.querySelector('.row[data-id="long"]')!; + expect(row.querySelector('.name')!.title).toBe(LONG); + expect(row.querySelector('.tag')!.title).toBe( + '', + ); + fixture.destroy(); + }); + + it('shows the full text of a cut off row while it has focus', async () => { + cutOff([LONG]); + const { fixture, root } = await setup(); + const row = root.querySelector('.row[data-id="long"]')!; + row.focus(); + await settle(fixture); + const tip = root.querySelector('.name-tip'); + expect(tip?.textContent?.trim()).toBe(`${LONG} `); + expect(tip?.getAttribute('aria-hidden')).toBe('true'); + + row.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true })); + await settle(fixture); + expect(root.querySelector('.name-tip')).toBeNull(); + + row.blur(); + row.focus(); + await settle(fixture); + expect(root.querySelector('.name-tip')).not.toBeNull(); + row.blur(); + await settle(fixture); + expect(root.querySelector('.name-tip')).toBeNull(); + fixture.destroy(); + }); + + it('shows no tip for a row that fits', async () => { + cutOff([LONG]); + const { fixture, root } = await setup(); + root.querySelector('.row[data-id="app"]')!.focus(); + await settle(fixture); + expect(root.querySelector('.name-tip')).toBeNull(); + fixture.destroy(); + }); +}); diff --git a/app/src/__tests__/shell-deep-link.test.ts b/app/src/__tests__/shell-deep-link.test.ts index 47758340..6d588d53 100644 --- a/app/src/__tests__/shell-deep-link.test.ts +++ b/app/src/__tests__/shell-deep-link.test.ts @@ -91,6 +91,25 @@ describe('deep links', () => { booted.fixture.destroy(); }); + it('switches tabs when only the hash changes after load', async () => { + const { fixture, app } = await boot('#tab=signals'); + expect(app.tab()).toBe('signals'); + location.hash = '#tab=forms'; + await settle(fixture); + expect(app.tab()).toBe('forms'); + location.hash = '#tab=components&id=9&page=p3'; + await settle(fixture); + expect(app.tab()).toBe('components'); + expect(app.componentFocus()).toEqual({ id: '9', pageId: 'p3' }); + location.hash = '#tab=settings'; + await settle(fixture); + expect(app.tab()).toBe('settings'); + location.hash = '#tab=nope'; + await settle(fixture); + expect(app.tab()).toBe('settings'); + fixture.destroy(); + }); + it('follows a link the server sends to open panels', async () => { const { fixture, app } = await boot(); server.handlers.get('open-in-panel')!({ tab: 'components', id: '7', page: 'p2' }); diff --git a/app/src/app.ts b/app/src/app.ts index 01fcf99b..36e38e11 100644 --- a/app/src/app.ts +++ b/app/src/app.ts @@ -201,6 +201,7 @@ function readView(): View | null { '[style.--accent]': 'viewAccent()?.accent ?? null', '[style.--accent-text]': 'viewAccent()?.text ?? null', '(window:message)': 'inspectFromPanel($event)', + '(window:hashchange)': 'followHash()', '(document:keydown)': 'onGlobalKey($event)', }, imports: [ @@ -1631,6 +1632,20 @@ export class App implements OnInit, OnDestroy { return true; } + /** + * Follows a `#tab=` link that changes after load (a link inside the panel, or + * a script setting `location.hash`), the same way as one on load. + */ + followHash() { + const link = parsePanelLink(location.hash); + if (!link) return; + if (link.tab === 'settings') { + if (this.tab() !== 'settings') this.toggleSettings(); + return; + } + this.openLink(link); + } + /** Listens for the commands and links the server sends to every open panel. */ private listenForServer(client: DevframeRpcClient) { const rpc = client.scope('pangular').rpc as unknown as { diff --git a/app/src/pages/component-tree.ts b/app/src/pages/component-tree.ts index 754f09df..3cddb9ca 100644 --- a/app/src/pages/component-tree.ts +++ b/app/src/pages/component-tree.ts @@ -252,57 +252,63 @@ function storedDirectiveHosts(): boolean { /> } {{ countLabel() }} - @if (page()!.directiveHostCount) { +
+ @if (page()!.directiveHostCount) { + + } - } - - - @if (!native()) { - } + @if (!native()) { + + } +

{{ announcement() }}

@if (pickMessage()) { @@ -313,7 +319,7 @@ function storedDirectiveHosts(): boolean { }
-
+

Component tree

@if (!rows().length) {
@@ -361,8 +367,9 @@ function storedDirectiveHosts(): boolean { [class.dir-host]="row.node.kind === 'directive'" [style.--depth]="row.depth" (click)="select(row.node.id)" - (focus)="focusId.set(row.node.id); highlight(row.node.id)" - (blur)="highlight(null)" + (focus)="focusId.set(row.node.id); highlight(row.node.id); showNameTip($event)" + (blur)="highlight(null); nameTip.set(null)" + (keydown.escape)="nameTip.set(null)" (mouseenter)="highlight(row.node.id)" (mouseleave)="highlight(null)" > @@ -385,8 +392,10 @@ function storedDirectiveHosts(): boolean { }} directive host } @else { - {{ row.node.name }} - <{{ row.node.tag }}> + {{ row.node.name }} + <{{ row.node.tag }}> } @if (row.node.hydration; as status) { }
+ @if (nameTip(); as tip) { + + }
@if (selectedHost(); as host) { @@ -1345,6 +1359,73 @@ function storedDirectiveHosts(): boolean { border-color: var(--accent-line); color: var(--text-strong); } + /* A narrow panel keeps the search and count on one row and the tree + actions on a second one, as icons named by their hidden labels. */ + .tree-actions { + display: contents; + } + @media (max-width: 600px) { + .toolbar { + gap: 8px; + } + .search { + flex-basis: 100%; + } + .toolbar:has(.page-select) .search { + flex-basis: 160px; + } + .page-select { + flex: 1 1 120px; + } + .count { + flex: 1 1 80px; + min-width: 0; + white-space: normal; + line-height: 1.3; + } + .tree-actions { + display: flex; + flex: none; + gap: 8px; + margin-left: auto; + } + .tree-action, + .pick { + flex: none; + width: var(--control-h); + padding: 0; + } + .tree-action .label, + .pick .label { + position: absolute; + width: 1px; + height: 1px; + overflow: hidden; + clip-path: inset(50%); + white-space: nowrap; + } + } + .tree-col { + position: relative; + min-width: 0; + } + .name-tip { + position: absolute; + z-index: 1; + left: 8px; + max-width: calc(100% - 16px); + padding: 4px 8px; + background: var(--surface-3); + border: 1px solid var(--border-strong); + border-radius: var(--radius-sm); + box-shadow: var(--shadow); + color: var(--text-strong); + font-size: 12px; + line-height: 1.4; + overflow-wrap: anywhere; + pointer-events: none; + @include m.enter(150ms); + } .owner-action { margin-top: 10px; } @@ -1726,6 +1807,9 @@ export class ComponentTree { private pickPageId: string | null = null; private pickSeq = 0; readonly focusId = signal(null); + /** The full text of the focused row when its name or tag is cut off, shown below the row. */ + readonly nameTip = signal<{ text: string; top: number } | null>(null); + readonly pickLabel = computed(() => (this.picking() ? 'Cancel pick' : 'Pick component on page')); private readonly bridge = inject(ExtensionBridge); readonly actionMessage = linkedSignal({ source: this.selectedId, @@ -2547,6 +2631,19 @@ export class ComponentTree { }); } + /** Shows the full text of a focused row whose name, tag or directives are cut off. */ + showNameTip(event: FocusEvent) { + const row = event.currentTarget as HTMLElement; + const parts = Array.from(row.querySelectorAll('.name, .tag, .host-dirs')); + const cut = parts.some((part) => part.scrollWidth > part.clientWidth + 1); + if (!cut) { + this.nameTip.set(null); + return; + } + const text = parts.map((part) => part.title || part.textContent?.trim()).join(' '); + this.nameTip.set({ text, top: row.offsetTop + row.offsetHeight + 2 }); + } + highlight(id: string | null) { const client = this.rpc(); if (!client) return; From 9977943b84b4be863f988ce68db06288c934375d Mon Sep 17 00:00:00 2001 From: Erkam Yaman Date: Wed, 21 Oct 2026 15:26:27 +0000 Subject: [PATCH 05/10] build(extension): rebuild the bundled panel --- ...=> browser-agent-rpc-BXhoSh1z-57G_sncs.js} | 2 +- .../{index-Dxobp9ys.js => index-CrTS-W4h.js} | 204 ++++++++++++------ extension/ui/index.html | 2 +- 3 files changed, 139 insertions(+), 69 deletions(-) rename extension/ui/assets/{browser-agent-rpc-BXhoSh1z-D8KenRn9.js => browser-agent-rpc-BXhoSh1z-57G_sncs.js} (93%) rename extension/ui/assets/{index-Dxobp9ys.js => index-CrTS-W4h.js} (80%) diff --git a/extension/ui/assets/browser-agent-rpc-BXhoSh1z-D8KenRn9.js b/extension/ui/assets/browser-agent-rpc-BXhoSh1z-57G_sncs.js similarity index 93% rename from extension/ui/assets/browser-agent-rpc-BXhoSh1z-D8KenRn9.js rename to extension/ui/assets/browser-agent-rpc-BXhoSh1z-57G_sncs.js index 1c4bc9e7..034246f9 100644 --- a/extension/ui/assets/browser-agent-rpc-BXhoSh1z-D8KenRn9.js +++ b/extension/ui/assets/browser-agent-rpc-BXhoSh1z-57G_sncs.js @@ -1 +1 @@ -import{t as e}from"./index-Dxobp9ys.js";var t=Symbol.for(`devframe:browser-agent-registry`),{tools:n,listeners:r}=globalThis[t]??={tools:new Map,listeners:new Set};function i(){return[...n.values()]}function a(e){return r.add(e),()=>r.delete(e)}var o=`devframe:client-id`,s;function c(t=globalThis.window){try{let n=t?.sessionStorage;if(n){let t=n.getItem(o);return t||(t=e(),n.setItem(o,t)),t}}catch{}return s??=e(),s}function l(e){e.client.register({name:`devframe:agent:invoke-client-tool`,type:`action`,jsonSerializable:!0,handler:async(e,t)=>{let n=i().find(t=>t.id===e);if(!n)throw Error(`[devframe/agent] browser tool "${e}" not found`);return await n.invoke(t)}});let t=!1,n=!1,r=0,o=()=>{t||n||(t=!0,queueMicrotask(async()=>{if(t=!1,n)return;let a=i().map(({invoke:e,...t})=>t);(a.length!==0||r!==0)&&(r=a.length,await e.callOptional(`devframe:agent:sync-client-tools`,c(),a).catch(()=>{}))}))},s=a(o),l=e.events.on(`connection:status`,e=>{e===`connected`&&o()});return o(),()=>{n=!0,s(),l()}}export{l as setupBrowserAgentRpcBridge}; \ No newline at end of file +import{t as e}from"./index-CrTS-W4h.js";var t=Symbol.for(`devframe:browser-agent-registry`),{tools:n,listeners:r}=globalThis[t]??={tools:new Map,listeners:new Set};function i(){return[...n.values()]}function a(e){return r.add(e),()=>r.delete(e)}var o=`devframe:client-id`,s;function c(t=globalThis.window){try{let n=t?.sessionStorage;if(n){let t=n.getItem(o);return t||(t=e(),n.setItem(o,t)),t}}catch{}return s??=e(),s}function l(e){e.client.register({name:`devframe:agent:invoke-client-tool`,type:`action`,jsonSerializable:!0,handler:async(e,t)=>{let n=i().find(t=>t.id===e);if(!n)throw Error(`[devframe/agent] browser tool "${e}" not found`);return await n.invoke(t)}});let t=!1,n=!1,r=0,o=()=>{t||n||(t=!0,queueMicrotask(async()=>{if(t=!1,n)return;let a=i().map(({invoke:e,...t})=>t);(a.length!==0||r!==0)&&(r=a.length,await e.callOptional(`devframe:agent:sync-client-tools`,c(),a).catch(()=>{}))}))},s=a(o),l=e.events.on(`connection:status`,e=>{e===`connected`&&o()});return o(),()=>{n=!0,s(),l()}}export{l as setupBrowserAgentRpcBridge}; \ No newline at end of file diff --git a/extension/ui/assets/index-Dxobp9ys.js b/extension/ui/assets/index-CrTS-W4h.js similarity index 80% rename from extension/ui/assets/index-Dxobp9ys.js rename to extension/ui/assets/index-CrTS-W4h.js index b99431ae..cdaebc48 100644 --- a/extension/ui/assets/index-Dxobp9ys.js +++ b/extension/ui/assets/index-CrTS-W4h.js @@ -3,12 +3,12 @@ \r \v ᠎ - \u2028\u2029   `;`${qt}`,`${qt}`;var Jt=(function(e){return e[e.Character=0]=`Character`,e[e.Identifier=1]=`Identifier`,e[e.PrivateIdentifier=2]=`PrivateIdentifier`,e[e.Keyword=3]=`Keyword`,e[e.String=4]=`String`,e[e.Operator=5]=`Operator`,e[e.Number=6]=`Number`,e[e.RegExpBody=7]=`RegExpBody`,e[e.RegExpFlags=8]=`RegExpFlags`,e[e.Error=9]=`Error`,e})(Jt||{}),Yt=(function(e){return e[e.Plain=0]=`Plain`,e[e.TemplateLiteralPart=1]=`TemplateLiteralPart`,e[e.TemplateLiteralEnd=2]=`TemplateLiteralEnd`,e})(Yt||{});Jt.Character,x.StyleMap,x.ClassMap,x.StyleProp,x.ClassProp,x.Attribute,x.Property,x.Attribute,x.Control,x.DomProperty,x.DomProperty,x.Attribute,x.StyleMap,x.ClassMap,x.StyleProp,x.ClassProp,x.Listener,x.TwoWayListener,x.AnimationListener,x.StyleMap,x.ClassMap,x.StyleProp,x.ClassProp,x.Property,x.TwoWayProperty,x.DomProperty,x.Attribute,x.Animation,x.Control,Ht.Idle,b.deferOnIdle,b.deferPrefetchOnIdle,b.deferHydrateOnIdle,Ht.Immediate,b.deferOnImmediate,b.deferPrefetchOnImmediate,b.deferHydrateOnImmediate,Ht.Timer,b.deferOnTimer,b.deferPrefetchOnTimer,b.deferHydrateOnTimer,Ht.Hover,b.deferOnHover,b.deferPrefetchOnHover,b.deferHydrateOnHover,Ht.Interaction,b.deferOnInteraction,b.deferPrefetchOnInteraction,b.deferHydrateOnInteraction,Ht.Viewport,b.deferOnViewport,b.deferPrefetchOnViewport,b.deferHydrateOnViewport,Ht.Never,b.deferHydrateNever,b.deferHydrateNever,b.deferHydrateNever,b.pipeBind1,b.pipeBind2,b.pipeBind3,b.pipeBind4,b.textInterpolate,b.textInterpolate1,b.textInterpolate2,b.textInterpolate3,b.textInterpolate4,b.textInterpolate5,b.textInterpolate6,b.textInterpolate7,b.textInterpolate8,b.textInterpolateV,b.interpolate,b.interpolate1,b.interpolate2,b.interpolate3,b.interpolate4,b.interpolate5,b.interpolate6,b.interpolate7,b.interpolate8,b.interpolateV,b.pureFunction0,b.pureFunction1,b.pureFunction2,b.pureFunction3,b.pureFunction4,b.pureFunction5,b.pureFunction6,b.pureFunction7,b.pureFunction8,b.pureFunctionV,b.resolveWindow,b.resolveDocument,b.resolveBody,rt.HTML,b.sanitizeHtml,rt.RESOURCE_URL,b.sanitizeResourceUrl,rt.SCRIPT,b.sanitizeScript,rt.STYLE,b.sanitizeStyle,rt.URL,b.sanitizeUrl,rt.ATTRIBUTE_NO_BINDING,b.validateAttribute,rt.HTML,b.trustConstantHtml,rt.RESOURCE_URL,b.trustConstantResourceUrl;var Xt=(function(e){return e[e.None=0]=`None`,e[e.ViewContextRead=1]=`ViewContextRead`,e[e.ViewContextWrite=2]=`ViewContextWrite`,e[e.SideEffectful=4]=`SideEffectful`,e})(Xt||{});S.Tmpl,S.Tmpl,S.Both,S.Host,S.Tmpl,S.Tmpl,S.Tmpl,S.Both,S.Both,S.Both,S.Tmpl,S.Both,S.Both,S.Tmpl,S.Both,S.Tmpl,S.Both,S.Both,S.Tmpl,S.Tmpl,S.Tmpl,S.Tmpl,S.Tmpl,S.Both,S.Both,S.Tmpl,S.Tmpl,S.Tmpl,S.Tmpl,S.Both,S.Both,S.Both,S.Tmpl,S.Tmpl,S.Both,S.Tmpl,S.Tmpl,S.Tmpl,S.Both,S.Both,S.Tmpl,S.Both,S.Both,S.Both,S.Both,S.Both,S.Tmpl,S.Tmpl,S.Tmpl,S.Tmpl,S.Tmpl,S.Tmpl,S.Tmpl,S.Tmpl,S.Tmpl,S.Tmpl,S.Tmpl,S.Tmpl,S.Both,S.Tmpl,S.Both,S.Tmpl,S.Both,S.Tmpl,S.Tmpl,S.Tmpl,S.Tmpl,S.Tmpl,S.Tmpl,S.Both,S.Both,S.Both,Et.Property,Lt.Property,Et.TwoWay,Lt.TwoWayProperty,Et.Attribute,Lt.Attribute,Et.Class,Lt.ClassName,Et.Style,Lt.StyleProperty,Et.LegacyAnimation,Lt.LegacyAnimation,Et.Animation,Lt.Animation;var Zt=`%COMP%`;`${Zt}`,`${Zt}`,class e{static SINGLETON=new e;static veWillInferAnyFor(t){let n=e.SINGLETON;return t instanceof Tt?t.visit(n):t.receiver.visit(n)}visitUnary(e){return e.expr.visit(this)}visitBinary(e){return e.left.visit(this)||e.right.visit(this)}visitChain(){return!1}visitConditional(e){return e.condition.visit(this)||e.trueExp.visit(this)||e.falseExp.visit(this)}visitCall(){return!0}visitSafeCall(){return!1}visitImplicitReceiver(){return!1}visitThisReceiver(){return!1}visitInterpolation(e){return e.expressions.some(e=>e.visit(this))}visitKeyedRead(){return!1}visitLiteralArray(){return!0}visitLiteralMap(){return!0}visitLiteralPrimitive(){return!1}visitPipe(){return!0}visitPrefixNot(e){return e.expression.visit(this)}visitTypeofExpression(e){return e.expression.visit(this)}visitVoidExpression(e){return e.expression.visit(this)}visitNonNullAssert(e){return e.expression.visit(this)}visitPropertyRead(){return!1}visitSafePropertyRead(){return!1}visitSafeKeyedRead(){return!1}visitTemplateLiteral(){return!1}visitTemplateLiteralElement(){return!1}visitTaggedTemplateLiteral(){return!1}visitParenthesizedExpression(e){return e.expression.visit(this)}visitRegularExpressionLiteral(){return!1}visitSpreadElement(e){return e.expression.visit(this)}visitArrowFunction(e,t){return!1}};var Qt=null,$t=!1,en=1,tn=null,nn=Symbol(`SIGNAL`);function rn(e){let t=Qt;return Qt=e,t}function an(){return Qt}var on={version:0,lastCleanEpoch:0,dirty:!1,producers:void 0,producersTail:void 0,consumers:void 0,consumersTail:void 0,recomputing:!1,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,kind:`unknown`,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function sn(e){if($t)throw Error(``);if(Qt===null)return;Qt.consumerOnSignalRead(e);let t=Qt.producersTail;if(t!==void 0&&t.producer===e)return;let n,r=Qt.recomputing;if(r&&(n=t===void 0?Qt.producers:t.nextProducer,n!==void 0&&n.producer===e)){Qt.producersTail=n,n.lastReadVersion=e.version,n.knownValidAtEpoch=en;return}let i=e.consumersTail;if(i!==void 0&&i.consumer===Qt&&(!r||i.knownValidAtEpoch===en))return;let a=Sn(Qt),o={producer:e,consumer:Qt,nextProducer:n,prevConsumer:void 0,knownValidAtEpoch:en,lastReadVersion:e.version,nextConsumer:void 0};Qt.producersTail=o,t===void 0?Qt.producers=o:t.nextProducer=o,a&&bn(e,o)}function cn(){en++}function ln(e){if((!Sn(e)||e.dirty)&&(e.dirty||e.lastCleanEpoch!==en)){if(!e.producerMustRecompute(e)&&!vn(e)){pn(e);return}e.producerRecomputeValue(e),pn(e)}}function un(e){if(e.consumers===void 0)return;let t=$t;$t=!0;try{for(let t=e.consumers;t!==void 0;t=t.nextConsumer){let e=t.consumer;e.dirty||fn(e)}}finally{$t=t}}function dn(){return Qt?.consumerAllowSignalWrites!==!1}function fn(e){e.dirty=!0,un(e),e.consumerMarkedDirty?.(e)}function pn(e){e.dirty=!1,e.lastCleanEpoch=en}function mn(e){return e&&hn(e),rn(e)}function hn(e){if(e.producersTail?.knownValidAtEpoch===en){let t=e.producers;for(;t!==void 0;)t.knownValidAtEpoch=null,t=t.nextProducer}e.producersTail=void 0,e.recomputing=!0}function gn(e,t){rn(t),e&&_n(e)}function _n(e){e.recomputing=!1;let t=e.producersTail,n=t===void 0?e.producers:t.nextProducer;if(n!==void 0){if(Sn(e))do n=xn(n);while(n!==void 0);t===void 0?e.producers=void 0:t.nextProducer=void 0}}function vn(e){for(let t=e.producers;t!==void 0;t=t.nextProducer){let e=t.producer,n=t.lastReadVersion;if(n!==e.version||(ln(e),n!==e.version))return!0}return!1}function yn(e){if(Sn(e)){let t=e.producers;for(;t!==void 0;)t=xn(t)}e.producers=void 0,e.producersTail=void 0,e.consumers=void 0,e.consumersTail=void 0}function bn(e,t){let n=e.consumersTail,r=Sn(e);if(n===void 0?(t.nextConsumer=void 0,e.consumers=t):(t.nextConsumer=n.nextConsumer,n.nextConsumer=t),t.prevConsumer=n,e.consumersTail=t,!r)for(let t=e.producers;t!==void 0;t=t.nextProducer)bn(t.producer,t)}function xn(e){let t=e.producer,n=e.nextProducer,r=e.nextConsumer,i=e.prevConsumer;if(e.nextConsumer=void 0,e.prevConsumer=void 0,r===void 0?t.consumersTail=i:r.prevConsumer=i,i!==void 0)i.nextConsumer=r;else if(t.consumers=r,!Sn(t)){let e=t.producers;for(;e!==void 0;)e=xn(e)}return n}function Sn(e){return e.consumerIsAlwaysLive||e.consumers!==void 0}function Cn(e){tn?.(e)}function wn(e,t){return Object.is(e,t)}function Tn(e,t){let n=Object.create(kn);n.computation=e,t!==void 0&&(n.equal=t);let r=()=>{if(ln(n),sn(n),n.value===On)throw n.error;return n.value};return r[nn]=n,Cn(n),r}var En=Symbol(`UNSET`),Dn=Symbol(`COMPUTING`),On=Symbol(`ERRORED`),kn={...on,value:En,dirty:!0,error:null,equal:wn,kind:`computed`,producerMustRecompute(e){return e.value===En||e.value===Dn},producerRecomputeValue(e){if(e.value===Dn)throw Error(``);let t=e.value;e.value=Dn;let n=mn(e),r,i=!1;try{r=e.computation(),rn(null),i=t!==En&&t!==On&&r!==On&&e.equal(t,r)}catch(t){r=On,e.error=t}finally{gn(e,n)}if(i){e.value=t;return}e.value=r,e.version++}};function An(){throw Error()}var jn=An;function Mn(e){jn(e)}function Nn(e){jn=e}var Pn=null;function Fn(e,t){let n=Object.create(zn);n.value=e,t!==void 0&&(n.equal=t);let r=()=>In(n);return r[nn]=n,Cn(n),[r,e=>Ln(n,e),e=>Rn(n,e)]}function In(e){return sn(e),e.value}function Ln(e,t){dn()||Mn(e),e.equal(e.value,t)||(e.value=t,Bn(e))}function Rn(e,t){dn()||Mn(e),Ln(e,t(e.value))}var zn={...on,equal:wn,value:void 0,kind:`signal`};function Bn(e){e.version++,cn(),un(e),Pn?.(e)}var Vn={...on,consumerIsAlwaysLive:!0,consumerAllowSignalWrites:!0,dirty:!0,kind:`effect`};function Hn(e){if(e.dirty=!1,e.version>0&&!vn(e))return;e.version++;let t=mn(e);try{e.cleanup(),e.fn()}finally{gn(e,t)}}var Un=void 0;function Wn(){return Un}function Gn(e){let t=Un;return Un=e,t}var Kn=Symbol(`NotFound`);function qn(e){return e===Kn||e?.name===`ɵNotFound`}function Jn(e,t,n){let r=Object.create(Zn);r.source=e,r.computation=t,n!=null&&(r.equal=n);let i=()=>{if(ln(r),sn(r),r.value===On)throw r.error;return r.value};return i[nn]=r,Cn(r),i}function Yn(e,t){ln(e),Ln(e,t),pn(e)}function Xn(e,t){if(ln(e),e.value===On)throw e.error;Rn(e,t),pn(e)}var Zn={...on,value:En,dirty:!0,error:null,equal:wn,kind:`linkedSignal`,producerMustRecompute(e){return e.value===En||e.value===Dn},producerRecomputeValue(e){if(e.value===Dn)throw Error(``);let t=e.value;e.value=Dn;let n=mn(e),r,i=!1;try{let n=e.source(),a=t!==En&&t!==On,o=a?{source:e.sourceValue,value:t}:void 0;r=e.computation(n,o),e.sourceValue=n,rn(null),i=a&&r!==On&&e.equal(t,r)}catch(t){r=On,e.error=t}finally{gn(e,n)}if(i){e.value=t;return}e.value=r,e.version++}};function Qn(e){let t=rn(null);try{return e()}finally{rn(t)}}var $n=function(e,t){return $n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},$n(e,t)};function er(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);$n(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function tr(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function nr(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function ir(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function ar(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof or?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function cr(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof rr==`function`?rr(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}function lr(e){return typeof e==`function`}function ur(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var dr=ur(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription: `+t.map(function(e,t){return t+1+`) `+e.toString()}).join(` `):``,this.name=`UnsubscriptionError`,this.errors=t}});function fr(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var pr=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a){if(this._parentage=null,Array.isArray(a))try{for(var o=rr(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this)}var c=this.initialTeardown;if(lr(c))try{c()}catch(e){i=e instanceof dr?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=rr(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{gr(f)}catch(e){i??=[],e instanceof dr?i=ar(ar([],ir(i)),ir(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new dr(i)}},e.prototype.add=function(t){if(t&&t!==this){if(this.closed)gr(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&fr(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&fr(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e}(),mr=pr.EMPTY;function hr(e){return e instanceof pr||e&&`closed`in e&&lr(e.remove)&&lr(e.add)&&lr(e.unsubscribe)}function gr(e){lr(e)?e():e.unsubscribe()}var _r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},vr={setTimeout:function(e,t){var n=[...arguments].slice(2),r=vr.delegate;return r?.setTimeout?r.setTimeout.apply(r,ar([e,t],ir(n))):setTimeout.apply(void 0,ar([e,t],ir(n)))},clearTimeout:function(e){return(vr.delegate?.clearTimeout||clearTimeout)(e)},delegate:void 0};function yr(e){vr.setTimeout(function(){var t=_r.onUnhandledError;if(t)t(e);else throw e})}function br(){}var xr=(function(){return wr(`C`,void 0,void 0)})();function Sr(e){return wr(`E`,void 0,e)}function Cr(e){return wr(`N`,e,void 0)}function wr(e,t,n){return{kind:e,value:t,error:n}}var Tr=null;function Er(e){if(_r.useDeprecatedSynchronousErrorHandling){var t=!Tr;if(t&&(Tr={errorThrown:!1,error:null}),e(),t){var n=Tr,r=n.errorThrown,i=n.error;if(Tr=null,r)throw i}}else e()}function Dr(e){_r.useDeprecatedSynchronousErrorHandling&&Tr&&(Tr.errorThrown=!0,Tr.error=e)}var Or=function(e){er(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,hr(t)&&t.add(n)):n.destination=Ir,n}return t.create=function(e,t,n){return new Mr(e,t,n)},t.prototype.next=function(e){this.isStopped?Fr(Cr(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?Fr(Sr(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?Fr(xr,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(pr),kr=Function.prototype.bind;function Ar(e,t){return kr.call(e,t)}var jr=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){Nr(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Nr(e)}else Nr(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Nr(e)}},e}(),Mr=function(e){er(t,e);function t(t,n,r){var i=e.call(this)||this,a;if(lr(t)||!t)a={next:t??void 0,error:n??void 0,complete:r??void 0};else{var o;i&&_r.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&Ar(t.next,o),error:t.error&&Ar(t.error,o),complete:t.complete&&Ar(t.complete,o)}):a=t}return i.destination=new jr(a),i}return t}(Or);function Nr(e){_r.useDeprecatedSynchronousErrorHandling?Dr(e):yr(e)}function Pr(e){throw e}function Fr(e,t){var n=_r.onStoppedNotification;n&&vr.setTimeout(function(){return n(e,t)})}var Ir={closed:!0,next:br,error:Pr,complete:br},Lr=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function Rr(e){return e}function zr(e){return e.length===0?Rr:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var Br=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=Ur(e)?e:new Mr(e,t,n);return Er(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=Vr(t),new t(function(t,r){var i=new Mr({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){return this.source?.subscribe(e)},e.prototype[Lr]=function(){return this},e.prototype.pipe=function(){return zr([...arguments])(this)},e.prototype.toPromise=function(e){var t=this;return e=Vr(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function Vr(e){return e??_r.Promise??Promise}function Hr(e){return e&&lr(e.next)&&lr(e.error)&&lr(e.complete)}function Ur(e){return e&&e instanceof Or||Hr(e)&&hr(e)}function Wr(e){return lr(e?.lift)}function Gr(e){return function(t){if(Wr(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function Kr(e,t,n,r,i){return new qr(e,t,n,r,i)}var qr=function(e){er(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t}(Or),Jr=ur(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),Yr=function(e){er(t,e);function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.prototype.lift=function(e){var t=new Xr(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Jr},t.prototype.next=function(e){var t=this;Er(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||=Array.from(t.observers);try{for(var i=rr(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;Er(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;Er(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){return this.observers?.length>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?mr:(this.currentObservers=null,a.push(e),new pr(function(){t.currentObservers=null,fr(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new Br;return e.source=this,e},t.create=function(e,t){return new Xr(e,t)},t}(Br),Xr=function(e){er(t,e);function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.prototype.next=function(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)},t.prototype.error=function(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)},t.prototype.complete=function(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)},t.prototype._subscribe=function(e){return this.source?.subscribe(e)??mr},t}(Yr),Zr=function(e){er(t,e);function t(t){var n=e.call(this)||this;return n._value=t,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(Yr);function Qr(e){return e[e.length-1]}function $r(e){return lr(Qr(e))?e.pop():void 0}var ei=(function(e){return e&&typeof e.length==`number`&&typeof e!=`function`});function ti(e){return lr(e?.then)}function ni(e){return lr(e[Lr])}function ri(e){return Symbol.asyncIterator&&lr(e?.[Symbol.asyncIterator])}function ii(e){return TypeError(`You provided `+(typeof e==`object`&&e?`an invalid object`:`'`+e+`'`)+` where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function ai(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}var oi=ai();function si(e){return lr(e?.[oi])}function ci(e){return sr(this,arguments,function(){var t,n,r,i;return nr(this,function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,or(t.read())];case 3:return n=a.sent(),r=n.value,i=n.done,i?[4,or(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,or(r)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function li(e){return lr(e?.getReader)}function ui(e){if(e instanceof Br)return e;if(e!=null){if(ni(e))return lee(e);if(ei(e))return uee(e);if(ti(e))return dee(e);if(ri(e))return di(e);if(si(e))return fee(e);if(li(e))return pee(e)}throw ii(e)}function lee(e){return new Br(function(t){var n=e[Lr]();if(lr(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}function uee(e){return new Br(function(t){for(var n=0;n=0?n.slice(0,r):n}function wi(e,t){return e?t?`${e} ${t}`:e:t||``}var Ti=xi({__forward_ref__:xi});function Ei(e){return e.__forward_ref__=Ei,e}function Di(e){return Oi(e)?e():e}function Oi(e){return typeof e==`function`&&Object.hasOwn(e,Ti)&&e.__forward_ref__===Ei}function ki(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function Ai(e){return ji(e,Pi)}function ji(e,t){return Object.hasOwn(e,t)&&e[t]||null}function Mi(e){return(e?.[Pi]??null)||null}function Ni(e){return e&&Object.hasOwn(e,Fi)?e[Fi]:null}var Pi=xi({ɵprov:xi}),Fi=xi({ɵinj:xi}),Ii=class{_desc;ngMetadataName=`InjectionToken`;ɵprov;constructor(e,t){this._desc=e,this.ɵprov=void 0,typeof t==`number`?this.__NG_ELEMENT_ID__=t:t!==void 0&&(this.ɵprov=ki({token:this,providedIn:t.providedIn||`root`,factory:t.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};function Li(e){return e&&!!e.ɵproviders}var Ri=xi({ɵcmp:xi}),zi=xi({ɵdir:xi}),Bi=xi({ɵpipe:xi}),Vi=xi({ɵfac:xi}),Hi=xi({__NG_ELEMENT_ID__:xi}),Ui=xi({__NG_ENV_ID__:xi});function Wi(e){return qi(e,`@Component`),e[Ri]||null}function Gi(e){return qi(e,`@Directive`),e[zi]||null}function Ki(e){return qi(e,`@Pipe`),e[Bi]||null}function qi(e,t){if(e==null)throw new vi(-919,!1)}function Ji(e){return typeof e==`string`?e:e==null?``:String(e)}var Yi=xi({ngErrorCode:xi}),Xi=xi({ngErrorMessage:xi}),Zi=xi({ngTokenPath:xi});function Qi(e,t){return ea(``,-200,t)}function $i(e,t){throw new vi(-201,!1)}function ea(e,t,n){let r=new vi(t,e);return r[Yi]=t,r[Xi]=e,n&&(r[Zi]=n),r}function ta(e){return e[Yi]}var na;function ra(){return na}function ia(e){let t=na;return na=e,t}function aa(e,t,n){let r=Ai(e);if(r&&r.providedIn==`root`)return r.value===void 0?r.value=r.factory():r.value;if(n&8)return null;if(t!==void 0)return t;$i(e,``)}var oa=globalThis,sa={},ca=`__NG_DI_FLAG__`,la=class{injector;constructor(e){this.injector=e}retrieve(e,t){let n=fa(t)||0;try{return this.injector.get(e,n&8?null:sa,n)}catch(e){if(qn(e))return e;throw e}}};function ua(e,t=0){let n=Wn();if(n===void 0)throw new vi(-203,!1);if(n===null)return aa(e,void 0,t);{let r=pa(t),i=n.retrieve(e,r);if(qn(i)){if(r.optional)return null;throw i}return i}}function da(e,t=0){return(ra()||ua)(Di(e),t)}function C(e,t){return da(e,fa(t))}function fa(e){return e===void 0||typeof e==`number`?e:0|(e.optional&&8)|(e.host&&1)|(e.self&&2)|(e.skipSelf&&4)}function pa(e){return{optional:!!(e&8),host:!!(e&1),self:!!(e&2),skipSelf:!!(e&4)}}function ma(e){let t=[];for(let n=0;nArray.isArray(e)?ya(e,t):t(e))}function ba(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function xa(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function Sa(e,t){let n=[];for(let r=0;rt;){let t=i-2;e[i]=e[t],i--}e[t]=n,e[t+1]=r}}function wa(e,t,n){let r=Ea(e,t);return r>=0?e[r|1]=n:(r=~r,Ca(e,r,t,n)),r}function Ta(e,t){let n=Ea(e,t);if(n>=0)return e[n|1]}function Ea(e,t){return Da(e,t,1)}function Da(e,t,n){let r=0,i=e.length>>n;for(;i!==r;){let a=r+(i-r>>1),o=e[a<t?i=a:r=a+1}return~(i<{n.push(e)};return ya(t,e=>{let t=e;La(t,a,[],r)&&(i||=[],i.push(t))}),i!==void 0&&Ia(i,a),n}function Ia(e,t){for(let n=0;n{t(e,r)})}}function La(e,t,n,r){if(e=Di(e),!e)return!1;let i=null,a=Ni(e),o=!a&&Wi(e);if(!a&&!o){let t=e.ngModule;if(a=Ni(t),a)i=t;else return!1}else if(o&&!o.standalone)return!1;else i=e;let s=r.has(i);if(o){if(s)return!1;if(r.add(i),o.dependencies){let e=typeof o.dependencies==`function`?o.dependencies():o.dependencies;for(let i of e)La(i,t,n,r)}}else if(a){if(a.imports!=null&&!s){r.add(i);let e;try{ya(a.imports,i=>{La(i,t,n,r)&&(e||=[],e.push(i))})}finally{}e!==void 0&&Ia(e,t)}if(!s){let e=ga(i)||(()=>new i);t({provide:i,useFactory:e,deps:ka},i),t({provide:Ma,useValue:i,multi:!0},i),t({provide:Aa,useValue:()=>da(i),multi:!0},i)}let o=a.providers;if(o!=null&&!s){let n=e;Ra(o,e=>{t(e,n)})}}else return!1;return i!==e&&e.providers!==void 0}function Ra(e,t){for(let n of e)Li(n)&&(n=n.ɵproviders),Array.isArray(n)?Ra(n,t):t(n)}var za=xi({provide:String,useValue:xi});function Ba(e){return typeof e==`object`&&!!e&&za in e}function Va(e){return!!(e&&e.useExisting)}function Ha(e){return!!(e&&e.useFactory)}function Ua(e){return typeof e==`function`}function Wa(e){return!!e.useClass}var Ga=new Ii(``),Ka={},qa={},Ja=void 0;function Ya(){return Ja===void 0&&(Ja=new Na),Ja}var Xa=class{},Za=class extends Xa{parent;source;scopes;records=new Map;_ngOnDestroyHooks=new Set;_onDestroyHooks=[];get destroyed(){return this._destroyed}_destroyed=!1;injectorDefTypes;constructor(e,t,n,r){super(),this.parent=t,this.source=n,this.scopes=r,so(e,e=>this.processProvider(e)),this.records.set(ja,ro(void 0,this)),r.has(`environment`)&&this.records.set(Xa,ro(void 0,this));let i=this.records.get(Ga);i!=null&&typeof i.value==`string`&&this.scopes.add(i.value),this.injectorDefTypes=new Set(this.get(Ma,ka,{self:!0}))}retrieve(e,t){let n=fa(t)||0;try{return this.get(e,sa,n)}catch(e){if(qn(e))return e;throw e}}destroy(){no(this),this._destroyed=!0;let e=rn(null);try{for(let e of this._ngOnDestroyHooks)e.ngOnDestroy();let e=this._onDestroyHooks;this._onDestroyHooks=[];for(let t of e)t()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),rn(e)}}onDestroy(e){return no(this),this._onDestroyHooks.push(e),()=>this.removeOnDestroy(e)}runInContext(e){no(this);let t=Gn(this),n=ia(void 0);try{return e()}finally{Gn(t),ia(n)}}get(e,t=sa,n){if(no(this),Object.hasOwn(e,Ui))return e[Ui](this);let r=fa(n),i=Gn(this),a=ia(void 0);try{if(!(r&4)){let t=this.records.get(e);if(t===void 0){let n=oo(e)&&Ai(e);t=n&&this.injectableDefInScope(n)?ro(Qa(e),Ka):null,this.records.set(e,t)}if(t!=null)return this.hydrate(e,t,r)}let n=r&2?Ya():this.parent;return t=r&8&&t===sa?null:t,n.get(e,t)}catch(e){let t=ta(e);throw t===-200||t===-201?new vi(t,null):e}finally{ia(a),Gn(i)}}resolveInjectorInitializers(){let e=rn(null),t=Gn(this),n=ia(void 0);try{let e=this.get(Aa,ka,{self:!0});for(let t of e)t()}finally{Gn(t),ia(n),rn(e)}}toString(){return`R3Injector[...]`}processProvider(e){e=Di(e);let t=Ua(e)?e:Di(e&&e.provide),n=eo(e);if(!Ua(e)&&e.multi===!0){let n=this.records.get(t);n||(n=ro(void 0,Ka,!0),n.factory=()=>ma(n.multi),this.records.set(t,n)),t=e,n.multi.push(e)}this.records.set(t,n)}hydrate(e,t,n){let r=rn(null);try{if(t.value===qa)throw Qi(``);return t.value===Ka&&(t.value=qa,t.value=t.factory(void 0,n)),typeof t.value==`object`&&t.value&&ao(t.value)&&this._ngOnDestroyHooks.add(t.value),t.value}finally{rn(r)}}injectableDefInScope(e){if(!e.providedIn)return!1;let t=Di(e.providedIn);return typeof t==`string`?t===`any`||this.scopes.has(t):this.injectorDefTypes.has(t)}removeOnDestroy(e){let t=this._onDestroyHooks.indexOf(e);t!==-1&&this._onDestroyHooks.splice(t,1)}};function Qa(e){let t=Ai(e),n=t===null?ga(e):t.factory;if(n!==null)return n;if(e instanceof Ii)throw new vi(-204,!1);if(e instanceof Function)return $a(e);throw new vi(-204,!1)}function $a(e){if(e.length>0)throw new vi(-204,!1);let t=Mi(e);return t===null?()=>new e:()=>t.factory(e)}function eo(e){return Ba(e)?ro(void 0,e.useValue):ro(to(e),Ka)}function to(e,t,n){let r;if(Ua(e)){let t=Di(e);return ga(t)||Qa(t)}if(Ba(e))r=()=>Di(e.useValue);else if(Ha(e))r=()=>e.useFactory(...ma(e.deps||[]));else if(Va(e))r=(t,n)=>da(Di(e.useExisting),n!==void 0&&n&8?8:void 0);else{let t=Di(e&&(e.useClass||e.provide));if(io(e))r=()=>new t(...ma(e.deps));else return ga(t)||Qa(t)}return r}function no(e){if(e.destroyed)throw new vi(-205,!1)}function ro(e,t,n=!1){return{factory:e,value:t,multi:n?[]:void 0}}function io(e){return!!e.deps}function ao(e){return typeof e==`object`&&!!e&&typeof e.ngOnDestroy==`function`}function oo(e){return typeof e==`function`||typeof e==`object`&&e.ngMetadataName===`InjectionToken`}function so(e,t){for(let n of e)Array.isArray(n)?so(n,t):n&&Li(n)?so(n.ɵproviders,t):t(n)}function co(e,t){let n;e instanceof Za?(no(e),n=e):n=new la(e);let r=Gn(n),i=ia(void 0);try{return t()}finally{Gn(r),ia(i)}}function lo(){return ra()!==void 0||Wn()!=null}var uo=1;function fo(e){return Array.isArray(e)&&typeof e[uo]==`object`}function po(e){return Array.isArray(e)&&e[uo]===!0}function mo(e){return!!(e.flags&4)}function ho(e){return e.componentOffset>-1}function go(e){return(e.flags&1)==1}function _o(e){return!!e.template}function vo(e){return!!(e[2]&512)}function yo(e){return(e[2]&256)==256}var bo=(function(e){return e[e.NONE=0]=`NONE`,e[e.HTML=1]=`HTML`,e[e.STYLE=2]=`STYLE`,e[e.SCRIPT=3]=`SCRIPT`,e[e.URL=4]=`URL`,e[e.RESOURCE_URL=5]=`RESOURCE_URL`,e[e.ATTRIBUTE_NO_BINDING=6]=`ATTRIBUTE_NO_BINDING`,e})(bo||{}),xo=`math`;function So(e){for(;Array.isArray(e);)e=e[0];return e}function Co(e,t){return So(t[e])}function wo(e,t){return So(t[e.index])}function To(e,t){return e.data[t]}function Eo(e,t){return e[t]}function Do(e,t,n,r){n>=e.data.length&&(e.data[n]=null,e.blueprint[n]=null),t[n]=r}function Oo(e,t){let n=t[e];return fo(n)?n:n[0]}function ko(e){return(e[2]&128)==128}function Nee(e){return po(e[3])}function Ao(e,t){return t==null?null:e[t]}function jo(e){e[17]=0}function Mo(e){e[2]&1024||(e[2]|=1024,ko(e)&&Fo(e))}function Pee(e,t){for(;e>0;)t=t[14],e--;return t}function No(e){return!!(e[2]&9216||e[24]?.dirty)}function Po(e){e[10].changeDetectionScheduler?.notify(8),e[2]&64&&(e[2]|=1024),No(e)&&Fo(e)}function Fo(e){e[10].changeDetectionScheduler?.notify(0);let t=Lo(e);for(;t!==null&&!(t[2]&8192||(t[2]|=8192,!ko(t)));)t=Lo(t)}function Io(e,t){if(yo(e))throw new vi(911,!1);e[21]===null&&(e[21]=[]),e[21].push(t)}function Fee(e,t){if(e[21]===null)return;let n=e[21].indexOf(t);n!==-1&&e[21].splice(n,1)}function Lo(e){let t=e[3];return po(t)?t[3]:t}function Ro(e){return e[7]??=[]}function zo(e){return e.cleanup??=[]}function Iee(e,t,n,r){let i=Ro(t);i.push(n),e.firstCreatePass&&zo(e).push(r,i.length-1)}var Bo={lFrame:hs(null),bindingsEnabled:!0,skipHydrationRootTNode:null},Vo=!1;function Lee(){return Bo.lFrame.elementDepthCount}function Ree(){Bo.lFrame.elementDepthCount++}function Ho(){Bo.lFrame.elementDepthCount--}function Uo(){return Bo.bindingsEnabled}function Wo(){return Bo.skipHydrationRootTNode!==null}function Go(e){return Bo.skipHydrationRootTNode===e}function Ko(){Bo.skipHydrationRootTNode=null}function qo(){return Bo.lFrame.lView}function Jo(){return Bo.lFrame.tView}function w(e){return Bo.lFrame.contextLView=e,e[8]}function T(e){return Bo.lFrame.contextLView=null,e}function Yo(){let e=Xo();for(;e!==null&&e.type===64;)e=e.parent;return e}function Xo(){return Bo.lFrame.currentTNode}function zee(){let e=Bo.lFrame,t=e.currentTNode;return e.isParent?t:t.parent}function Zo(e,t){let n=Bo.lFrame;n.currentTNode=e,n.isParent=t}function Qo(){return Bo.lFrame.isParent}function $o(){Bo.lFrame.isParent=!1}function es(){return Bo.lFrame.contextLView}function ts(){return Vo}function ns(e){let t=Vo;return Vo=e,t}function rs(){let e=Bo.lFrame,t=e.bindingRootIndex;return t===-1&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}function is(){return Bo.lFrame.bindingIndex}function Bee(e){return Bo.lFrame.bindingIndex=e}function as(){return Bo.lFrame.bindingIndex++}function os(e){let t=Bo.lFrame,n=t.bindingIndex;return t.bindingIndex+=e,n}function Vee(){return Bo.lFrame.inI18n}function Hee(e,t){let n=Bo.lFrame;n.bindingIndex=n.bindingRootIndex=e,ss(t)}function Uee(){return Bo.lFrame.currentDirectiveIndex}function ss(e){Bo.lFrame.currentDirectiveIndex=e}function cs(e){let t=Bo.lFrame.currentDirectiveIndex;return t===-1?null:e[t]}function ls(){return Bo.lFrame.currentQueryIndex}function us(e){Bo.lFrame.currentQueryIndex=e}function ds(e){let t=e[1];return t.type===2?t.declTNode:t.type===1?e[5]:null}function fs(e,t,n){if(n&4){let r=t,i=e;for(;r=r.parent,r===null&&!(n&1)&&(r=ds(i),!(r===null||(i=i[14],r.type&10))););if(r===null)return!1;t=r,e=i}let r=Bo.lFrame=ms();return r.currentTNode=t,r.lView=e,!0}function ps(e){let t=ms(),n=e[1];Bo.lFrame=t,t.currentTNode=n.firstChild,t.lView=e,t.tView=n,t.contextLView=e,t.bindingIndex=n.bindingStartIndex,t.inI18n=!1}function ms(){let e=Bo.lFrame,t=e===null?null:e.child;return t===null?hs(e):t}function hs(e){let t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null,inI18n:!1};return e!==null&&(e.child=t),t}function gs(){let e=Bo.lFrame;return Bo.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}var _s=gs;function vs(){let e=gs();e.isParent=!0,e.tView=null,e.selectedIndex=-1,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function ys(e){return(Bo.lFrame.contextLView=Pee(e,Bo.lFrame.contextLView))[8]}function bs(){return Bo.lFrame.selectedIndex}function xs(e){Bo.lFrame.selectedIndex=e}function Ss(){let e=Bo.lFrame;return To(e.tView,e.selectedIndex)}function E(){Bo.lFrame.currentNamespace=`svg`}function Cs(){ws()}function ws(){Bo.lFrame.currentNamespace=null}function Ts(){return Bo.lFrame.currentNamespace}var Es=!0;function Ds(){return Es}function Os(e){Es=e}function ks(e,t=null,n=null,r){let i=As(e,t,n,r);return i.resolveInjectorInitializers(),i}function As(e,t=null,n=null,r,i=new Set){return new Za([n||ka,Pa(e)],t||Ya(),null,i)}var js=class e{static THROW_IF_NOT_FOUND=sa;static NULL=new Na;static create(e,t){if(Array.isArray(e))return ks({name:``},t,e,``);{let t=e.name??``;return ks({name:t},e.parent,e.providers,t)}}static ɵprov=ki({token:e,providedIn:`any`,factory:()=>da(ja)});static __NG_ELEMENT_ID__=-1},Ms=new Ii(``),Ns=class{static __NG_ELEMENT_ID__=Fs;static __NG_ENV_ID__=e=>e},Ps=class extends Ns{_lView;constructor(e){super(),this._lView=e}get destroyed(){return yo(this._lView)}onDestroy(e){let t=this._lView;return Io(t,e),()=>Fee(t,e)}};function Fs(){return new Ps(qo())}var Is=new Ii(``),Ls=(()=>{class e{taskId=0;pendingTasks=new Set;destroyed=!1;pendingTask=new Zr(!1);debugTaskTracker=C(Is,{optional:!0});get hasPendingTasks(){return!this.destroyed&&this.pendingTask.value}get hasPendingTasksObservable(){return this.destroyed?new Br(e=>{e.next(!1),e.complete()}):this.pendingTask}add(){!this.hasPendingTasks&&!this.destroyed&&this.pendingTask.next(!0);let e=this.taskId++;return this.pendingTasks.add(e),this.debugTaskTracker?.add(e),e}has(e){return this.pendingTasks.has(e)}remove(e){this.pendingTasks.delete(e),this.debugTaskTracker?.remove(e),this.pendingTasks.size===0&&this.hasPendingTasks&&this.pendingTask.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this.hasPendingTasks&&this.pendingTask.next(!1),this.destroyed=!0,this.pendingTask.unsubscribe()}static ɵprov=ki({token:e,providedIn:`root`,factory:()=>new e})}return e})(),Rs=class extends Yr{__isAsync;destroyRef=void 0;pendingTasks=void 0;constructor(e=!1){super(),this.__isAsync=e,lo()&&(this.destroyRef=C(Ns,{optional:!0})??void 0,this.pendingTasks=C(Ls,{optional:!0})??void 0)}emit(e){let t=rn(null);try{super.next(e)}finally{rn(t)}}subscribe(e,t,n){let r=e,i=t||(()=>null),a=n;if(e&&typeof e==`object`){let t=e;r=t.next?.bind(t),i=t.error?.bind(t),a=t.complete?.bind(t)}this.__isAsync&&(i=this.wrapInTimeout(i),r&&=this.wrapInTimeout(r),a&&=this.wrapInTimeout(a));let o=super.subscribe({next:r,error:i,complete:a});return e instanceof pr&&e.add(o),o}wrapInTimeout(e){return t=>{let n=this.pendingTasks?.add();setTimeout(()=>{try{e(t)}finally{n!==void 0&&this.pendingTasks?.remove(n)}})}}};function zs(...e){}function Bs(e){let t,n;function r(){e=zs;try{n!==void 0&&typeof cancelAnimationFrame==`function`&&cancelAnimationFrame(n),t!==void 0&&clearTimeout(t)}catch{}}return t=setTimeout(()=>{e(),r()}),typeof requestAnimationFrame==`function`&&(n=requestAnimationFrame(()=>{e(),r()})),()=>r()}function Vs(e){return queueMicrotask(()=>e()),()=>{e=zs}}var Hs=`isAngularZone`,Us=`isAngularZone_ID`,Ws=0,Gs=class e{hasPendingMacrotasks=!1;hasPendingMicrotasks=!1;isStable=!0;onUnstable=new Rs(!1);onMicrotaskEmpty=new Rs(!1);onStable=new Rs(!1);onError=new Rs(!1);constructor(e){let{enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:n=!1,shouldCoalesceRunChangeDetection:r=!1,scheduleInRootZone:i=!1}=e;if(typeof Zone>`u`)throw new vi(908,!1);Zone.assertZonePatched();let a=this;a._nesting=0,a._outer=a._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(a._inner=a._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(a._inner=a._inner.fork(Zone.longStackTraceZoneSpec)),a.shouldCoalesceEventChangeDetection=!r&&n,a.shouldCoalesceRunChangeDetection=r,a.callbackScheduled=!1,a.scheduleInRootZone=i,Ys(a)}static isInAngularZone(){return typeof Zone<`u`&&Zone.current.get(Hs)===!0}static assertInAngularZone(){if(!e.isInAngularZone())throw new vi(909,!1)}static assertNotInAngularZone(){if(e.isInAngularZone())throw new vi(909,!1)}run(e,t,n){return this._inner.run(e,t,n)}runTask(e,t,n,r){let i=this._inner,a=i.scheduleEventTask(`NgZoneEvent: `+r,e,Ks,zs,zs);try{return i.runTask(a,t,n)}finally{i.cancelTask(a)}}runGuarded(e,t,n){return this._inner.runGuarded(e,t,n)}runOutsideAngular(e){return this._outer.run(e)}},Ks={};function qs(e){if(e._nesting==0&&!e.hasPendingMicrotasks&&!e.isStable)try{e._nesting++,e.onMicrotaskEmpty.emit(null)}finally{if(e._nesting--,!e.hasPendingMicrotasks)try{e.runOutsideAngular(()=>e.onStable.emit(null))}finally{e.isStable=!0}}}function Js(e){if(e.isCheckStableRunning||e.callbackScheduled)return;e.callbackScheduled=!0;function t(){Bs(()=>{e.callbackScheduled=!1,Xs(e),e.isCheckStableRunning=!0,qs(e),e.isCheckStableRunning=!1})}e.scheduleInRootZone?Zone.root.run(()=>{t()}):e._outer.run(()=>{t()}),Xs(e)}function Ys(e){let t=()=>{Js(e)},n=Ws++;e._inner=e._inner.fork({name:`angular`,properties:{[Hs]:!0,[Us]:n,[Us+n]:!0},onInvokeTask:(n,r,i,a,o,s)=>{if(ec(s))return n.invokeTask(i,a,o,s);try{return Zs(e),n.invokeTask(i,a,o,s)}finally{(e.shouldCoalesceEventChangeDetection&&a.type===`eventTask`||e.shouldCoalesceRunChangeDetection)&&t(),Qs(e)}},onInvoke:(n,r,i,a,o,s,c)=>{try{return Zs(e),n.invoke(i,a,o,s,c)}finally{e.shouldCoalesceRunChangeDetection&&!e.callbackScheduled&&!tc(s)&&t(),Qs(e)}},onHasTask:(t,n,r,i)=>{t.hasTask(r,i),n===r&&(i.change==`microTask`?(e._hasPendingMicrotasks=i.microTask,Xs(e),qs(e)):i.change==`macroTask`&&(e.hasPendingMacrotasks=i.macroTask))},onHandleError:(t,n,r,i)=>(t.handleError(r,i),e.runOutsideAngular(()=>e.onError.emit(i)),!1)})}function Xs(e){e.hasPendingMicrotasks=!!(e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&e.callbackScheduled===!0)}function Zs(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function Qs(e){e._nesting--,qs(e)}var $s=class{hasPendingMicrotasks=!1;hasPendingMacrotasks=!1;isStable=!0;onUnstable=new Rs;onMicrotaskEmpty=new Rs;onStable=new Rs;onError=new Rs;run(e,t,n){return e.apply(t,n)}runGuarded(e,t,n){return e.apply(t,n)}runOutsideAngular(e){return e()}runTask(e,t,n,r){return e.apply(t,n)}};function ec(e){return nc(e,`__ignore_ng_zone__`)}function tc(e){return nc(e,`__scheduler_tick__`)}function nc(e,t){return!Array.isArray(e)||e.length!==1?!1:e[0]?.data?.[t]===!0}var rc=class{_console=console;handleError(e){this._console.error(`ERROR`,e)}},ic=new Ii(``,{factory:()=>{let e=C(Gs),t=C(Xa),n;return r=>{e.runOutsideAngular(()=>{t.destroyed&&!n?setTimeout(()=>{throw r}):(n??=t.get(rc),n.handleError(r))})}}}),ac={provide:Aa,useValue:()=>{C(rc,{optional:!0})},multi:!0};function D(e,t){let[n,r,i]=Fn(e,t?.equal),a=n;return a[nn],a.set=r,a.update=i,a.asReadonly=oc.bind(a),a}function oc(){let e=this[nn];if(e.readonlyFn===void 0){let t=()=>this();t[nn]=e,e.readonlyFn=t}return e.readonlyFn}var sc=new Ii(``,{factory:()=>cc}),cc=`ng`,lc=new Ii(``),uc=new Ii(``,{providedIn:`platform`,factory:()=>`unknown`}),dc=new Ii(``,{factory:()=>C(Ms).body?.querySelector(`[ngCspNonce]`)?.getAttribute(`ngCspNonce`)||null}),fc=(()=>{class e{view;node;constructor(e,t){this.view=e,this.node=t}static __NG_ELEMENT_ID__=pc}return e})();function pc(){return new fc(qo(),Yo())}var mc=class{},hc=new Ii(``,{factory:()=>!0}),gc=new Ii(``),_c=(()=>{class e{static ɵprov=ki({token:e,providedIn:`root`,factory:()=>new vc})}return e})(),vc=class{dirtyEffectCount=0;queues=new Map;add(e){this.enqueue(e),this.schedule(e)}schedule(e){e.dirty&&this.dirtyEffectCount++}remove(e){let t=e.zone,n=this.queues.get(t);n.has(e)&&(n.delete(e),e.dirty&&this.dirtyEffectCount--)}enqueue(e){let t=e.zone;this.queues.has(t)||this.queues.set(t,new Set);let n=this.queues.get(t);n.has(e)||n.add(e)}flush(){for(;this.dirtyEffectCount>0;){let e=!1;for(let[t,n]of this.queues)e||=t===null?this.flushQueue(n):t.run(()=>this.flushQueue(n));e||(this.dirtyEffectCount=0)}}flushQueue(e){let t=!1;for(let n of e)n.dirty&&(this.dirtyEffectCount--,t=!0,n.run());return t}},yc=class{[nn];constructor(e){this[nn]=e}destroy(){this[nn].destroy()}};function bc(e,t){let n=t?.injector??C(js),r=t?.manualCleanup===!0?null:n.get(Ns),i,a=n.get(fc,null,{optional:!0}),o=n.get(mc);return a===null?i=Tc(e,n.get(_c),o):(i=wc(a.view,o,e),r instanceof Ps&&r._lView===a.view&&(r=null)),i.injector=n,r!==null&&(i.onDestroyFns=[r.onDestroy(()=>i.destroy())]),new yc(i)}var xc={...Vn,cleanupFns:void 0,zone:null,onDestroyFns:null,run(){let e=ns(!1);try{Hn(this)}finally{ns(e)}},cleanup(){if(!this.cleanupFns?.length)return;let e=rn(null);try{for(;this.cleanupFns.length;)this.cleanupFns.pop()()}finally{this.cleanupFns=[],rn(e)}}},Sc={...xc,consumerMarkedDirty(){this.scheduler.schedule(this),this.notifier.notify(12)},destroy(){if(yn(this),this.onDestroyFns!==null)for(let e of this.onDestroyFns)e();this.cleanup(),this.scheduler.remove(this)}},Cc={...xc,consumerMarkedDirty(){this.view[2]|=8192,Fo(this.view),this.notifier.notify(13)},destroy(){if(yn(this),this.onDestroyFns!==null)for(let e of this.onDestroyFns)e();this.cleanup(),this.view[23]?.delete(this)}};function wc(e,t,n){let r=Object.create(Cc);return r.view=e,r.zone=typeof Zone<`u`?Zone.current:null,r.notifier=t,r.fn=Ec(r,n),e[23]??=new Set,e[23].add(r),r.consumerMarkedDirty(r),r}function Tc(e,t,n){let r=Object.create(Sc);return r.fn=Ec(r,e),r.scheduler=t,r.notifier=n,r.zone=typeof Zone<`u`?Zone.current:null,r.scheduler.add(r),r.notifier.notify(12),r}function Ec(e,t){return()=>{t(t=>(e.cleanupFns??=[]).push(t))}}function Dc(e){return typeof e==`function`&&e[nn]!==void 0}function Oc(e){return Dc(e)&&typeof e.set==`function`}var kc=Symbol(`InputSignalNode#UNSET`),Ac={...zn,transformFn:void 0,applyValueToInputSignal(e,t){Ln(e,t)}};function jc(e){return{toString:e}.toString()}var Mc=(function(e){return e[e.TemplateCreateStart=0]=`TemplateCreateStart`,e[e.TemplateCreateEnd=1]=`TemplateCreateEnd`,e[e.TemplateUpdateStart=2]=`TemplateUpdateStart`,e[e.TemplateUpdateEnd=3]=`TemplateUpdateEnd`,e[e.LifecycleHookStart=4]=`LifecycleHookStart`,e[e.LifecycleHookEnd=5]=`LifecycleHookEnd`,e[e.OutputStart=6]=`OutputStart`,e[e.OutputEnd=7]=`OutputEnd`,e[e.BootstrapApplicationStart=8]=`BootstrapApplicationStart`,e[e.BootstrapApplicationEnd=9]=`BootstrapApplicationEnd`,e[e.BootstrapComponentStart=10]=`BootstrapComponentStart`,e[e.BootstrapComponentEnd=11]=`BootstrapComponentEnd`,e[e.ChangeDetectionStart=12]=`ChangeDetectionStart`,e[e.ChangeDetectionEnd=13]=`ChangeDetectionEnd`,e[e.ChangeDetectionSyncStart=14]=`ChangeDetectionSyncStart`,e[e.ChangeDetectionSyncEnd=15]=`ChangeDetectionSyncEnd`,e[e.AfterRenderHooksStart=16]=`AfterRenderHooksStart`,e[e.AfterRenderHooksEnd=17]=`AfterRenderHooksEnd`,e[e.ComponentStart=18]=`ComponentStart`,e[e.ComponentEnd=19]=`ComponentEnd`,e[e.DeferBlockStateStart=20]=`DeferBlockStateStart`,e[e.DeferBlockStateEnd=21]=`DeferBlockStateEnd`,e[e.DynamicComponentStart=22]=`DynamicComponentStart`,e[e.DynamicComponentEnd=23]=`DynamicComponentEnd`,e[e.HostBindingsUpdateStart=24]=`HostBindingsUpdateStart`,e[e.HostBindingsUpdateEnd=25]=`HostBindingsUpdateEnd`,e})(Mc||{}),Nc=class{previousValue;currentValue;firstChange;constructor(e,t,n){this.previousValue=e,this.currentValue=t,this.firstChange=n}isFirstChange(){return this.firstChange}};function Pc(e,t,n,r){t===null?e[n]=r:t.applyValueToInputSignal(t,r)}var Fc=null,Ic=(()=>{Fc=Rc;let e=()=>Rc;return e.ngInherit=!0,e})();function Lc(){return Fc}function Rc(e){return e.type.prototype.ngOnChanges&&(e.setInput=Bc),zc}function zc(){let e=Hc(this),t=e?.current;if(t){let n=e.previous;if(n===Oa)e.previous=t;else for(let e in t)n[e]=t[e];e.current=null,this.ngOnChanges(t)}}function Bc(e,t,n,r,i){let a=this.declaredInputs[r],o=Hc(e)||Uc(e,{previous:Oa,current:null}),s=o.current||={},c=o.previous,l=c[a];s[a]=new Nc(l&&l.currentValue,n,c===Oa),Pc(e,t,i,n)}var Vc=`__ngSimpleChanges__`;function Hc(e){return Object.hasOwn(e,Vc)&&e[Vc]||null}function Uc(e,t){return e[Vc]=t}var Wc=[],Gc=function(e,t=null,n){for(let r=0;r=r)break}else t[c]<0&&(e[17]+=65536),(s>14>16&&(e[2]&3)===t&&(e[2]+=16384,Qc(o,a)):Qc(o,a)}var el=-1,tl=class{factory;name;injectImpl;resolving=!1;canSeeViewProviders;multi;componentProviders;index;providerFactory;constructor(e,t,n,r){this.factory=e,this.name=r,this.canSeeViewProviders=t,this.injectImpl=n}};function nl(e){return!!(e.flags&8)}function rl(e){return!!(e.flags&16)}function il(e,t,n){let r=0;for(;rt){o=a-1;break}}}for(;a>16}function fl(e,t){let n=dl(e),r=t;for(;n>0;)r=r[14],n--;return r}var pl=!0;function ml(e){let t=pl;return pl=e,t}var hl=255,gl=5,_l=0,vl={};function yl(e,t,n){let r;typeof n==`string`?r=n.charCodeAt(0)||0:Object.hasOwn(n,Hi)&&(r=n[Hi]),r??=n[Hi]=_l++;let i=r&hl,a=1<>gl)]|=a}function bl(e,t){let n=Sl(e,t);if(n!==-1)return n;let r=t[1];r.firstCreatePass&&(e.injectorIndex=t.length,xl(r.data,e),xl(t,null),xl(r.blueprint,null));let i=Cl(e,t),a=e.injectorIndex;if(ll(i)){let e=ul(i),n=fl(i,t),r=n[1].data;for(let i=0;i<8;i++)t[a+i]=n[e+i]|r[e+i]}return t[a+8]=i,a}function xl(e,t){e.push(0,0,0,0,0,0,0,0,t)}function Sl(e,t){return e.injectorIndex===-1||e.parent&&e.parent.injectorIndex===e.injectorIndex||t[e.injectorIndex+8]===null?-1:e.injectorIndex}function Cl(e,t){if(e.parent&&e.parent.injectorIndex!==-1)return e.parent.injectorIndex;let n=0,r=null,i=t;for(;i!==null;){if(r=Bl(i),r===null)return el;if(n++,i=i[14],r.injectorIndex!==-1)return r.injectorIndex|n<<16}return el}function wl(e,t,n){yl(e,t,n)}function Tl(e,t,n){if(n&8||e!==void 0)return e;$i(t,`NodeInjector`)}function El(e,t,n,r){if(n&8&&r===void 0&&(r=null),!(n&3)){let i=e[9],a=ia(void 0);try{return i?i.get(t,r,n&8):aa(t,r,n&8)}finally{ia(a)}}return Tl(r,t,n)}function Dl(e,t,n,r=0,i){if(e!==null){if(t[2]&2048&&!(r&2)){let i=zl(e,t,n,r,vl);if(i!==vl)return i}let i=Ol(e,t,n,r,vl);if(i!==vl)return i}return El(t,n,r,i)}function Ol(e,t,n,r,i){let a=Ml(n);if(typeof a==`function`){if(!fs(t,e,r))return r&1?Tl(i,n,r):El(t,n,r,i);try{let e;if(e=a(r),e==null&&!(r&8))$i(n);else return e}finally{_s()}}else if(typeof a==`number`){let i=null,o=Sl(e,t),s=el,c=r&1?t[15][5]:null;for((o===-1||r&4)&&(s=o===-1?Cl(e,t):t[o+8],s===el||!Pl(r,!1)?o=-1:(i=t[1],o=ul(s),t=fl(s,t)));o!==-1;){let e=t[1];if(Nl(a,o,e.data)){let e=kl(o,t,n,i,r,c);if(e!==vl)return e}s=t[o+8],s!==el&&Pl(r,t[1].data[o+8]===c)&&Nl(a,o,t)?(i=e,o=ul(s),t=fl(s,t)):o=-1}}return i}function kl(e,t,n,r,i,a){let o=t[1],s=o.data[e+8],c=Al(s,o,n,r==null?ho(s)&&pl:r!=o&&!!(s.type&3),i&1&&a===s);return c===null?vl:jl(t,o,c,s,i)}function Al(e,t,n,r,i){let a=e.providerIndexes,o=t.data,s=a&1048575,c=e.directiveStart,l=e.directiveEnd,u=a>>20,d=r?s:s+u,f=i?s+u:l;for(let e=d;e=c&&t.type===n)return e}if(i){let e=o[c];if(e&&_o(e)&&e.type===n)return c}return null}function jl(e,t,n,r,i){let a=e[n],o=t.data;if(a instanceof tl){let s=a;if(s.resolving)throw Qi(``);let c=ml(s.canSeeViewProviders);s.resolving=!0,o[n].type||o[n];let l=s.injectImpl?ia(s.injectImpl):null;fs(e,r,0);try{a=e[n]=s.factory(void 0,i,o,e,r),t.firstCreatePass&&n>=r.directiveStart&&Kc(n,o[n],t)}finally{l!==null&&ia(l),ml(c),s.resolving=!1,_s()}}return a}function Ml(e){if(typeof e==`string`)return e.charCodeAt(0)||0;let t=Object.hasOwn(e,Hi)?e[Hi]:void 0;return typeof t==`number`?t>=0?t&hl:Il:t}function Nl(e,t,n){let r=1<>gl)]&r)}function Pl(e,t){return!(e&2)&&!(e&1&&t)}var Fl=class{_tNode;_lView;constructor(e,t){this._tNode=e,this._lView=t}get(e,t,n){return Dl(this._tNode,this._lView,e,fa(n),t)}};function Il(){return new Fl(Yo(),qo())}function Ll(e){return jc(()=>{let t=e.prototype.constructor,n=t[Vi]||Rl(t),r=Object.prototype,i=Object.getPrototypeOf(e.prototype).constructor;for(;i&&i!==r;){let e=i[Vi]||Rl(i);if(e&&e!==n)return e;i=Object.getPrototypeOf(i)}return e=>new e})}function Rl(e){return Oi(e)?()=>{let t=Rl(Di(e));return t&&t()}:ga(e)}function zl(e,t,n,r,i){let a=e,o=t;for(;a!==null&&o!==null&&o[2]&2048&&!vo(o);){let e=Ol(a,o,n,r|2,vl);if(e!==vl)return e;r&=-5;let t=a.parent;if(!t){let e=o[20];if(e){let t=e.get(n,vl,r);if(t!==vl)return t}t=Bl(o),o=o[14]}a=t}return i}function Bl(e){let t=e[1],n=t.type;return n===2?t.declTNode:n===1?e[5]:null}function Vl(e){return{token:e.token,providedIn:e.autoProvided===!1?null:`root`,factory:e.factory,value:void 0}}function Hl(){return Ul(Yo(),qo())}function Ul(e,t){return new Wl(wo(e,t))}var Wl=(()=>{class e{nativeElement;constructor(e){this.nativeElement=e}static __NG_ELEMENT_ID__=Hl}return e})();function Gl(e){return e instanceof Wl?e.nativeElement:e}function Kl(){return this._results[Symbol.iterator]()}var ql=class{_emitDistinctChangesOnly;dirty=!0;_onDirty=void 0;_results=[];_changesDetected=!1;_changes=void 0;length=0;first=void 0;last=void 0;get changes(){return this._changes??=new Yr}constructor(e=!1){this._emitDistinctChangesOnly=e}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){this.dirty=!1;let n=va(e);(this._changesDetected=!_a(this._results,n,t))&&(this._results=n,this.length=n.length,this.last=n[this.length-1],this.first=n[0])}notifyOnChanges(){this._changes!==void 0&&(this._changesDetected||!this._emitDistinctChangesOnly)&&this._changes.next(this)}onDirty(e){this._onDirty=e}setDirty(){this.dirty=!0,this._onDirty?.()}destroy(){this._changes!==void 0&&(this._changes.complete(),this._changes.unsubscribe())}[Symbol.iterator]=Kl};function Jl(e){return(e.flags&128)==128}var Yl=(function(e){return e[e.OnPush=0]=`OnPush`,e[e.Eager=1]=`Eager`,e[e.Default=1]=`Default`,e})(Yl||{}),Xl=new Map,Zl=0;function Ql(){return Zl++}function $l(e){Xl.set(e[19],e)}function eu(e){Xl.delete(e[19])}var tu=`__ngContext__`;function nu(e,t){fo(t)?(e[tu]=t[19],$l(t)):e[tu]=t}function ru(e){return au(e[12])}function iu(e){return au(e[4])}function au(e){for(;e!==null&&!po(e);)e=e[4];return e}var ou=void 0;function su(e){ou=e}function cu(){if(ou!==void 0)return ou;if(typeof document<`u`)return document;throw new vi(210,!1)}var lu=!1,uu=new Ii(``,{factory:()=>lu}),du=new WeakMap;function fu(e,t){if(typeof e!=`object`||!e)return;let n=du.get(e);n||(n=new WeakSet,du.set(e,n)),n.add(t)}function pu(e){return(e.flags&32)==32}var mu=()=>null;function hu(e,t,n=!1){return mu(e,t,n)}function gu(e,t){let n=e.contentQueries;if(n!==null){let r=rn(null);try{for(let r=0;r|^->||--!>|)/g,Jee=`​$1​`;function Yee(e){return e.replace(Kee,e=>e.replace(qee,Jee))}function Xee(e,t){return e.createText(t)}function Zee(e,t,n){e.setValue(t,n)}function Qee(e,t){return e.createComment(Yee(t))}function wu(e,t,n){return e.createElement(t,n)}function Tu(e,t,n,r,i){e.insertBefore(t,n,r,i)}function Eu(e,t,n){e.appendChild(t,n)}function Du(e,t,n,r,i){r===null?Eu(e,t,n):Tu(e,t,n,r,i)}function Ou(e,t,n,r){e.removeChild(null,t,n,r)}function $ee(e,t,n){e.setAttribute(t,`style`,n)}function ete(e,t,n){n===``?e.removeAttribute(t,`class`):e.setAttribute(t,`class`,n)}function ku(e,t,n){let{mergedAttrs:r,classes:i,styles:a}=n;r!==null&&il(e,t,r),i!==null&&ete(e,t,i),a!==null&&$ee(e,t,a)}function Au(e){let t=tte();return t?t.sanitize(bo.URL,e)||``:Su(e,`URL`)?xu(e):Gee(Ji(e))}function tte(){let e=qo();return e&&e[10].sanitizer}function ju(e){return e.ownerDocument.defaultView}function Mu(e){return e.ownerDocument}function nte(e,t,n){let r=e.length;for(;;){let i=e.indexOf(t,n);if(i===-1)return i;if(i===0||e.charCodeAt(i-1)<=32){let n=t.length;if(i+n===r||e.charCodeAt(i+n)<=32)return i}n=i+1}}var Nu=`ng-template`;function rte(e,t,n,r){let i=0;if(r){for(;i-1){let e;for(;++ia?``:i[u+1].toLowerCase(),r&2&&l!==e){if(Fu(r))return!1;o=!0}}}}}return Fu(r)||o}function Fu(e){return!(e&1)}function ote(e,t,n,r){if(t===null)return-1;let i=0;if(r||!n){let n=!1;for(;i-1)for(n++;n0?`="`+t+`"`:``)+`]`}else r&8?i+=`.`+o:r&4&&(i+=` `+o)}else i!==``&&!Fu(o)&&(t+=Lu(a,i),i=``),r=o,a||=!Fu(r);n++}return i!==``&&(t+=Lu(a,i)),t}function fte(e){return e.map(dte).join(`,`)}function pte(e){let t=[],n=[],r=1,i=2;for(;r!1});function Vu(e){if(!e)return 0;let t=e.toLowerCase().indexOf(`ms`)>-1?1:1e3;return parseFloat(e)*t}function Hu(e,t){return e.getPropertyValue(t).split(`,`).map(e=>e.trim())}function gte(e){let t=Hu(e,`transition-property`),n=Hu(e,`transition-duration`),r=Hu(e,`transition-delay`),i={propertyName:``,duration:0,animationName:void 0};for(let e=0;ei.duration&&(i.propertyName=t[e],i.duration=a)}return i}function _te(e){let t=Hu(e,`animation-name`),n=Hu(e,`animation-delay`),r=Hu(e,`animation-duration`),i=Hu(e,`animation-iteration-count`),a={animationName:``,propertyName:void 0,duration:0};for(let e=0;ea.duration&&s!==`infinite`&&(a.animationName=t[e],a.duration=o)}return a}function Uu(e,t){return e!==void 0&&e.duration>t.duration}function Wu(e){return(e.animationName!=null||e.propertyName!=null)&&e.duration>0}function Gu(e){let t=e.effect?.getTiming();if(t===void 0)return;let n=typeof t.duration==`number`?t.duration:0,r=(t.delay??0)+n,i=e.playbackRate;return i!==void 0&&i!==0&&i!==1&&(r/=Math.abs(i)),r}function vte(e,t){let n=getComputedStyle(e),r=_te(n),i=gte(n),a=r.duration>i.duration?r:i;Uu(t.get(e),a)||Wu(a)&&t.set(e,a)}function yte(e,t,n){if(!n)return;let r=e.getAnimations();return r.length===0?vte(e,t):bte(e,t,r)}function bte(e,t,n){let r={animationName:void 0,propertyName:void 0,duration:0};for(let e of n){if(e.effect?.getTiming()?.iterations===1/0)continue;let t=Gu(e)??0,n,i;e.animationName?i=e.animationName:n=e.transitionProperty,t>=r.duration&&(r={animationName:i,propertyName:n,duration:t})}Uu(t.get(e),r)||Wu(r)&&t.set(e,r)}var Ku=new Set,xte=!1,Ste=1,qu=typeof document<`u`&&typeof document?.documentElement?.getAnimations==`function`;function Cte(e){return e[9].get(hte,xte)}function wte(e,t,n){let r=Yu.get(e);if(r){for(let e of t)r.classList.push(e);for(let e of n)r.cleanupFns.push(e)}else Yu.set(e,{classList:t,cleanupFns:n})}function Ju(e){let t=Yu.get(e);if(t){for(let e of t.cleanupFns)e();Yu.delete(e)}Xu.delete(e)}var Yu=new WeakMap,Xu=new WeakMap,Zu=new WeakMap;function Qu(e){return e?e[14]??e:null}var $u=new WeakSet;function Tte(e,t,n){let r=Zu.get(e);if(!r||r.length===0)return;let i=t.parentNode,a=t.previousSibling,o=Qu(n);for(let e=r.length-1;e>=0;e--){let{el:n,declarationView:s}=r[e],c=n.parentNode;n===t?(r.splice(e,1),$u.add(n),n.dispatchEvent(new CustomEvent(`animationend`,{detail:{cancel:!0}}))):(a&&n===a||c&&i&&c!==i&&(o===null||s===null||o===s))&&(r.splice(e,1),n.dispatchEvent(new CustomEvent(`animationend`,{detail:{cancel:!0}})),n.parentNode?.removeChild(n))}}function Ete(e,t,n){let r=Qu(n),i=Zu.get(e);i?i.some(e=>e.el===t)||i.push({el:t,declarationView:r}):Zu.set(e,[{el:t,declarationView:r}])}function ed(e){let t=e[26]??={};return t.enter??=new Map}function Dte(e){let t=typeof e==`function`?e():e,n=Array.isArray(t)?t:null;return typeof t==`string`&&(n=t.trim().split(/\s+/).filter(e=>e)),n}function td(e){return e.composedPath?e.composedPath()[0]:e.target}function nd(e,t){let n=Xu.get(t);if(n===void 0)return!0;if(t!==td(e))return!1;let r=e.animation;if(r){let e=Gu(r);if(e!==void 0&&e+Ste{class e{impl=null;execute(){this.impl?.execute()}static ɵprov=ki({token:e,providedIn:`root`,factory:()=>new e})}return e})(),cd=[0,1,2,3],ld=(()=>{class e{ngZone=C(Gs);scheduler=C(mc);errorHandler=C(rc,{optional:!0});sequences=new Set;deferredRegistrations=new Set;executing=!1;constructor(){C(id,{optional:!0})}execute(){let e=this.sequences.size>0;e&&Gc(Mc.AfterRenderHooksStart),this.executing=!0;for(let e of cd)for(let t of this.sequences)if(!t.erroredOrDestroyed&&t.hooks[e])try{t.pipelinedValue=this.ngZone.runOutsideAngular(()=>this.maybeTrace(()=>{let n=t.hooks[e];return n(t.pipelinedValue)},t.snapshot))}catch(e){t.erroredOrDestroyed=!0,this.errorHandler?.handleError(e)}this.executing=!1;for(let e of this.sequences)e.afterRun(),e.once&&(this.sequences.delete(e),e.destroy());for(let e of this.deferredRegistrations)this.sequences.add(e);this.deferredRegistrations.size>0&&this.scheduler.notify(7),this.deferredRegistrations.clear(),e&&Gc(Mc.AfterRenderHooksEnd)}register(e){let{view:t}=e;t===void 0?this.executing?this.deferredRegistrations.add(e):this.addSequence(e):((t[25]??=[]).push(e),Fo(t),t[2]|=8192)}addSequence(e){this.sequences.add(e),this.scheduler.notify(7)}unregister(e){this.executing&&this.sequences.has(e)?(e.erroredOrDestroyed=!0,e.pipelinedValue=void 0,e.once=!0):(this.sequences.delete(e),this.deferredRegistrations.delete(e))}maybeTrace(e,t){return t?t.run(rd.AFTER_NEXT_RENDER,e):e()}static ɵprov=ki({token:e,providedIn:`root`,factory:()=>new e})}return e})(),ud=class{impl;hooks;view;once;snapshot;erroredOrDestroyed=!1;pipelinedValue=void 0;unregisterOnDestroy;constructor(e,t,n,r,i,a=null){this.impl=e,this.hooks=t,this.view=n,this.once=r,this.snapshot=a,this.unregisterOnDestroy=i?.onDestroy(()=>this.destroy())}afterRun(){this.erroredOrDestroyed=!1,this.pipelinedValue=void 0,this.snapshot?.dispose(),this.snapshot=null}destroy(){this.impl.unregister(this),this.unregisterOnDestroy?.();let e=this.view?.[25];e&&(this.view[25]=e.filter(e=>e!==this))}};function dd(e,t){let n=t?.injector??C(js);return od(`NgAfterNextRender`),Ate(e,n,t,!0)}function kte(e){return e instanceof Function?[void 0,void 0,e,void 0]:[e.earlyRead,e.write,e.mixedReadWrite,e.read]}function Ate(e,t,n,r){let i=t.get(sd);i.impl??=t.get(ld);let a=t.get(id,null,{optional:!0}),o=n?.manualCleanup===!0?null:t.get(Ns),s=t.get(fc,null,{optional:!0}),c=new ud(i.impl,kte(e),s?.view,r,o,a?.snapshot(null));return i.impl.register(c),c}var fd=new Ii(``,{factory:()=>{let e=C(Xa),t=new Set;return e.onDestroy(()=>t.clear()),{queue:t,isScheduled:!1,scheduler:null,injector:e}}});function pd(e,t,n){let r=e.get(fd);if(Array.isArray(t))for(let e of t)r.queue.add(e),n?.detachedLeaveAnimationFns?.push(e);else r.queue.add(t),n?.detachedLeaveAnimationFns?.push(t);r.scheduler&&r.scheduler(e)}function jte(e,t){let n=e.get(fd);if(Array.isArray(t))for(let e of t)n.queue.delete(e);else n.queue.delete(t)}function Mte(e,t){let n=e.get(fd);if(t.detachedLeaveAnimationFns){for(let e of t.detachedLeaveAnimationFns)n.queue.delete(e);t.detachedLeaveAnimationFns=void 0}}function md(e){let t=e.get(fd);t.isScheduled||=(dd(()=>{t.isScheduled=!1;for(let e of t.queue)e();t.queue.clear()},{injector:t.injector}),!0)}function hd(e){let t=e.get(fd);t.scheduler=md,t.scheduler(e)}function gd(e,t){for(let[n,r]of t)pd(e,r.animateFns)}function _d(e,t,n,r){let i=e?.[26]?.enter;t!==null&&i&&i.has(n.index)&&gd(r,i)}function vd(e,t,n,r){try{n.get(ja)}catch{return r(!1)}let i=e?.[26];i?.enter?.has(t.index)&&jte(n,i.enter.get(t.index).animateFns);let a=yd(e,t,i);if(a.size===0){let n=!1;if(e){let r=[];xd(e,t,r),n=r.length>0}if(!n)return r(!1)}e&&Ku.add(e[19]),pd(n,()=>bd(e,t,i||void 0,a,r),i||void 0)}function yd(e,t,n){let r=new Map,i=n?.leave;if(i&&i.has(t.index)&&r.set(t.index,i.get(t.index)),e&&i)for(let[n,a]of i){if(r.has(n))continue;let i=e[1].data[n].parent;for(;i;){if(i===t){r.set(n,a);break}i=i.parent}}return r}function bd(e,t,n,r,i){let a=[];if(n&&n.leave)for(let[e]of r){if(!n.leave.has(e))continue;let t=n.leave.get(e);for(let e of t.animateFns){let{promise:t}=e();a.push(t)}n.detachedLeaveAnimationFns=void 0}if(e&&xd(e,t,a),a.length>0){let t=n||e?.[26];if(t){let n=t.running;n&&a.push(n),t.running=Promise.allSettled(a),Cd(e,t.running,i)}else Promise.allSettled(a).then(()=>{e&&Ku.delete(e[19]),i(!0)})}else e&&Ku.delete(e[19]),i(!1)}function xd(e,t,n){if(t.type&12){let r=e[t.index];if(po(r))for(let e=10;e{e[26]?.running===t&&(e[26].running=void 0,Ku.delete(e[19])),n(!0)})}function wd(e,t,n,r,i,a,o,s){if(i!=null){let c,l=!1;po(i)?c=i:fo(i)&&(l=!0,i=i[0]);let u=So(i);e===0&&r!==null?(_d(s,r,a,n),o==null?Eu(t,r,u):Tu(t,r,u,o||null,!0)):e===1&&r!==null?(_d(s,r,a,n),Tu(t,r,u,o||null,!0),Tte(a,u,s)):e===2?(s?.[26]?.leave?.has(a.index)&&Ete(a,u,s),$u.delete(u),vd(s,a,n,e=>{if($u.has(u)){$u.delete(u);return}Ou(t,u,l,e)})):e===3&&($u.delete(u),vd(s,a,n,()=>{t.destroyNode(u)})),c!=null&&Jd(t,e,n,c,a,r,o)}}function Td(e,t){Dd(e,t),t[0]=null,t[5]=null}function Ed(e,t,n,r,i,a){r[0]=i,r[5]=t,Wd(e,r,n,1,i,a)}function Dd(e,t){t[10].changeDetectionScheduler?.notify(9),Wd(e,t,t[11],2,null,null)}function Od(e){let t=e[12];if(!t)return jd(e[1],e);for(;t;){let n=null;if(fo(t))n=t[12];else{let e=t[10];e&&(n=e)}if(!n){for(;t&&!t[4]&&t!==e;)fo(t)&&jd(t[1],t),t=t[3];t===null&&(t=e),fo(t)&&jd(t[1],t),n=t&&t[4]}t=n}}function kd(e,t){let n=e[9],r=n.indexOf(t);n.splice(r,1)}function Ad(e,t){if(yo(t))return;let n=t[11];n.destroyNode&&Wd(e,t,n,3,null,null),Od(t)}function jd(e,t){if(yo(t))return;let n=rn(null);try{t[2]&=-129,t[2]|=256,t[24]&&yn(t[24]),Nd(e,t),Md(e,t),t[1].type===1&&t[11].destroy();let n=t[16];if(n!==null&&po(t[3])){n!==t[3]&&kd(n,t);let r=t[18];r!==null&&r.detachView(e)}eu(t)}finally{rn(n)}}function Md(e,t){let n=e.cleanup,r=t[7];if(n!==null)for(let e=0;e=0?r[t]():r[-t].unsubscribe(),e+=2}else{let t=r[n[e+1]];n[e].call(t)}r!==null&&(t[7]=null);let i=t[21];if(i!==null){t[21]=null;for(let e=0;e27&&af(e,t,27,!1),Gc(o?Mc.TemplateUpdateStart:Mc.TemplateCreateStart,i,n),n(r,i)}finally{xs(a),Gc(o?Mc.TemplateUpdateEnd:Mc.TemplateCreateEnd,i,n)}}function lf(e,t,n){gf(e,t,n),(n.flags&64)==64&&_f(e,t,n)}function uf(e,t,n=wo){let r=t.localNames;if(r!==null){let i=t.index+1;for(let a=0;a=s&&i<=c){let o=t.data[i],s=r[e+1];sf(o,n[i],s,a),l=!0}else if(i>c)break}}return o!==null&&Object.hasOwn(r.inputs,i)&&(sf(r,n[o],i,a),l=!0),l}function Of(e,t){let n=Oo(t,e),r=n[1];kf(r,n);let i=n[0];i!==null&&n[6]===null&&(n[6]=hu(i,n[9])),Gc(Mc.ComponentStart);try{Af(r,n,n[8])}finally{Gc(Mc.ComponentEnd,n[8])}}function kf(e,t){for(let n=t.length;n{Fo(e.lView)},consumerOnSignalRead(){this.lView[24]=this}};function Hf(e){let t=e[24]??Object.create(Uf);return t.lView=e,t}var Uf={...on,consumerIsAlwaysLive:!0,kind:`template`,consumerMarkedDirty:e=>{let t=Lo(e.lView);for(;t&&!Wf(t[1]);)t=Lo(t);t&&Mo(t)},consumerOnSignalRead(){this.lView[24]=this}};function Wf(e){return e.type!==2}function Gf(e){if(e[23]===null)return;let t=!0;for(;t;){let n=!1;for(let t of e[23])if(t.dirty&&(n=!0,t.zone===null||Zone.current===t.zone?t.run():t.zone.run(()=>t.run()),e[23]===null))return;t=n&&!!(e[2]&8192)}}var Kf=100;function qf(e,t=0){let n=e[10].rendererFactory;n.begin?.();try{Jf(e,t)}finally{n.end?.()}}function Jf(e,t){let n=ts();try{ns(!0),ep(e,t);let n=0;for(;No(e);){if(n===Kf)throw new vi(103,!1);n++,ep(e,1)}}finally{ns(n)}}function Yf(e,t,n,r){if(yo(t))return;let i=t[2];ps(t);let a=!0,o=null,s=null;Wf(e)?(s=Rf(t),o=mn(s)):an()===null?(a=!1,s=Hf(t),o=mn(s)):t[24]&&=(yn(t[24]),null);try{jo(t),Bee(e.bindingStartIndex),n!==null&&cf(e,t,n,2,r);let a=(i&3)==3;if(a){let n=e.preOrderCheckHooks;n!==null&&Jc(t,n,null)}else{let n=e.preOrderHooks;n!==null&&Yc(t,n,0,null),Xc(t,0)}if(Zf(t),Gf(t),Xf(t,0),e.contentQueries!==null&&gu(e,t),a){let n=e.contentCheckHooks;n!==null&&Jc(t,n)}else{let n=e.contentHooks;n!==null&&Yc(t,n,1),Xc(t,1)}np(e,t);let o=e.components;o!==null&&tp(t,o,0);let s=e.viewQuery;if(s!==null&&_u(2,s,r),a){let n=e.viewCheckHooks;n!==null&&Jc(t,n)}else{let n=e.viewHooks;n!==null&&Yc(t,n,2),Xc(t,2)}if(e.firstUpdatePass===!0&&(e.firstUpdatePass=!1),t[22]){for(let e of t[22])e();t[22]=null}If(t),t[2]&=-73}catch(e){throw Fo(t),e}finally{s!==null&&(gn(s,o),a&&Bf(s)),vs()}}function Xf(e,t){for(let n=ru(e);n!==null;n=iu(n))for(let e=10;e0&&(e[n-1][4]=r[4]);let a=xa(e,10+t);Td(r[1],r);let o=a[18];o!==null&&o.detachView(a[1]),r[3]=null,r[4]=null,r[2]&=-129}return r}function lp(e,t,n,r){let i=10+r,a=n.length;r>0&&(n[i-1][4]=t),r-1&&(cp(e,n),xa(t,n))}this._attachedToViewContainer=!1}Ad(this._lView[1],this._lView)}onDestroy(e){Io(this._lView,e)}markForCheck(){rp(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[2]&=-129}reattach(){Po(this._lView),this._lView[2]|=128}detectChanges(){this._lView[2]|=1024,qf(this._lView)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new vi(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;let e=vo(this._lView),t=this._lView[16];t!==null&&!e&&kd(t,this._lView),Dd(this._lView[1],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new vi(902,!1);this._appRef=e;let t=vo(this._lView),n=this._lView[16];n!==null&&!t&&up(n,this._lView),Po(this._lView)}},fp=(()=>{class e{_declarationLView;_declarationTContainer;elementRef;static __NG_ELEMENT_ID__=pp;constructor(e,t,n){this._declarationLView=e,this._declarationTContainer=t,this.elementRef=n}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(e,t){return this.createEmbeddedViewImpl(e,t)}createEmbeddedViewImpl(e,t,n){return new dp(Mf(this._declarationLView,this._declarationTContainer,e,{embeddedViewInjector:t,dehydratedView:n}))}}return e})();function pp(){return mp(Yo(),qo())}function mp(e,t){return e.type&4?new fp(t,e,Ul(e,t)):null}function hp(e,t,n,r,i){let a=e.data[t];if(a===null)a=gp(e,t,n,r,i),Vee()&&(a.flags|=32);else if(a.type&64){a.type=n,a.value=r,a.attrs=i;let e=zee();a.injectorIndex=e===null?-1:e.injectorIndex}return Zo(a,!0),a}function gp(e,t,n,r,i){let a=Xo(),o=Qo(),s=o?a:a&&a.parent,c=e.data[t]=vp(e,s,n,t,r,i);return _p(e,c,a,o),c}function _p(e,t,n,r){e.firstChild===null&&(e.firstChild=t),n!==null&&(r?n.child==null&&t.parent!==null&&(n.child=t):n.next===null&&(n.next=t,t.prev=n))}function vp(e,t,n,r,i,a){let o=t?t.injectorIndex:-1,s=0;return Wo()&&(s|=128),{type:n,index:r,insertBeforeIndex:null,injectorIndex:o,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,controlDirectiveIndex:-1,customControlIndex:-1,propertyBindings:null,flags:s,providerIndexes:0,value:i,namespace:Ts(),attrs:a,mergedAttrs:null,localNames:null,initialInputs:null,inputs:null,hostDirectiveInputs:null,outputs:null,hostDirectiveOutputs:null,directiveToIndex:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:t,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}function yp(e){let t=e[6]??[],n=e[3][11],r=[];for(let e of t)e.data.di===void 0?bp(e,n):r.push(e);e[6]=r}function bp(e,t){let n=0,r=e.firstChild;if(r){let i=e.data.r;for(;nnull,Sp=()=>null;function Cp(e,t){return xp(e,t)}function wp(e,t,n){return Sp(e,t,n)}var Tp=class{},Ep=class{},Dp=class{destroyNode=null;static __NG_ELEMENT_ID__=()=>Op()};function Op(){let e=qo(),t=Oo(Yo().index,e);return(fo(t)?t:e)[11]}var kp=(()=>{class e{static ɵprov=ki({token:e,providedIn:`root`,factory:()=>null})}return e})();function Ap(e){return e.debugInfo?.className||e.type.name||null}var jp={},Mp=class{injector;parentInjector;constructor(e,t){this.injector=e,this.parentInjector=t}get(e,t,n){let r=this.injector.get(e,jp,n);return r!==jp||t===jp?r:this.parentInjector.get(e,t,n)}};function Np(e,t,n){return e[t]=n}function Pp(e,t){return e[t]}function Fp(e,t,n){if(n===Ru)return!1;let r=e[t];return!Object.is(r,n)&&(e[t]=n,!0)}function Ip(e,t,n,r){let i=Fp(e,t,n);return Fp(e,t+1,r)||i}function Lp(e,t,n,r,i){let a=Ip(e,t,n,r);return Fp(e,t+2,i)||a}function Rp(e,t,n,r,i,a){let o=Ip(e,t,n,r);return Ip(e,t+2,i,a)||o}function zp(e,t,n){return function r(i){let a=r.__ngNativeEl__;a!==void 0&&fu(i,a),rp(ho(e)?Oo(e.index,t):t,5);let o=t[8],s=Bp(t,o,n,i),c=r.__ngNextListenerFn__;for(;c;)s=Bp(t,o,c,i)&&s,c=c.__ngNextListenerFn__;return s}}function Bp(e,t,n,r){let i=rn(null);try{return Gc(Mc.OutputStart,t,n),n(r)!==!1}catch(t){return Tf(e,t),!1}finally{Gc(Mc.OutputEnd,t,n),rn(i)}}function Vp(e,t,n,r,i,a,o,s){let c=go(e),l=!1,u=null;if(!r&&c&&(u=Up(t,n,a,e.index)),u!==null){let e=u.__ngLastListenerFn__||u;e.__ngNextListenerFn__=o,u.__ngLastListenerFn__=o,l=!0}else{let o=wo(e,n),c=r?r(o):o;r||(s.__ngNativeEl__=o);let l=i.listen(c,a,s);Hp(a)||Wp(r?t=>r(So(t[e.index])):e.index,t,n,a,s,l,!1)}return l}function Hp(e){return e.startsWith(`animation`)||e.startsWith(`transition`)}function Up(e,t,n,r){let i=e.cleanup;if(i!=null)for(let e=0;er?n[r]:null}typeof a==`string`&&(e+=2)}return null}function Wp(e,t,n,r,i,a,o){let s=t.firstCreatePass?zo(t):null,c=Ro(n),l=c.length;c.push(i,a),s&&s.push(r,e,l,(l+1)*(o?-1:1))}function Gp(e,t,n,r,i){let a=null,o=null,s=null,c=!1,l=e.directiveToIndex.get(n.type);if(typeof l==`number`?a=l:[a,o,s]=l,o!==null&&s!==null&&e.hostDirectiveOutputs&&Object.hasOwn(e.hostDirectiveOutputs,r)){let n=e.hostDirectiveOutputs[r];for(let a=0;a=o&&l<=s)c=!0,Kp(e,t,l,n[a+1],r,i);else if(l>s)break}}return Object.hasOwn(n.outputs,r)&&(c=!0,Kp(e,t,a,r,r,i)),c}function Kp(e,t,n,r,i,a){let o=t[n],s=t[1],c=o[s.data[n].outputs[r]].subscribe(a);Wp(e.index,s,t,i,a,c,!0)}function qp(){Jp()}function Jp(){let e=qo(),t=Jo(),n=Yo();if(t.firstCreatePass&&em(t,n),n.controlDirectiveIndex===-1)return;od(`NgSignalForms`);let r=e[n.controlDirectiveIndex];t.data[n.controlDirectiveIndex].controlDef.create(r,new Zp(e,t,n))}function Yp(){Xp()}function Xp(){let e=qo(),t=Jo(),n=Ss();if(n.controlDirectiveIndex===-1)return;let r=t.data[n.controlDirectiveIndex].controlDef,i=e[n.controlDirectiveIndex];r.update(i,new Zp(e,t,n))}var Zp=class{lView;tView;tNode;hasPassThrough;constructor(e,t,n){this.lView=e,this.tView=t,this.tNode=n,this.hasPassThrough=!!(n.flags&4096)}get customControl(){return this.tNode.customControlIndex===-1?void 0:this.lView[this.tNode.customControlIndex]}get nativeElement(){return wo(this.tNode,this.lView)}get descriptor(){return`<${this.tNode.value}>`}listenToCustomControlOutput(e,t){let n=this.tView.data[this.tNode.customControlIndex];Gp(this.tNode,this.lView,n,e,zp(this.tNode,this.lView,t))}listenToCustomControlModel(e){let t=this.tNode.flags&1024?`valueChange`:`checkedChange`,n=this.tView.data[this.tNode.customControlIndex];Gp(this.tNode,this.lView,n,t,zp(this.tNode,this.lView,e))}listenToDom(e,t){Vp(this.tNode,this.tView,this.lView,void 0,this.lView[11],e,t,zp(this.tNode,this.lView,t))}setInputOnDirectives(e,t,n){let r=this.tNode.inputs?.[e],i=this.tNode.hostDirectiveInputs?.[e];if(!r&&!i)return!1;let a=!1;if(r)for(let i of r){if(i===this.tNode.controlDirectiveIndex)continue;let r=this.lView[i],o=this.tView.data[i];(!n||n($p(r,o,e)))&&(sf(o,r,e,t),a=!0)}if(i)for(let r=0;r0;){let e=n.shift();if(typeof e!=`function`){for(let n in e.inputs)t[e.inputs[n]]=!0;let r=Qp(e.directive);r!==null&&n.push(...r);continue}for(let r of e()){if(typeof r==`function`)continue;if(r.inputs)for(let e=0;e1){t.flags|=4096;return}tm(e,t)}function tm(e,t){for(let n=t.directiveStart;n{let r=t.hostDirectiveInputs[e],i=t.hostDirectiveOutputs[e+`Change`];if(!r||!i)return!1;for(let e=0;e=i&&a<=o)return t.flags|=n,t.customControlIndex=r,!0}}return!1};if(e(`value`,1024)||e(`checked`,2048))return}}function nm(e,t){return rm(e,t)&&im(e,t+`Change`)}function rm(e,t){return t in e.inputs}function im(e,t){return t in e.outputs}var am=Symbol(`BINDING`),om=new Ii(``);function sm(e,t,n){let r=n?e.styles:null,i=n?e.classes:null,a=0;if(t!==null)for(let e=0;e0&&(n.directiveToIndex=new Map);for(let c=0;c0;){let n=e[--t];if(typeof n==`number`&&n<0)return n}return 0}function xm(e,t,n){if(n){if(t.exportAs)for(let r=0;r{let[n,r,i]=e[t],a={propName:n,templateName:t,isSignal:(r&of.SignalBased)!==0};return i&&(a.transform=i),a})}function km(e){return Object.keys(e).map(t=>({propName:e[t],templateName:t}))}function Am(e,t,n){let r=t instanceof Xa?t:t?.injector;return r&&e.getStandaloneInjector!==null&&(r=e.getStandaloneInjector(r)||r),r?new Mp(n,r):n}function jm(e){let t=e.get(Ep,null);if(t===null)throw new vi(407,!1);return{rendererFactory:t,sanitizer:e.get(kp,null),changeDetectionScheduler:e.get(mc,null),ngReflect:!1,tracingService:e.get(id,null,{optional:!0})}}function Mm(e,t,n){let r=Pm(e);return wu(t,r,r===`svg`?`svg`:r===`math`?xo:n)}function Nm(e){if((e&&`localName`in e&&typeof e.localName==`string`?e.localName:e?.tagName)?.toLowerCase()===`script`)throw new vi(905,!1)}function Pm(e){return(e.selectors[0][0]||`div`).toLowerCase()}var Fm=class{componentDef;ngModule;selector;componentType;ngContentSelectors;isBoundToModule;cachedInputs=null;cachedOutputs=null;get inputs(){return this.cachedInputs??=Om(this.componentDef.inputs),this.cachedInputs}get outputs(){return this.cachedOutputs??=km(this.componentDef.outputs),this.cachedOutputs}constructor(e,t){this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=fte(e.selectors),this.ngContentSelectors=e.ngContentSelectors??[],this.isBoundToModule=!!t}create(e,t,n,r,i,a,o){Gc(Mc.DynamicComponentStart);let s=rn(null);try{let s=this.componentDef,c=Am(s,r||this.ngModule,e),l=jm(c),u=l.tracingService;return u&&u.componentCreate?u.componentCreate(Ap(s),()=>this.createComponentRef(l,c,t,n,i,a,o)):this.createComponentRef(l,c,t,n,i,a,o)}finally{rn(s)}}createComponentRef(e,t,n,r,i,a,o){let s=this.componentDef,c=Im(r,s,a,i),l=e.rendererFactory.createRenderer(null,s),u=r?df(l,r,s.encapsulation,t):Mm(s,l,o??null);Nm(u);let d=t.get(om,null),f=Lm(u,()=>t.get(Ms,null)??cu());d&&d.addHost(f);let p=a?.some(zm)||i?.some(e=>typeof e!=`function`&&e.bindings.some(zm)),m=$d(null,c,null,512|tf(s),null,null,e,l,t,null,hu(u,t,!0));d&&Em&&f instanceof ShadowRoot&&Io(m,()=>{d.removeHost(f)}),m[27]=u,ps(m);let h=null;try{let e=Cm(27,m,2,`#host`,()=>c.directiveRegistry,!0,0);ku(l,u,e),nu(u,m),lf(c,m,e),vu(c,e,m),wm(c,e),n!==void 0&&Vm(e,this.ngContentSelectors,n),h=Oo(e.index,m),m[8]=h[8],Af(c,m,null)}catch(e){throw h!==null&&eu(h),eu(m),e}finally{Gc(Mc.DynamicComponentEnd),vs()}return new Bm(this.componentType,m,!!p)}};function Im(e,t,n,r){let i=e?[`ng-version`,`22.1.7`]:pte(t.selectors[0]),a=null,o=null,s=0;if(n)for(let e of n)s+=e[am].requiredVars,e.create&&(e.targetIdx=0,(a??=[]).push(e)),e.update&&(e.targetIdx=0,(o??=[]).push(e));if(r)for(let e=0;e{if(n&1&&e)for(let t of e)t.create();if(n&2&&t)for(let e of t)e.update()}}function zm(e){let t=e[am].kind;return t===`input`||t===`twoWay`}var Bm=class extends Tp{_rootLView;_hasInputBindings;instance;hostView;changeDetectorRef;componentType;location;previousInputValues=null;_tNode;constructor(e,t,n){super(),this._rootLView=t,this._hasInputBindings=n,this._tNode=To(t[1],27),this.location=Ul(this._tNode,t),this.instance=Oo(this._tNode.index,t)[8],this.hostView=this.changeDetectorRef=new dp(t,void 0),this.componentType=e}setInput(e,t){this._hasInputBindings;let n=this._tNode;if(this.previousInputValues??=new Map,this.previousInputValues.has(e)&&Object.is(this.previousInputValues.get(e),t))return;let r=this._rootLView;Ef(n,r[1],r,e,t),this.previousInputValues.set(e,t),rp(Oo(n.index,r),1)}get injector(){return new Fl(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}};function Vm(e,t,n){let r=e.projection=[];for(let e=0;e{class e{static __NG_ELEMENT_ID__=Um}return e})();function Um(){return qm(Yo(),qo())}var Wm=class e extends Hm{_lContainer;_hostTNode;_hostLView;constructor(e,t,n){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=n}get element(){return Ul(this._hostTNode,this._hostLView)}get injector(){return new Fl(this._hostTNode,this._hostLView)}get parentInjector(){let e=Cl(this._hostTNode,this._hostLView);if(ll(e)){let t=fl(e,this._hostLView),n=ul(e),r=t[1].data[n+8];return new Fl(r,t)}return new Fl(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){let t=Gm(this._lContainer);return t!==null&&t[e]||null}get length(){return this._lContainer.length-10}createEmbeddedView(e,t,n){let r,i;typeof n==`number`?r=n:n!=null&&(r=n.index,i=n.injector);let a=Cp(this._lContainer,e.ssrId),o=e.createEmbeddedViewImpl(t||{},i,a);return this.insertImpl(o,r,Nf(this._hostTNode,a)),o}createComponent(e,t,n,r,i,a,o){let s,c=t||{};s=c.index,n=c.injector,r=c.projectableNodes,i=c.environmentInjector||c.ngModuleRef,a=c.directives,o=c.bindings;let l=new Fm(Wi(e)),u=n||this.parentInjector;if(!i&&l.ngModule==null){let e=this.parentInjector.get(Xa,null);e&&(i=e)}let d=Wi(l.componentType??{}),f=Cp(this._lContainer,d?.id??null),p=f?.firstChild??null,m=l.create(u,r,p,i,a,o,this._getHostElementNamespace());return this.insertImpl(m.hostView,s,Nf(this._hostTNode,f)),m}_getHostElementNamespace(){if(this._hostTNode.type&2){let e=this._hostTNode.parent??this._hostLView[5];return e!==null&&e.type&2&&typeof e.value==`string`&&e.value.toLowerCase()===`foreignobject`?null:e?.namespace??null}return this._hostTNode.namespace}insert(e,t){return this.insertImpl(e,t,!0)}insertImpl(t,n,r){let i=t._lView;if(Nee(i)){let n=this.indexOf(t);if(n!==-1)this.detach(n);else{let n=i[3],r=new e(n,n[5],n[3]);r.detach(r.indexOf(t))}}let a=this._adjustIndex(n),o=this._lContainer;return op(o,i,a,r),t.attachToViewContainerRef(),ba(Km(o),a,t),t}move(e,t){return this.insert(e,t)}indexOf(e){let t=Gm(this._lContainer);return t===null?-1:t.indexOf(e)}remove(e){let t=this._adjustIndex(e,-1),n=cp(this._lContainer,t);n&&(xa(Km(this._lContainer),t),Ad(n[1],n))}detach(e){let t=this._adjustIndex(e,-1),n=cp(this._lContainer,t);return n&&xa(Km(this._lContainer),t)!=null?new dp(n):null}_adjustIndex(e,t=0){return e??this.length+t}};function Gm(e){return e[8]}function Km(e){return e[8]||=[]}function qm(e,t){let n,r=t[e.index];return po(r)?n=r:(n=ip(r,t,null,e),t[e.index]=n,rf(t,n)),Ym(n,t,e,r),new Wm(n,e,t)}function Jm(e,t){let n=e[11],r=n.createComment(``),i=wo(t,e);return Tu(n,n.parentNode(i),r,n.nextSibling(i),!1),r}var Ym=Qm,Xm=()=>!1;function Zm(e,t,n){return Xm(e,t,n)}function Qm(e,t,n,r){if(e[7])return;let i;i=n.type&8?So(r):Jm(t,n),e[7]=i}var $m=class e{queryList;matches=null;constructor(e){this.queryList=e}clone(){return new e(this.queryList)}setDirty(){this.queryList.setDirty()}},eh=class e{queries;constructor(e=[]){this.queries=e}createEmbeddedView(t){let n=t.queries;if(n!==null){let r=t.contentQueries===null?n.length:t.contentQueries[0],i=[];for(let e=0;e0)r.push(o[e/2]);else{let i=a[e+1],o=t[-n];for(let e=10;ee.trim())}function mh(e,t,n){e.queries===null&&(e.queries=new nh),e.queries.track(new rh(t,n))}function hh(e,t){return e.queries.getByIndex(t)}function gh(e,t){let n=e[1],r=hh(n,t);return r.crossesNgTemplate?lh(n,e,t,[]):ch(n,e,r,t)}function _h(e,t,n){let r,i=Tn(()=>{r._dirtyCounter();let n=xh(r,e);if(t&&n===void 0)throw new vi(-951,!1);return n});return r=i[nn],r._dirtyCounter=D(0),r._flatValue=void 0,i}function vh(e){return _h(!0,!1,e)}function yh(e){return _h(!0,!0,e)}function bh(e,t){let n=e[nn];n._lView=qo(),n._queryIndex=t,n._queryList=uh(n._lView,t),n._queryList.onDirty(()=>n._dirtyCounter.update(e=>e+1))}function xh(e,t){let n=e._lView,r=e._queryIndex;if(n===void 0||r===void 0||n[2]&4)return t?void 0:ka;let i=uh(n,r),a=gh(n,r);return i.reset(a,Gl),t?i.first:i._changesDetected||e._flatValue===void 0?e._flatValue=i.toArray():e._flatValue}function Sh(e){return!!e&&typeof e.then==`function`}function Ch(e){return!!e&&typeof e.subscribe==`function`}var wh=class{},Th=class extends wh{injector;instance=null;constructor(e){super();let t=new Za([...e.providers,{provide:wh,useValue:this}],e.parent||Ya(),e.debugName,new Set([`environment`]));this.injector=t,e.runEnvironmentInitializers&&t.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(e){this.injector.onDestroy(e)}};function Eh(e,t,n=null){return new Th({providers:e,parent:t,debugName:n,runEnvironmentInitializers:!0}).injector}var Dh=(()=>{class e{_injector;cachedInjectors=new Map;constructor(e){this._injector=e}getOrCreateStandaloneInjector(e){if(!e.standalone)return null;if(!this.cachedInjectors.has(e)){let t=Fa(!1,e.type),n=t.length>0?Eh([t],this._injector,``):null;this.cachedInjectors.set(e,n)}return this.cachedInjectors.get(e)}ngOnDestroy(){try{for(let e of this.cachedInjectors.values())e!==null&&e.destroy()}finally{this.cachedInjectors.clear()}}static ɵprov=ki({token:e,providedIn:`environment`,factory:()=>new e(da(Xa))})}return e})();function k(e){return jc(()=>{let t=Nh(e),n={...t,decls:e.decls,vars:e.vars,template:e.template,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,onPush:e.changeDetection!==Yl.Eager,directiveDefs:null,pipeDefs:null,dependencies:t.standalone&&e.dependencies||null,getStandaloneInjector:t.standalone?e=>e.get(Dh).getOrCreateStandaloneInjector(n):null,getExternalStyles:null,signals:e.signals??!1,data:e.data||{},encapsulation:e.encapsulation||yu.Emulated,styles:e.styles||ka,_:null,schemas:e.schemas||null,tView:null,id:``};t.standalone&&od(`NgStandalone`),Ph(n);let r=e.dependencies;return n.directiveDefs=Fh(r,Oh),n.pipeDefs=Fh(r,Ki),n.id=Ih(n),n})}function Oh(e){return Wi(e)||Gi(e)}function kh(e,t){if(e==null)return Oa;let n={};for(let r in e)if(Object.hasOwn(e,r)){let i=e[r],a,o,s,c;Array.isArray(i)?(s=i[0],a=i[1],o=i[2]??a,c=i[3]||null):(a=i,o=i,s=of.None,c=null),n[a]=[r,s,c],t[a]=o}return n}function Ah(e){if(e==null)return Oa;let t={};for(let n in e)Object.hasOwn(e,n)&&(t[e[n]]=n);return t}function jh(e){return jc(()=>{let t=Nh(e);return Ph(t),t})}function Mh(e){return{type:e.type,name:e.name,factory:null,pure:e.pure!==!1,standalone:e.standalone??!0,onDestroy:e.type.prototype.ngOnDestroy||null}}function Nh(e){let t={};return{type:e.type,providersResolver:null,viewProvidersResolver:null,factory:null,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:t,inputConfig:e.inputs||Oa,exportAs:e.exportAs||null,standalone:e.standalone??!0,signals:e.signals===!0,selectors:e.selectors||ka,viewQuery:e.viewQuery||null,features:e.features||null,setInput:null,resolveHostDirectives:null,hostDirectives:null,controlDef:null,signalFormsInputPresence:null,inputs:kh(e.inputs,t),outputs:Ah(e.outputs),debugInfo:null}}function Ph(e){e.features?.forEach(t=>t(e))}function Fh(e,t){return e?()=>{let n=typeof e==`function`?e():e,r=[];for(let e of n){let n=t(e);n!==null&&r.push(n)}return r}:null}function Ih(e){let t=0,n=typeof e.consts==`function`?``:e.consts,r=[e.selectors,e.ngContentSelectors,e.hostVars,e.hostAttrs,n,e.vars,e.decls,e.encapsulation,e.standalone,e.signals,e.exportAs,JSON.stringify(e.inputs),JSON.stringify(e.outputs),Object.getOwnPropertyNames(e.type.prototype),!!e.contentQueries,!!e.viewQuery];for(let e of r.join(`|`))t=Math.imul(31,t)+e.charCodeAt(0)<<0;return t+=2147483648,`c`+t}var Lh=new Ii(``),Rh=(()=>{class e{resolve;reject;initialized=!1;done=!1;donePromise=new Promise((e,t)=>{this.resolve=e,this.reject=t});appInits=C(Lh,{optional:!0})??[];injector=C(js);constructor(){}runInitializers(){if(this.initialized)return;let e=[];for(let t of this.appInits){let n=co(this.injector,t);if(Sh(n))e.push(n);else if(Ch(n)){let t=new Promise((e,t)=>{n.subscribe({complete:e,error:t})});e.push(t)}}let t=()=>{this.done=!0,this.resolve()};Promise.all(e).then(()=>{t()}).catch(e=>{this.reject(e)}),e.length===0&&t(),this.initialized=!0}static ɵfac=function(t){return new(t||e)};static ɵprov=Vl({token:e,factory:e.ɵfac})}return e})();function zh(e){return t=>{t.controlDef={create:(e,t)=>{e?.ɵngControlCreate(t)},update:(e,t)=>{e?.ɵngControlUpdate?.(t)},passThroughInput:e}}}function Bh(e){return Object.getPrototypeOf(e.prototype).constructor}function Vh(e){let t=Bh(e.type),n=!0,r=[e];for(;t&&t!==Function.prototype&&t!==Object.prototype;){let i,a=Object.hasOwn(t,Ri)?t[Ri]:void 0,o=Object.hasOwn(t,zi)?t[zi]:void 0;if(_o(e))i=a??o;else{if(a)throw new vi(903,!1);i=o}if(i){if(n){r.push(i);let t=e;t.inputs=Wh(e.inputs),t.declaredInputs=Wh(e.declaredInputs),t.outputs=Wh(e.outputs);let n=i.hostBindings;n&&qh(e,n);let a=i.viewQuery,o=i.contentQueries;if(a&&Gh(e,a),o&&Kh(e,o),Hh(e,i),Si(e.outputs,i.outputs),_o(i)&&i.data.animation){let t=e.data;t.animation=(t.animation||[]).concat(i.data.animation)}}let t=i.features;if(t)for(let r=0;r=0;r--){let i=e[r];i.hostVars=t+=i.hostVars,i.hostAttrs=sl(i.hostAttrs,n=sl(n,i.hostAttrs))}}function Wh(e){return e===Oa?{}:e===ka?[]:e}function Gh(e,t){let n=e.viewQuery;e.viewQuery=n?(e,r)=>{t(e,r),n(e,r)}:t}function Kh(e,t){let n=e.contentQueries;e.contentQueries=n?(e,r,i)=>{t(e,r,i),n(e,r,i)}:t}function qh(e,t){let n=e.hostBindings;e.hostBindings=n?(e,r)=>{t(e,r),n(e,r)}:t}function Jh(e,t,n,r,i,a,o,s){if(n.firstCreatePass){e.mergedAttrs=sl(e.mergedAttrs,e.attrs);let t=e.tView=Xd(2,e,i,a,o,n.directiveRegistry,n.pipeRegistry,null,n.schemas,n.consts,null);n.queries!==null&&(n.queries.template(n,e),t.queries=n.queries.embeddedTView(e))}s&&(e.flags|=s),Zo(e,!1);let c=Qh(n,t,e,r);Ds()&&zd(n,t,c,e),nu(c,t);let l=ip(c,t,c,e);t[r+27]=l,rf(t,l),Zm(l,e,t)}function Yh(e,t,n,r,i,a,o,s,c,l,u){let d=n+27,f;return t.firstCreatePass?(f=hp(t,d,4,o||null,s||null),Uo()&&lm(t,e,f,Ao(t.consts,l),yf),qc(t,f)):f=t.data[d],Jh(f,e,t,n,r,i,a,c),go(f)&&lf(t,e,f),l!=null&&uf(e,f,u),f}function Xh(e,t,n,r,i,a,o,s,c,l,u){let d=n+27,f;if(t.firstCreatePass){if(f=hp(t,d,4,o||null,s||null),l!=null){let e=Ao(t.consts,l);f.localNames=[];for(let t=0;t{throw new vi(600,``)})}var rg=10,ig=(()=>{class e{_runningTick=!1;_destroyed=!1;_destroyListeners=[];_views=[];internalErrorHandler=C(ic);afterRenderManager=C(sd);zonelessEnabled=C(hc);rootEffectScheduler=C(_c);dirtyFlags=0;tracingSnapshot=null;allTestViews=new Set;autoDetectTestViews=new Set;includeAllTestViews=!1;afterTick=new Yr;get allViews(){return[...(this.includeAllTestViews?this.allTestViews:this.autoDetectTestViews).keys(),...this._views]}get destroyed(){return this._destroyed}componentTypes=[];components=[];internalPendingTask=C(Ls);get isStable(){return this.internalPendingTask.hasPendingTasksObservable.pipe(gi(e=>!e))}constructor(){C(id,{optional:!0})}whenStable(){let e;return new Promise(t=>{e=this.isStable.subscribe({next:e=>{e&&t()}})}).finally(()=>{e.unsubscribe()})}_injector=C(Xa);_rendererFactory=null;get injector(){return this._injector}bootstrap(e,t){return this.bootstrapImpl(e,t)}bootstrapImpl(e,t,n=js.NULL){return this._injector.get(Gs).run(()=>{if(Gc(Mc.BootstrapComponentStart),!this._injector.get(Rh).done)throw new vi(405,``);let r=Wi(e),i=this._injector.get(wh),a=new Fm(r,i);this.componentTypes.push(e);let{hostElement:o,directives:s,bindings:c}=ag(t),l=o||a.selector,u=a.create(n,[],l,i.injector,s,c),d=u.location.nativeElement,f=u.injector.get(eg,null);return f?.registerApplication(d),u.onDestroy(()=>{this.detachView(u.hostView),og(this.components,u),f?.unregisterApplication(d)}),this._loadComponent(u),Gc(Mc.BootstrapComponentEnd,u),u})}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick(){Gc(Mc.ChangeDetectionStart),this.tracingSnapshot===null?this.tickImpl():this.tracingSnapshot.run(rd.CHANGE_DETECTION,this.tickImpl)}tickImpl=()=>{if(this._runningTick)throw Gc(Mc.ChangeDetectionEnd),new vi(101,!1);let e=rn(null);try{this._runningTick=!0,this.synchronize()}finally{this._runningTick=!1,this.tracingSnapshot?.dispose(),this.tracingSnapshot=null,rn(e),this.afterTick.next(),Gc(Mc.ChangeDetectionEnd)}};synchronize(){this._rendererFactory===null&&!this._injector.destroyed&&(this._rendererFactory=this._injector.get(Ep,null,{optional:!0}));let e=0;for(;this.dirtyFlags!==0&&e++No(e))){this.dirtyFlags|=2;return}this.dirtyFlags&=-8}attachView(e){let t=e;this._views.push(t),t.attachToAppRef(this)}detachView(e){let t=e;og(this._views,t),t.detachFromAppRef()}_loadComponent(e){this.attachView(e.hostView);try{this.tick()}catch(e){this.internalErrorHandler(e)}this.components.push(e),this._injector.get(tg,[]).forEach(t=>t(e))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(e=>e()),this._views.slice().forEach(e=>e.destroy())}finally{this._destroyed=!0,this._views=[],this._destroyListeners=[]}}onDestroy(e){return this._destroyListeners.push(e),()=>og(this._destroyListeners,e)}destroy(){if(this._destroyed)throw new vi(406,!1);let e=this._injector;e.destroy&&!e.destroyed&&e.destroy()}get viewCount(){return this._views.length}static ɵfac=function(t){return new(t||e)};static ɵprov=Vl({token:e,factory:e.ɵfac})}return e})();function ag(e){return e===void 0||typeof e==`string`||e instanceof Element?{hostElement:e}:e}function og(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function A(e,t,n,r){let i=qo();return Fp(i,as(),t)&&(Jo(),bf(Ss(),i,e,t,n,r)),A}function sg(e){if(od(`NgAnimateEnter`),!qu)return sg;let t=qo();if(Cte(t))return sg;let n=Yo(),r=t[9].get(Gs);return Ote(ed(t),n,()=>cg(t,n,e,r)),hd(t[9]),gd(t[9],ed(t)),sg}function cg(e,t,n,r){let i=wo(t,e),a=e[11],o=Dte(n),s=[],c=!1,l=e=>{if(td(e)!==i)return;let t=e instanceof AnimationEvent?`animationend`:`transitionend`;r.runOutsideAngular(()=>{a.listen(i,t,u)})},u=e=>{td(e)===i&&(nd(e,i)&&(c=!0),lg(e,i,a))};if(o&&o.length>0){r.runOutsideAngular(()=>{s.push(a.listen(i,`animationstart`,l)),s.push(a.listen(i,`transitionstart`,l))}),wte(i,o,s);for(let e of o)a.addClass(i,e);r.runOutsideAngular(()=>{requestAnimationFrame(()=>{if(!c&&(yte(i,Xu,qu),!Xu.has(i))){for(let e of o)a.removeClass(i,e);Ju(i)}})})}}function lg(e,t,n){let r=Yu.get(t);if(td(e)===t&&r&&nd(e,t)){e.stopPropagation();for(let e of r.classList)n.removeClass(t,e);Ju(t)}}var ug=class{destroy(e){}updateValue(e,t){}swap(e,t){let n=Math.min(e,t),r=Math.max(e,t),i=this.detach(r);if(r-n>1){let e=this.detach(n);this.attach(n,i),this.attach(r,e)}else this.attach(n,i)}move(e,t){this.attach(t,this.detach(e))}};function dg(e,t,n,r,i){return e===n&&Object.is(t,r)?1:Object.is(i(e,t),i(n,r))?-1:0}function fg(e,t,n,r){let i,a,o=0,s=e.length-1;if(Array.isArray(t)){rn(r);let c=t.length-1;for(rn(null);o<=s&&o<=c;){let r=e.at(o),l=t[o],u=dg(o,r,o,l,n);if(u!==0){u<0&&e.updateValue(o,l),o++;continue}let d=e.at(s),f=t[c],p=dg(s,d,c,f,n);if(p!==0){p<0&&e.updateValue(s,f),s--,c--;continue}let m=n(o,r),h=n(s,d),g=n(o,l);if(Object.is(g,h)){let t=n(c,f);Object.is(t,m)?(e.swap(o,s),e.updateValue(s,f),c--,s--):e.move(s,o),e.updateValue(o,l),o++;continue}if(i??=new gg,a??=hg(e,o,s,n),pg(e,i,o,g))e.updateValue(o,l),o++,s++;else if(a.has(g))i.set(m,e.detach(o)),s--;else{let n=e.create(o,t[o]);e.attach(o,n),o++,s++}}for(;o<=c;)mg(e,i,n,o,t[o]),o++}else if(t!=null){rn(r);let c=t[Symbol.iterator]();rn(null);let l=c.next();for(;!l.done&&o<=s;){let t=e.at(o),r=l.value,u=dg(o,t,o,r,n);if(u!==0)u<0&&e.updateValue(o,r),o++,l=c.next();else{i??=new gg,a??=hg(e,o,s,n);let u=n(o,r);if(pg(e,i,o,u))e.updateValue(o,r),o++,s++,l=c.next();else if(!a.has(u))e.attach(o,e.create(o,r)),o++,s++,l=c.next();else{let r=n(o,t);i.set(r,e.detach(o)),s--}}}for(;!l.done;)mg(e,i,n,e.length,l.value),l=c.next()}for(;o<=s;)e.destroy(e.detach(s--));i?.forEach(t=>{e.destroy(t)})}function pg(e,t,n,r){return t!==void 0&&t.has(r)?(e.attach(n,t.get(r)),t.delete(r),!0):!1}function mg(e,t,n,r,i){if(pg(e,t,r,n(r,i)))e.updateValue(r,i);else{let t=e.create(r,i);e.attach(r,t)}}function hg(e,t,n,r){let i=new Set;for(let a=t;a<=n;a++)i.add(r(a,e.at(a)));return i}var gg=class{kvMap=new Map;_vMap=void 0;has(e){return this.kvMap.has(e)}delete(e){if(!this.has(e))return!1;let t=this.kvMap.get(e);return this._vMap!==void 0&&this._vMap.has(t)?(this.kvMap.set(e,this._vMap.get(t)),this._vMap.delete(t)):this.kvMap.delete(e),!0}get(e){return this.kvMap.get(e)}set(e,t){if(this.kvMap.has(e)){let n=this.kvMap.get(e);this._vMap===void 0&&(this._vMap=new Map);let r=this._vMap;for(;r.has(n);)n=r.get(n);r.set(n,t)}else this.kvMap.set(e,t)}forEach(e){for(let[t,n]of this.kvMap)if(e(n,t),this._vMap!==void 0){let r=this._vMap;for(;r.has(n);)n=r.get(n),e(n,t)}}};function j(e,t,n,r,i,a,o,s){od(`NgControlFlow`);let c=qo(),l=Jo();return Xh(c,l,e,t,n,r,i,Ao(l.consts,a),256,o,s),_g}function _g(e,t,n,r,i,a,o,s){od(`NgControlFlow`);let c=qo(),l=Jo();return Xh(c,l,e,t,n,r,i,Ao(l.consts,a),512,o,s),_g}function M(e,t){od(`NgControlFlow`);let n=qo(),r=as(),i=n[r]===Ru?-1:n[r],a=i===-1?void 0:Cg(n,27+i);if(Fp(n,r,e)){let r=rn(null);try{if(a!==void 0&&sp(a,0),e!==-1){let r=27+e,i=Cg(n,r),a=Og(n[1],r),o=wp(i,a,n);op(i,Mf(n,a,t,{dehydratedView:o}),0,Nf(a,o))}}finally{rn(r)}}else if(a!==void 0){let e=ap(a,0);e!==void 0&&(e[8]=t)}}var vg=class{lContainer;$implicit;$index;constructor(e,t,n){this.lContainer=e,this.$implicit=t,this.$index=n}get $count(){return this.lContainer.length-10}};function yg(e){return e}function bg(e,t){return t}var xg=class{hasEmptyBlock;trackByFn;liveCollection;constructor(e,t,n){this.hasEmptyBlock=e,this.trackByFn=t,this.liveCollection=n}};function N(e,t,n,r,i,a,o,s,c,l,u,d,f){od(`NgControlFlow`);let p=qo(),m=Jo(),h=c!==void 0,g=qo(),_=new xg(h,s?o.bind(g[15][8]):o);g[27+e]=_,Xh(p,m,e+1,t,n,r,i,Ao(m.consts,a),256),h&&Xh(p,m,e+2,c,l,u,d,Ao(m.consts,f),512)}var Sg=class extends ug{lContainer;hostLView;templateTNode;operationsCounter=void 0;needsIndexUpdate=!1;constructor(e,t,n){super(),this.lContainer=e,this.hostLView=t,this.templateTNode=n}get length(){return this.lContainer.length-10}at(e){return this.getLView(e)[8].$implicit}attach(e,t){let n=t[6];this.needsIndexUpdate||=e!==this.length,op(this.lContainer,t,e,Nf(this.templateTNode,n)),wg(this.lContainer,e)}detach(e){return this.needsIndexUpdate||=e!==this.length-1,Tg(this.lContainer,e),Eg(this.lContainer,e)}create(e,t){let n=Cp(this.lContainer,this.templateTNode.tView.ssrId);return Mf(this.hostLView,this.templateTNode,new vg(this.lContainer,t,e),{dehydratedView:n})}destroy(e){Ad(e[1],e)}updateValue(e,t){this.getLView(e)[8].$implicit=t}reset(){this.needsIndexUpdate=!1}updateIndexes(){if(this.needsIndexUpdate)for(let e=0;e0){let e=n[9];Mte(e,r),Ku.delete(n[19]),r.detachedLeaveAnimationFns=void 0}}function Tg(e,t){if(e.length<=10)return;let n=e[10+t],r=n?n[26]:void 0;r&&r.leave&&r.leave.size>0&&(r.detachedLeaveAnimationFns=[])}function Eg(e,t){return cp(e,t)}function Dg(e,t){return ap(e,t)}function Og(e,t){return To(e,t)}function F(e,t,n){let r=qo();return Fp(r,as(),t)&&(Jo(),pf(Ss(),r,e,t,r[11],n)),F}function kg(e,t,n,r,i){Ef(t,e,n,i?`class`:`style`,r)}function I(e,t,n,r){let i=qo(),a=i[1],o=e+27,s=a.firstCreatePass?Cm(o,i,2,t,yf,Uo(),n,r):a.data[o];if(ho(s)){let n=i[10].tracingService;if(n&&n.componentCreate){let o=a.data[s.directiveStart+s.componentOffset];return n.componentCreate(Ap(o),()=>(Ag(e,t,i,s,r),I))}}return Ag(e,t,i,s,r),I}function Ag(e,t,n,r,i){if(Cf(r,n,e,t,Mg),go(r)){let e=n[1];lf(e,n,r),vu(e,r,n)}i!=null&&uf(n,r)}function L(){let e=Jo(),t=wf(Yo());return e.firstCreatePass&&wm(e,t),Go(t)&&Ko(),Ho(),t.classesWithoutHost!=null&&nl(t)&&kg(e,t,qo(),t.classesWithoutHost,!0),t.stylesWithoutHost!=null&&rl(t)&&kg(e,t,qo(),t.stylesWithoutHost,!1),L}function R(e,t,n,r){return I(e,t,n,r),L(),R}function z(e,t,n,r){let i=qo(),a=i[1],o=e+27,s=a.firstCreatePass?Tm(o,a,2,t,n,r):a.data[o];return Cf(s,i,e,t,Mg),r!=null&&uf(i,s),z}function B(){return Go(wf(Yo()))&&Ko(),Ho(),B}function jg(e,t,n,r){return z(e,t,n,r),B(),jg}var Mg=(e,t,n,r,i)=>(Os(!0),wu(t[11],r,Ts()));function Ng(e,t,n){let r=qo(),i=r[1],a=e+27,o=i.firstCreatePass?Cm(a,r,8,`ng-container`,yf,Uo(),t,n):i.data[a];if(Cf(o,r,e,`ng-container`,Ig),go(o)){let e=r[1];lf(e,r,o),vu(e,o,r)}return n!=null&&uf(r,o),Ng}function Pg(){let e=Jo(),t=wf(Yo());return e.firstCreatePass&&wm(e,t),Pg}function Fg(e,t,n){return Ng(e,t,n),Pg(),Fg}var Ig=(e,t,n,r,i)=>(Os(!0),Qee(t[11],``));function V(){return qo()}function Lg(e,t,n){let r=qo();return Fp(r,as(),t)&&(Jo(),mf(Ss(),r,e,t,r[11],n)),Lg}var Rg=void 0;function zg(e){let t=Math.floor(Math.abs(e)),n=e.toString().replace(/^[^.]*\.?/,``).length;return t===1&&n===0?1:5}var Bg=[`en`,[[`a`,`p`],[`AM`,`PM`]],[[`AM`,`PM`]],[[`S`,`M`,`T`,`W`,`T`,`F`,`S`],[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`]],Rg,[[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]],Rg,[[`B`,`A`],[`BC`,`AD`],[`Before Christ`,`Anno Domini`]],0,[6,0],[`M/d/yy`,`MMM d, y`,`MMMM d, y`,`EEEE, MMMM d, y`],[`h:mm a`,`h:mm:ss a`,`h:mm:ss a z`,`h:mm:ss a zzzz`],[`{1}, {0}`,Rg,Rg,Rg],[`.`,`,`,`;`,`%`,`+`,`-`,`E`,`×`,`‰`,`∞`,`NaN`,`:`],[`#,##0.###`,`#,##0%`,`¤#,##0.00`,`#E0`],`USD`,`$`,`US Dollar`,{},`ltr`,zg],Vg=Object.create(null);function Hg(e){let t=Gg(e),n=Ug(t);if(n)return n;let r=t.split(`-`)[0];if(n=Ug(r),n)return n;if(r===`en`)return Bg;throw new vi(701,!1)}function Ug(e){if(!(e in Vg)){let t=oa.ng&&oa.ng.common&&oa.ng.common.locales&&oa.ng.common.locales[e];return t!==void 0&&(Vg[e]=t),t}return Vg[e]}var Wg={LocaleId:0,DayPeriodsFormat:1,DayPeriodsStandalone:2,DaysFormat:3,DaysStandalone:4,MonthsFormat:5,MonthsStandalone:6,Eras:7,FirstDayOfWeek:8,WeekendRange:9,DateFormat:10,TimeFormat:11,DateTimeFormat:12,NumberSymbols:13,NumberFormats:14,CurrencyCode:15,CurrencySymbol:16,CurrencyName:17,Currencies:18,Directionality:19,PluralCase:20,ExtraData:21};function Gg(e){return e.toLowerCase().replace(/_/g,`-`)}var Kg=`en-US`;function qg(e){typeof e==`string`&&e.toLowerCase().replace(/_/g,`-`)}function H(e,t,n){let r=qo(),i=Jo(),a=Yo();return Jg(i,r,r[11],a,e,t,n),H}function U(e,t,n){let r=qo(),i=Jo(),a=Yo();return(a.type&3||n)&&Vp(a,i,r,n,r[11],e,t,zp(a,r,t)),U}function Jg(e,t,n,r,i,a,o){let s=!0,c=null;if((r.type&3||o)&&(c??=zp(r,t,a),Vp(r,e,t,o,n,i,a,c)&&(s=!1)),s){let e=r.outputs?.[i],n=r.hostDirectiveOutputs?.[i];if(n&&n.length)for(let e=0;e>17&32767}function i_(e){return(e&2)==2}function a_(e,t){return e&131071|t<<17}function o_(e){return e|2}function s_(e){return(e&131068)>>2}function c_(e,t){return e&-131069|t<<2}function l_(e){return(e&1)==1}function u_(e){return e|1}function d_(e,t,n,r,i,a){let o=a?t.classBindings:t.styleBindings,s=r_(o),c=s_(o);e[r]=n;let l=!1,u;if(Array.isArray(n)){let e=n;u=e[1],(u===null||Ea(e,u)>0)&&(l=!0)}else u=n;if(i){if(c!==0){let t=r_(e[s+1]);e[r+1]=n_(t,s),t!==0&&(e[t+1]=c_(e[t+1],r)),e[s+1]=a_(e[s+1],r)}else e[r+1]=n_(s,0),s!==0&&(e[s+1]=c_(e[s+1],r)),s=r}else e[r+1]=n_(c,0),s===0?s=r:e[c+1]=c_(e[c+1],r),c=r;l&&(e[r+1]=o_(e[r+1])),p_(e,u,r,!0),p_(e,u,r,!1),f_(t,u,e,r,a),o=n_(s,c),a?t.classBindings=o:t.styleBindings=o}function f_(e,t,n,r,i){let a=i?e.residualClasses:e.residualStyles;a!=null&&typeof t==`string`&&Ea(a,t)>=0&&(n[r+1]=u_(n[r+1]))}function p_(e,t,n,r){let i=e[n+1],a=t===null,o=r?r_(i):s_(i),s=!1;for(;o!==0&&(s===!1||a);){let n=e[o],i=e[o+1];m_(n,t)&&(s=!0,e[o+1]=r?u_(i):o_(i)),o=r?r_(i):s_(i)}s&&(e[n+1]=r?o_(i):u_(i))}function m_(e,t){return e===null||t==null||(Array.isArray(e)?e[1]:e)===t?!0:Array.isArray(e)&&typeof t==`string`?Ea(e,t)>=0:!1}var h_={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function g_(e){return e.substring(h_.key,h_.keyEnd)}function __(e){return y_(e),v_(e,b_(e,0,h_.textEnd))}function v_(e,t){let n=h_.textEnd;return n===t?-1:(t=h_.keyEnd=x_(e,h_.key=t,n),b_(e,t,n))}function y_(e){h_.key=0,h_.keyEnd=0,h_.value=0,h_.valueEnd=0,h_.textEnd=e.length}function b_(e,t,n){for(;t32;)t++;return t}function S_(e,t,n){return T_(e,t,n,!1),S_}function G(e,t){return T_(e,t,null,!0),G}function C_(e){E_(Fte,w_,e,!0)}function w_(e,t){for(let n=__(t);n>=0;n=v_(t,n))wa(e,g_(t),!0)}function T_(e,t,n,r){let i=qo(),a=Jo(),o=os(2);if(a.firstUpdatePass&&O_(a,e,o,r),t!==Ru&&Fp(i,o,t)){let s=a.data[bs()];P_(a,s,i,i[11],e,i[o+1]=Lte(t,n),r,o)}}function E_(e,t,n,r){let i=Jo(),a=os(2);i.firstUpdatePass&&O_(i,null,a,r);let o=qo();if(n!==Ru&&Fp(o,a,n)){let s=i.data[bs()];if(L_(s,r)&&!D_(i,a)){let e=r?s.classesWithoutHost:s.stylesWithoutHost;e!==null&&(n=wi(e,n||``)),kg(i,s,o,n,r)}else Ite(i,s,o,o[11],o[a+1],o[a+1]=Pte(e,t,n),r,a)}}function D_(e,t){return t>=e.expandoStartIndex}function O_(e,t,n,r){let i=e.data;if(i[n+1]===null){let a=i[bs()],o=D_(e,n);L_(a,r)&&t===null&&!o&&(t=!1),t=k_(i,a,t,r),d_(i,a,t,n,o,r)}}function k_(e,t,n,r){let i=cs(e),a=r?t.residualClasses:t.residualStyles;if(i===null)(r?t.classBindings:t.styleBindings)===0&&(n=M_(null,e,t,n,r),n=N_(n,t.attrs,r),a=null);else{let o=t.directiveStylingLast;if(o===-1||e[o]!==i){if(n=M_(i,e,t,n,r),a===null){let n=A_(e,t,r);n!==void 0&&Array.isArray(n)&&(n=M_(null,e,t,n[1],r),n=N_(n,t.attrs,r),j_(e,t,r,n))}else a=Nte(e,t,r)}}return a!==void 0&&(r?t.residualClasses=a:t.residualStyles=a),n}function A_(e,t,n){let r=n?t.classBindings:t.styleBindings;if(s_(r)!==0)return e[r_(r)]}function j_(e,t,n,r){let i=n?t.classBindings:t.styleBindings;e[r_(i)]=r}function Nte(e,t,n){let r,i=t.directiveEnd;for(let a=1+t.directiveStylingLast;a0;){let t=e[i],a=Array.isArray(t),c=a?t[1]:t,l=c===null,u=n[i+1];u===Ru&&(u=l?ka:void 0);let d=l?Ta(u,r):c===r?u:void 0;if(a&&!I_(d)&&(d=Ta(t,r)),I_(d)&&(s=d,o))return s;let f=e[i+1];i=o?r_(f):s_(f)}if(t!==null){let e=a?t.residualClasses:t.residualStyles;e!=null&&(s=Ta(e,r))}return s}function I_(e){return e!==void 0}function Lte(e,t){return e==null||e===``||(typeof t==`string`?e=xu(e)+t:typeof e==`object`&&(e=Ci(xu(e)))),e}function L_(e,t){return!!(e.flags&(t?8:16))}function K(e,t=``){let n=qo(),r=Jo(),i=e+27,a=r.firstCreatePass?hp(r,i,1,t,null):r.data[i],o=Rte(r,n,a,t);n[i]=o,Ds()&&zd(r,n,o,a),Zo(a,!1)}var Rte=(e,t,n,r)=>(Os(!0),Xee(t[11],r));function R_(e,t,n,r=``){return Fp(e,as(),n)?t+Ji(n)+r:Ru}function zte(e,t,n,r,i,a=``){let o=Ip(e,is(),n,i);return os(2),o?t+Ji(n)+r+Ji(i)+a:Ru}function Bte(e,t,n,r,i,a,o,s=``){let c=Lp(e,is(),n,i,o);return os(3),c?t+Ji(n)+r+Ji(i)+a+Ji(o)+s:Ru}function Vte(e,t,n,r,i,a,o,s,c,l=``){let u=Rp(e,is(),n,i,o,c);return os(4),u?t+Ji(n)+r+Ji(i)+a+Ji(o)+s+Ji(c)+l:Ru}function q(e){return J(``,e),q}function J(e,t,n){let r=qo(),i=R_(r,e,t,n);return i!==Ru&&V_(r,bs(),i),J}function Y(e,t,n,r,i){let a=qo(),o=zte(a,e,t,n,r,i);return o!==Ru&&V_(a,bs(),o),Y}function z_(e,t,n,r,i,a,o){let s=qo(),c=Bte(s,e,t,n,r,i,a,o);return c!==Ru&&V_(s,bs(),c),z_}function B_(e,t,n,r,i,a,o,s,c){let l=qo(),u=Vte(l,e,t,n,r,i,a,o,s,c);return u!==Ru&&V_(l,bs(),u),B_}function V_(e,t,n){let r=Co(t,e);Zee(e[11],r,n)}function H_(e,t,n){Oc(t)&&(t=t());let r=qo();return Fp(r,as(),t)&&(Jo(),pf(Ss(),r,e,t,r[11],n)),H_}function U_(e,t){let n=Oc(e);return n&&e.set(t),n}function W_(e,t){let n=qo(),r=Jo(),i=Yo();return Jg(r,n,n[11],i,e,t),W_}var G_={};function K_(e){od(`NgLet`);let t=Jo(),n=qo(),r=e+27;return Zo(hp(t,r,128,null,null),!1),Do(t,n,r,G_),K_}function q_(e){return Do(Jo(),qo(),bs(),e),e}function J_(e){let t=Eo(es(),27+e);if(t===G_)throw new vi(314,!1);return t}function Y_(e,t,n=``){return R_(qo(),e,t,n)}function X_(e,t,n){let r=Jo();r.firstCreatePass&&Z_(t,r.data,r.blueprint,_o(e),n)}function Z_(e,t,n,r,i){if(e=Di(e),Array.isArray(e))for(let a=0;a>20;if(Ua(e)||!e.multi){let r=new tl(l,i,cm,null),p=ev(c,t,i?u:u+f,d);p===-1?(wl(bl(s,o),a,c),Q_(a,e,t.length),t.push(c),s.directiveStart++,s.directiveEnd++,i&&(s.providerIndexes+=1048576),n.push(r),o.push(r)):(n[p]=r,o[p]=r)}else{let p=ev(c,t,u+f,d),m=ev(c,t,u,u+f),h=p>=0&&n[p],g=m>=0&&n[m];if(i&&!g||!i&&!h){wl(bl(s,o),a,c);let u=Wte(i?Ute:Hte,n.length,i,r,l,e);!i&&g&&(n[m].providerFactory=u),Q_(a,e,t.length,0),t.push(c),s.directiveStart++,s.directiveEnd++,i&&(s.providerIndexes+=1048576),n.push(u),o.push(u)}else{let t=$_(n[i?m:p],l,!i&&r);Q_(a,e,p>-1?p:m,t)}!i&&r&&g&&n[m].componentProviders++}}}function Q_(e,t,n,r){let i=Ua(t),a=Wa(t);if(i||a){let o=(a?Di(t.useClass):t).prototype.ngOnDestroy;if(o){let a=e.destroyHooks||=[];if(!i&&t.multi){let e=a.indexOf(n);e===-1?a.push(n,[r,o]):a[e+1].push(r,o)}else a.push(n,o)}}}function $_(e,t,n){return n&&e.componentProviders++,e.multi.push(t)-1}function ev(e,t,n,r){for(let i=n;i{n.providersResolver=(t,n)=>X_(t,n?n(e):e,!1),t&&(n.viewProvidersResolver=(e,n)=>X_(e,n?n(t):t,!0))}}function rv(e,t){let n=rs()+e,r=qo();return r[n]===Ru?Np(r,n,t()):Pp(r,n)}function iv(e,t,n){return sv(qo(),rs(),e,t,n)}function av(e,t,n,r){return cv(qo(),rs(),e,t,n,r)}function Gte(e,t,n,r,i){return Kte(qo(),rs(),e,t,n,r,i)}function ov(e,t){let n=e[t];return n===Ru?void 0:n}function sv(e,t,n,r,i,a){let o=t+n;return Fp(e,o,i)?Np(e,o+1,a?r.call(a,i):r(i)):ov(e,o+1)}function cv(e,t,n,r,i,a,o){let s=t+n;return Ip(e,s,i,a)?Np(e,s+2,o?r.call(o,i,a):r(i,a)):ov(e,s+2)}function Kte(e,t,n,r,i,a,o,s){let c=t+n;return Lp(e,c,i,a,o)?Np(e,c+3,s?r.call(s,i,a,o):r(i,a,o)):ov(e,c+3)}function lv(e,t){let n=Jo(),r,i=e+27;n.firstCreatePass?(r=qte(t,n.pipeRegistry),n.data[i]=r,r.onDestroy&&(n.destroyHooks??=[]).push(i,r.onDestroy)):r=n.data[i];let a=r.factory||(r.factory=ga(r.type,!0)),o=ia(cm);try{let e=ml(!1),t=a();return ml(e),Do(n,qo(),i,t),t}finally{ia(o)}}function qte(e,t){if(t)for(let n=t.length-1;n>=0;n--){let r=t[n];if(e===r.name)return r}}function uv(e,t,n){let r=e+27,i=qo(),a=Eo(i,r);return fv(i,r)?sv(i,rs(),t,a.transform,n,a):a.transform(n)}function dv(e,t,n,r){let i=e+27,a=qo(),o=Eo(a,i);return fv(a,i)?cv(a,rs(),t,o.transform,n,r,o):o.transform(n,r)}function fv(e,t){return e[1].data[t].pure}function pv(e,t){return mp(e,t)}var Jte=(()=>{class e{applicationErrorHandler=C(ic);appRef=C(ig);taskService=C(Ls);ngZone=C(Gs);zonelessEnabled=C(hc);tracing=C(id,{optional:!0});zoneIsDefined=typeof Zone<`u`&&!!Zone.root.run;schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}];subscriptions=new pr;angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(Us):null;scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(C(gc,{optional:!0})??!1);cancelScheduledCallback=null;useMicrotaskScheduler=!1;runningTick=!1;pendingRenderTaskId=null;constructor(){this.subscriptions.add(this.appRef.afterTick.subscribe(()=>{let e=this.taskService.add();if(!this.runningTick&&(this.cleanup(),!this.zonelessEnabled||this.appRef.includeAllTestViews)){this.taskService.remove(e);return}this.switchToMicrotaskScheduler(),this.taskService.remove(e)})),this.subscriptions.add(this.ngZone.onUnstable.subscribe(()=>{this.runningTick||this.cleanup()}))}switchToMicrotaskScheduler(){this.ngZone.runOutsideAngular(()=>{let e=this.taskService.add();this.useMicrotaskScheduler=!0,queueMicrotask(()=>{this.useMicrotaskScheduler=!1,this.taskService.remove(e)})})}notify(e){if(!this.zonelessEnabled&&e===5)return;switch(e){case 0:case 2:this.appRef.dirtyFlags|=2;break;case 3:case 4:case 5:case 1:this.appRef.dirtyFlags|=4;break;case 6:this.appRef.dirtyFlags|=2;break;case 12:this.appRef.dirtyFlags|=16;break;case 13:this.appRef.dirtyFlags|=2;break;case 11:break;default:this.appRef.dirtyFlags|=8}if(this.appRef.tracingSnapshot=this.tracing?.snapshot(this.appRef.tracingSnapshot)??null,!this.shouldScheduleTick())return;let t=this.useMicrotaskScheduler?Vs:Bs;this.pendingRenderTaskId=this.taskService.add(),this.cancelScheduledCallback=this.scheduleInRootZone?Zone.root.run(()=>t(()=>this.tick())):this.ngZone.runOutsideAngular(()=>t(()=>this.tick()))}shouldScheduleTick(){return!(this.appRef.destroyed||this.pendingRenderTaskId!==null||this.runningTick||this.appRef._runningTick||!this.zonelessEnabled&&this.zoneIsDefined&&Zone.current.get(`isAngularZone_ID`+this.angularZoneId))}tick(){if(this.runningTick||this.appRef.destroyed)return;if(this.appRef.dirtyFlags===0){this.cleanup();return}!this.zonelessEnabled&&this.appRef.dirtyFlags&7&&(this.appRef.dirtyFlags|=1);let e=this.taskService.add();try{this.ngZone.run(()=>{this.runningTick=!0,this.appRef._tick()},void 0,this.schedulerTickApplyArgs)}catch(e){this.applicationErrorHandler(e)}finally{this.taskService.remove(e),this.cleanup()}}ngOnDestroy(){this.subscriptions.unsubscribe(),this.cleanup()}cleanup(){if(this.runningTick=!1,this.cancelScheduledCallback?.(),this.cancelScheduledCallback=null,this.pendingRenderTaskId!==null){let e=this.pendingRenderTaskId;this.pendingRenderTaskId=null,this.taskService.remove(e)}}static ɵfac=function(t){return new(t||e)};static ɵprov=Vl({token:e,factory:e.ɵfac})}return e})();function Yte(){return[{provide:mc,useExisting:Jte},{provide:Gs,useClass:$s},{provide:hc,useValue:!0}]}function Xte(){return typeof $localize<`u`&&$localize.locale||`en-US`}var mv=new Ii(``,{factory:()=>C(mv,{optional:!0,skipSelf:!0})||Xte()}),hv=class{destroyed=!1;listeners=null;errorHandler=C(rc,{optional:!0});isEmitting=!1;hasNullListeners=!1;destroyRef=C(Ns);constructor(){this.destroyRef.onDestroy(()=>{this.destroyed=!0,this.listeners=null})}subscribe(e){if(this.destroyed)throw new vi(953,!1);return(this.listeners??=[]).push(e),{unsubscribe:()=>{let t=this.listeners?this.listeners.indexOf(e):-1;t>-1&&(this.isEmitting?(this.hasNullListeners=!0,this.listeners[t]=null):this.listeners.splice(t,1))}}}emit(e){if(this.destroyed){console.warn(bi(953,!1));return}if(this.listeners===null)return;this.isEmitting=!0;let t=rn(null);try{for(let t of this.listeners)try{t!==null&&t(e)}catch(e){this.errorHandler?.handleError(e)}}finally{this.hasNullListeners&&(this.hasNullListeners=!1,this.listeners&&Zte(this.listeners)),rn(t),this.isEmitting=!1}}};function Zte(e){let t=e.length-1;for(;t>-1;)e[t]===null&&e.splice(t,1),t--}function X(e,t){return Tn(e,t?.equal)}function Z(e){return Qn(e)}(class e extends Error{_brand;constructor(e){super(e)}static IDLE=new e(`IDLE`);static LOADING=new e(`LOADING`)});var Qte=e=>e;function Q(e,t){return typeof e==`function`?gv(Jn(e,Qte,t?.equal),t?.debugName,t?.set):gv(Jn(e.source,e.computation,e.equal),e.debugName,e.set)}function gv(e,t,n){let r=e[nn],i=e;if(n!==void 0){let t=e=>Yn(r,e);i.set=e=>n(e,t),i.update=r=>n(r(Z(e)),t)}else i.set=e=>Yn(r,e),i.update=e=>Xn(r,e);return i.asReadonly=oc.bind(e),i}var _v=!1;function $te(){return _v}function vv(e){_v=e}function yv(e,t){let n=Object.create(Ac);n.value=e,n.transformFn=t?.transform;function r(){if(sn(n),n.value===kc)throw new vi(-950,null);return n.value}return r[nn]=n,r}function bv(e){return new hv}function xv(e,t){return yv(e,t)}function ene(e){return yv(kc,e)}var $=(xv.required=ene,xv);function Sv(e,t){let n=Object.create(Ac),r=new hv;n.value=e;function i(){return sn(n),Cv(n.value),n.value}return i[nn]=n,i.asReadonly=oc.bind(i),i.set=e=>{n.equal(n.value,e)||(Ln(n,e),r.emit(e))},i.update=e=>{Cv(n.value),i.set(e(n.value))},i.subscribe=r.subscribe.bind(r),i.destroyRef=r.destroyRef,i}function Cv(e){if(e===kc)throw new vi(952,!1)}function wv(e,t){return Sv(e,t)}function tne(e){return Sv(kc,e)}var Tv=(wv.required=tne,wv);function Ev(e,t){return vh(t)}function nne(e,t){return yh(t)}var Dv=(Ev.required=nne,Ev),rne=(()=>{class e{static __NG_ELEMENT_ID__=ine}return e})();function ine(e){return ane(Yo(),qo(),(e&16)==16)}function ane(e,t,n){if(ho(e)&&!n){let n=Oo(e.index,t);return new dp(n,n)}if(e.type&175){let e=t[15];return new dp(e,t)}return null}var Ov=new Ii(``),one=new Ii(``);function kv(e){return!e.moduleRef}function sne(e){let t=kv(e)?e.r3Injector:e.moduleRef.injector,n=t.get(Gs);return n.run(()=>{kv(e)?e.r3Injector.resolveInjectorInitializers():e.moduleRef.resolveInjectorInitializers();let r=t.get(ic),i;if(n.runOutsideAngular(()=>{i=n.onError.subscribe({next:r})}),kv(e)){let n=()=>t.destroy(),r=e.platformInjector.get(Ov);r.add(n),t.onDestroy(()=>{i.unsubscribe(),r.delete(n)})}else{let t=()=>e.moduleRef.destroy(),n=e.platformInjector.get(Ov);n.add(t),e.moduleRef.onDestroy(()=>{og(e.allPlatformModules,e.moduleRef),i.unsubscribe(),n.delete(t)})}return lne(r,n,()=>{let n=t.get(Ls),r=n.add(),i=t.get(Rh);return i.runInitializers(),i.donePromise.then(()=>{if(qg(t.get(mv,Kg)||`en-US`),!t.get(one,!0))return kv(e)?t.get(ig):(e.allPlatformModules.push(e.moduleRef),e.moduleRef);if(kv(e)){let n=t.get(ig);return e.rootComponent!==void 0&&n.bootstrap(e.rootComponent),n}return cne?.(e.moduleRef,e.allPlatformModules),e.moduleRef}).finally(()=>void n.remove(r))})})}var cne;function lne(e,t,n){try{let r=n();return Sh(r)?r.catch(n=>{throw t.runOutsideAngular(()=>e(n)),n}):r}catch(n){throw t.runOutsideAngular(()=>e(n)),n}}var Av=null;function une(e=[],t){return js.create({name:t,providers:[{provide:Ga,useValue:`platform`},{provide:Ov,useValue:new Set([()=>Av=null])},...e]})}function dne(e=[]){if(Av)return Av;let t=une(e);return Av=t,ng(),fne(t),t}function fne(e){let t=e.get(lc,null);co(e,()=>{t?.forEach(e=>e())})}function pne(e){let{rootComponent:t,appProviders:n,platformProviders:r,platformRef:i}=e;Gc(Mc.BootstrapApplicationStart);try{let e=i?.injector??dne(r);return sne({r3Injector:new Th({providers:[Yte(),ac,...n||[]],parent:e,debugName:``,runEnvironmentInitializers:!1}).injector,platformInjector:e,rootComponent:t})}catch(e){return Promise.reject(e)}finally{Gc(Mc.BootstrapApplicationEnd)}}function jv(e){return typeof e==`boolean`?e:e!=null&&e!==`false`}var Mv=Symbol(`NOT_SET`),Nv=new Set,mne={...zn,kind:`afterRenderEffectPhase`,consumerIsAlwaysLive:!0,consumerAllowSignalWrites:!0,value:Mv,cleanup:null,consumerMarkedDirty(){if(this.sequence.impl.executing){if(this.sequence.lastPhase===null||this.sequence.lastPhase(sn(r),r.value),r.signal[nn]=r,r.registerCleanupFn=e=>(r.cleanup??=new Set).add(e),this.nodes[e]=r,this.hooks[e]=e=>r.phaseFn(e)}}afterRun(){super.afterRun(),this.lastPhase=null}destroy(){if(this.onDestroyFns!==null)for(let e of this.onDestroyFns)e();super.destroy();for(let e of this.nodes)if(e)try{for(let t of e.cleanup??Nv)t()}finally{yn(e)}}};function Pv(e,t){let n=t?.injector??C(js),r=n.get(mc),i=n.get(sd),a=n.get(id,null,{optional:!0});i.impl??=n.get(ld);let o=e;typeof o==`function`&&(o={mixedReadWrite:e});let s=n.get(fc,null,{optional:!0}),c=new hne(i.impl,[o.earlyRead,o.write,o.mixedReadWrite,o.read],s?.view,r,n,a?.snapshot(null));return i.impl.register(c),c}var Fv=null;function Iv(){return Fv}function gne(e){Fv??=e}var _ne=class{},Lv=(function(e){return e[e.Format=0]=`Format`,e[e.Standalone=1]=`Standalone`,e})(Lv||{}),Rv=(function(e){return e[e.Narrow=0]=`Narrow`,e[e.Abbreviated=1]=`Abbreviated`,e[e.Wide=2]=`Wide`,e[e.Short=3]=`Short`,e})(Rv||{}),zv=(function(e){return e[e.Short=0]=`Short`,e[e.Medium=1]=`Medium`,e[e.Long=2]=`Long`,e[e.Full=3]=`Full`,e})(zv||{}),Bv={Decimal:0,Group:1,List:2,PercentSign:3,PlusSign:4,MinusSign:5,Exponential:6,SuperscriptingExponent:7,PerMille:8,Infinity:9,NaN:10,TimeSeparator:11,CurrencyDecimal:12,CurrencyGroup:13};function vne(e){return Hg(e)[Wg.LocaleId]}function yne(e,t,n){let r=Hg(e);return Kv(Kv([r[Wg.DayPeriodsFormat],r[Wg.DayPeriodsStandalone]],t),n)}function bne(e,t,n){let r=Hg(e);return Kv(Kv([r[Wg.DaysFormat],r[Wg.DaysStandalone]],t),n)}function xne(e,t,n){let r=Hg(e);return Kv(Kv([r[Wg.MonthsFormat],r[Wg.MonthsStandalone]],t),n)}function Sne(e,t){let n=Hg(e)[Wg.Eras];return Kv(n,t)}function Vv(e,t){return Kv(Hg(e)[Wg.DateFormat],t)}function Hv(e,t){return Kv(Hg(e)[Wg.TimeFormat],t)}function Uv(e,t){let n=Hg(e)[Wg.DateTimeFormat];return Kv(n,t)}function Wv(e,t){let n=Hg(e),r=n[Wg.NumberSymbols][t];if(r===void 0){if(t===Bv.CurrencyDecimal)return n[Wg.NumberSymbols][Bv.Decimal];if(t===Bv.CurrencyGroup)return n[Wg.NumberSymbols][Bv.Group]}return r}function Gv(e){if(!e[Wg.ExtraData])throw new vi(2303,!1)}function Cne(e){let t=Hg(e);return Gv(t),(t[Wg.ExtraData][2]||[]).map(e=>typeof e==`string`?qv(e):[qv(e[0]),qv(e[1])])}function wne(e,t,n){let r=Hg(e);return Gv(r),Kv(Kv([r[Wg.ExtraData][0],r[Wg.ExtraData][1]],t)||[],n)||[]}function Kv(e,t){for(let n=t;n>-1;n--)if(e[n]!==void 0)return e[n];throw new vi(2304,!1)}function qv(e){let[t,n]=e.split(`:`);return{hours:+t,minutes:+n}}var Tne=/^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,Jv=Object.create(null),Ene=/((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/,Dne=256;function One(e,t,n,r){let i=dy(e);kne(t),t=Xv(n,t)||t;let a=[],o;for(;t;)if(o=Ene.exec(t),o){a=a.concat(o.slice(1));let e=a.pop();if(!e)break;t=e}else{a.push(t);break}let s=i.getTimezoneOffset();r&&(s=cy(r,s),i=uy(i,r));let c=``;return a.forEach(e=>{let t=sy(e);c+=t?t(i,n,s):e===`''`?`'`:e.replace(/(^'|'$)/g,``).replace(/''/g,`'`)}),c}function kne(e){if(e.length>Dne)throw new vi(2300,!1)}function Yv(e,t,n){let r=new Date(0);return r.setFullYear(e,t,n),r.setHours(0,0,0),r}function Xv(e,t){let n=vne(e);if(Jv[n]??=Object.create(null),Jv[n][t])return Jv[n][t];let r=``;switch(t){case`shortDate`:r=Vv(e,zv.Short);break;case`mediumDate`:r=Vv(e,zv.Medium);break;case`longDate`:r=Vv(e,zv.Long);break;case`fullDate`:r=Vv(e,zv.Full);break;case`shortTime`:r=Hv(e,zv.Short);break;case`mediumTime`:r=Hv(e,zv.Medium);break;case`longTime`:r=Hv(e,zv.Long);break;case`fullTime`:r=Hv(e,zv.Full);break;case`short`:let t=Xv(e,`shortTime`),n=Xv(e,`shortDate`);r=Zv(Uv(e,zv.Short),[t,n]);break;case`medium`:let i=Xv(e,`mediumTime`),a=Xv(e,`mediumDate`);r=Zv(Uv(e,zv.Medium),[i,a]);break;case`long`:let o=Xv(e,`longTime`),s=Xv(e,`longDate`);r=Zv(Uv(e,zv.Long),[o,s]);break;case`full`:let c=Xv(e,`fullTime`),l=Xv(e,`fullDate`);r=Zv(Uv(e,zv.Full),[c,l])}return r&&(Jv[n][t]=r),r}function Zv(e,t){return t&&(e=e.replace(/\{([^}]+)}/g,function(e,n){return Object.hasOwn(t,n)?t[n]:e})),e}function Qv(e,t,n=`-`,r,i){let a=``;(e<0||i&&e<=0)&&(i?e=-e+1:(e=-e,a=n));let o=String(e);for(;o.length0||s>-n)&&(s+=n),e===3)s===0&&n===-12&&(s=12);else if(e===6)return Ane(s,t);let c=Wv(o,Bv.MinusSign);return Qv(s,t,c,r,i)}}function jne(e,t){switch(e){case 0:return t.getFullYear();case 1:return t.getMonth();case 2:return t.getDate();case 3:return t.getHours();case 4:return t.getMinutes();case 5:return t.getSeconds();case 6:return t.getMilliseconds();case 7:return t.getDay();default:throw new vi(2301,!1)}}function ey(e,t,n=Lv.Format,r=!1){return function(i,a){return Mne(i,a,e,t,n,r)}}function Mne(e,t,n,r,i,a){switch(n){case 2:return xne(t,i,r)[e.getMonth()];case 1:return bne(t,i,r)[e.getDay()];case 0:let n=e.getHours(),o=e.getMinutes();if(a){let e=Cne(t),a=wne(t,i,r),s=e.findIndex(e=>{if(Array.isArray(e)){let[t,r]=e,i=n>=t.hours&&o>=t.minutes,a=n0?Math.floor(i/60):Math.ceil(i/60);switch(e){case 0:return(i>=0?`+`:``)+Qv(o,2,a)+Qv(Math.abs(i%60),2,a);case 1:return`GMT`+(i>=0?`+`:``)+Qv(o,1,a);case 2:return`GMT`+(i>=0?`+`:``)+Qv(o,2,a)+`:`+Qv(Math.abs(i%60),2,a);case 3:return r===0?`Z`:(i>=0?`+`:``)+Qv(o,2,a)+`:`+Qv(Math.abs(i%60),2,a);default:throw new vi(2310,!1)}}}var Nne=0,ny=4;function Pne(e){let t=Yv(e,Nne,1).getDay();return Yv(e,0,1+(t<=ny?ny:11)-t)}function ry(e){let t=e.getDay(),n=t===0?-3:ny-t;return Yv(e.getFullYear(),e.getMonth(),e.getDate()+n)}function iy(e,t=!1){return function(n,r){let i;if(t){let e=new Date(n.getFullYear(),n.getMonth(),1).getDay()-1,t=n.getDate();i=1+Math.floor((t+e)/7)}else{let e=ry(n),t=Pne(e.getFullYear()),r=e.getTime()-t.getTime();i=1+Math.round(r/6048e5)}return Qv(i,e,Wv(r,Bv.MinusSign))}}function ay(e,t=!1){return function(n,r){return Qv(ry(n).getFullYear(),e,Wv(r,Bv.MinusSign),t)}}var oy=Object.create(null);function sy(e){if(oy[e])return oy[e];let t;switch(e){case`G`:case`GG`:case`GGG`:t=ey(3,Rv.Abbreviated);break;case`GGGG`:t=ey(3,Rv.Wide);break;case`GGGGG`:t=ey(3,Rv.Narrow);break;case`y`:t=$v(0,1,0,!1,!0);break;case`yy`:t=$v(0,2,0,!0,!0);break;case`yyy`:t=$v(0,3,0,!1,!0);break;case`yyyy`:t=$v(0,4,0,!1,!0);break;case`Y`:t=ay(1);break;case`YY`:t=ay(2,!0);break;case`YYY`:t=ay(3);break;case`YYYY`:t=ay(4);break;case`M`:case`L`:t=$v(1,1,1);break;case`MM`:case`LL`:t=$v(1,2,1);break;case`MMM`:t=ey(2,Rv.Abbreviated);break;case`MMMM`:t=ey(2,Rv.Wide);break;case`MMMMM`:t=ey(2,Rv.Narrow);break;case`LLL`:t=ey(2,Rv.Abbreviated,Lv.Standalone);break;case`LLLL`:t=ey(2,Rv.Wide,Lv.Standalone);break;case`LLLLL`:t=ey(2,Rv.Narrow,Lv.Standalone);break;case`w`:t=iy(1);break;case`ww`:t=iy(2);break;case`W`:t=iy(1,!0);break;case`d`:t=$v(2,1);break;case`dd`:t=$v(2,2);break;case`c`:case`cc`:t=$v(7,1);break;case`ccc`:t=ey(1,Rv.Abbreviated,Lv.Standalone);break;case`cccc`:t=ey(1,Rv.Wide,Lv.Standalone);break;case`ccccc`:t=ey(1,Rv.Narrow,Lv.Standalone);break;case`cccccc`:t=ey(1,Rv.Short,Lv.Standalone);break;case`E`:case`EE`:case`EEE`:t=ey(1,Rv.Abbreviated);break;case`EEEE`:t=ey(1,Rv.Wide);break;case`EEEEE`:t=ey(1,Rv.Narrow);break;case`EEEEEE`:t=ey(1,Rv.Short);break;case`a`:case`aa`:case`aaa`:t=ey(0,Rv.Abbreviated);break;case`aaaa`:t=ey(0,Rv.Wide);break;case`aaaaa`:t=ey(0,Rv.Narrow);break;case`b`:case`bb`:case`bbb`:t=ey(0,Rv.Abbreviated,Lv.Standalone,!0);break;case`bbbb`:t=ey(0,Rv.Wide,Lv.Standalone,!0);break;case`bbbbb`:t=ey(0,Rv.Narrow,Lv.Standalone,!0);break;case`B`:case`BB`:case`BBB`:t=ey(0,Rv.Abbreviated,Lv.Format,!0);break;case`BBBB`:t=ey(0,Rv.Wide,Lv.Format,!0);break;case`BBBBB`:t=ey(0,Rv.Narrow,Lv.Format,!0);break;case`h`:t=$v(3,1,-12);break;case`hh`:t=$v(3,2,-12);break;case`H`:t=$v(3,1);break;case`HH`:t=$v(3,2);break;case`m`:t=$v(4,1);break;case`mm`:t=$v(4,2);break;case`s`:t=$v(5,1);break;case`ss`:t=$v(5,2);break;case`S`:t=$v(6,1);break;case`SS`:t=$v(6,2);break;case`SSS`:t=$v(6,3);break;case`Z`:case`ZZ`:case`ZZZ`:t=ty(0);break;case`ZZZZZ`:t=ty(3);break;case`O`:case`OO`:case`OOO`:case`z`:case`zz`:case`zzz`:t=ty(1);break;case`OOOO`:case`ZZZZ`:case`zzzz`:t=ty(2);break;default:return null}return oy[e]=t,t}function cy(e,t){e=e.replace(/:/g,``);let n=Date.parse(`Jan 01, 1970 00:00:00 `+e)/6e4;return isNaN(n)?t:n}function ly(e,t){return e=new Date(e.getTime()),e.setMinutes(e.getMinutes()+t),e}function uy(e,t,n){let r=e.getTimezoneOffset();return ly(e,-1*(cy(t,r)-r))}function dy(e){if(py(e))return e;if(typeof e==`number`&&!isNaN(e))return new Date(e);if(typeof e==`string`){if(e=e.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(e)){let[t,n=1,r=1]=e.split(`-`).map(e=>+e);return Yv(t,n-1,r)}let t=parseFloat(e);if(!isNaN(e-t))return new Date(t);let n;if(n=e.match(Tne))return fy(n)}let t=new Date(e);if(!py(t))throw new vi(2311,!1);return t}function fy(e){let t=new Date(0),n=0,r=0,i=e[8]?t.setUTCFullYear:t.setFullYear,a=e[8]?t.setUTCHours:t.setHours;e[9]&&(n=Number(e[9]+e[10]),r=Number(e[9]+e[11])),i.call(t,Number(e[1]),Number(e[2])-1,Number(e[3]));let o=Number(e[4]||0)-n,s=Number(e[5]||0)-r,c=Number(e[6]||0),l=Math.floor(parseFloat(`0.`+(e[7]||0))*1e3);return a.call(t,o,s,c,l),t}function py(e){return e instanceof Date&&!isNaN(e.valueOf())}var my=(()=>{class e{_viewContainerRef;_viewRef=null;ngTemplateOutletContext=null;ngTemplateOutlet=null;ngTemplateOutletInjector=null;injector=C(js);constructor(e){this._viewContainerRef=e}ngOnChanges(e){if(this._shouldRecreateView(e)){let e=this._viewContainerRef;if(this._viewRef&&e.remove(e.indexOf(this._viewRef)),!this.ngTemplateOutlet){this._viewRef=null;return}let t=this._createContextForwardProxy();this._viewRef=e.createEmbeddedView(this.ngTemplateOutlet,t,{injector:this._getInjector()})}}_getInjector(){return this.ngTemplateOutletInjector===`outlet`?this.injector:this.ngTemplateOutletInjector??void 0}_shouldRecreateView(e){return!!e.ngTemplateOutlet||!!e.ngTemplateOutletInjector}_createContextForwardProxy(){return new Proxy({},{set:(e,t,n)=>this.ngTemplateOutletContext?Reflect.set(this.ngTemplateOutletContext,t,n):!1,get:(e,t,n)=>{if(this.ngTemplateOutletContext)return Reflect.get(this.ngTemplateOutletContext,t,n)}})}static ɵfac=function(t){return new(t||e)(cm(Hm))};static ɵdir=jh({type:e,selectors:[[``,`ngTemplateOutlet`,``]],inputs:{ngTemplateOutletContext:`ngTemplateOutletContext`,ngTemplateOutlet:`ngTemplateOutlet`,ngTemplateOutletInjector:`ngTemplateOutletInjector`},features:[Ic]})}return e})();function hy(e,t){return new vi(2100,!1)}var gy=`mediumDate`,_y=new Ii(``),vy=new Ii(``),yy=(()=>{class e{locale;defaultTimezone;defaultOptions;constructor(e,t,n){this.locale=e,this.defaultTimezone=t,this.defaultOptions=n}transform(t,n,r,i){if(t==null||t===``||t!==t)return null;try{let e=n??this.defaultOptions?.dateFormat??gy,a=r??this.defaultOptions?.timezone??this.defaultTimezone??void 0;return One(t,e,i||this.locale,a)}catch(t){throw hy(e,t.message)}}static ɵfac=function(t){return new(t||e)(cm(mv,16),cm(_y,24),cm(vy,24))};static ɵpipe=Mh({name:`date`,type:e,pure:!0})}return e})(),by=(()=>{class e{transform(e){return JSON.stringify(e,null,2)}static ɵfac=function(t){return new(t||e)};static ɵpipe=Mh({name:`json`,type:e,pure:!1})}return e})();function xy(e,t){t=encodeURIComponent(t);for(let n of e.split(`;`)){let e=n.indexOf(`=`),[r,i]=e==-1?[n,``]:[n.slice(0,e),n.slice(e+1)];if(r.trim()!==t)continue;let a=i;try{a=decodeURIComponent(i)}catch{}return a.length>1&&a[0]===`"`&&a[a.length-1]===`"`&&(a=a.slice(1,-1)),a}return null}var Sy=`browser`,Cy=class{_doc;constructor(e){this._doc=e}manager},wy=(()=>{class e extends Cy{constructor(e){super(e)}supports(e){return!0}addEventListener(e,t,n,r){return e.addEventListener(t,n,r),()=>this.removeEventListener(e,t,n,r)}removeEventListener(e,t,n,r){return e.removeEventListener(t,n,r)}static ɵfac=function(t){return new(t||e)(da(Ms))};static ɵprov=ki({token:e,factory:e.ɵfac})}return e})(),Ty=new Ii(``),Ey=(()=>{class e{_zone;_plugins;_eventNameToPlugin=new Map;constructor(e,t){this._zone=t,e.forEach(e=>{e.manager=this});let n=e.filter(e=>!(e instanceof wy));this._plugins=n.slice().reverse();let r=e.find(e=>e instanceof wy);r&&this._plugins.push(r)}addEventListener(e,t,n,r){return this._findPluginFor(t).addEventListener(e,t,n,r)}getZone(){return this._zone}_findPluginFor(e){let t=this._eventNameToPlugin.get(e);if(t)return t;if(t=this._plugins.find(t=>t.supports(e)),!t)throw new vi(-5101,!1);return this._eventNameToPlugin.set(e,t),t}static ɵfac=function(t){return new(t||e)(da(Ty),da(Gs))};static ɵprov=ki({token:e,factory:e.ɵfac})}return e})(),Dy=`ng-app-id`;function Oy(e){for(let t of e)t.remove()}function ky(e,t){let n=t.createElement(`style`);return n.textContent=e,n}function Ay(e,t,n,r){let i=e.head?.querySelectorAll(`style[${Dy}="${t}"],link[${Dy}="${t}"]`);if(!i||i.length===0)return!1;for(let e of i)e.removeAttribute(Dy),e instanceof HTMLLinkElement?r.set(e.href.slice(e.href.lastIndexOf(`/`)+1),{usage:0,elements:[e]}):e.textContent&&n.set(e.textContent,{usage:0,elements:[e]});return!0}function jy(e,t){let n=t.createElement(`link`);return n.setAttribute(`rel`,`stylesheet`),n.setAttribute(`href`,e),n}var My=(()=>{class e{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;constructor(e,t,n,r={}){this.doc=e,this.appId=t,this.nonce=n,Ay(e,t,this.inline,this.external)&&this.hosts.add(e.head)}addStyles(e,t){for(let t of e)this.addUsage(t,this.inline,ky);t?.forEach(e=>this.addUsage(e,this.external,jy))}removeStyles(e,t){for(let t of e)this.removeUsage(t,this.inline);t?.forEach(e=>this.removeUsage(e,this.external))}addUsage(e,t,n){let r=t.get(e);r?r.usage++:t.set(e,{usage:1,elements:[...this.hosts].map(t=>this.addElement(t,n(e,this.doc)))})}removeUsage(e,t){let n=t.get(e);n&&(n.usage--,n.usage<=0&&(Oy(n.elements),t.delete(e)))}ngOnDestroy(){for(let[,{elements:e}]of[...this.inline,...this.external])Oy(e);this.hosts.clear()}addHost(e){if(!this.hosts.has(e)){this.hosts.add(e);for(let[t,{elements:n}]of this.inline)n.push(this.addElement(e,ky(t,this.doc)));for(let[t,{elements:n}]of this.external)n.push(this.addElement(e,jy(t,this.doc)))}}removeHost(e){this.hosts.delete(e);for(let t of[...this.inline.values(),...this.external.values()]){let n=[];for(let r of t.elements)r.parentNode===e?r.remove():n.push(r);t.elements=n}}addElement(e,t){return this.nonce&&t.setAttribute(`nonce`,this.nonce),e.appendChild(t)}static ɵfac=function(t){return new(t||e)(da(Ms),da(sc),da(dc,8),da(uc))};static ɵprov=ki({token:e,factory:e.ɵfac})}return e})(),Ny={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`,math:`http://www.w3.org/1998/Math/MathML`},Py=/%COMP%/g,Fy=`%COMP%`,Iy=`_nghost-${Fy}`,Ly=`_ngcontent-${Fy}`,Ry=!0,zy=new Ii(``,{factory:()=>Ry}),By=new Ii(``);function Vy(e){return Ly.replace(Py,e)}function Hy(e){return Iy.replace(Py,e)}function Uy(e,t){return t.map(t=>t.replace(Py,e))}var Wy=(()=>{class e{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;cssVarNamespace;constructor(e,t,n,r,i,a,o=null,s=null,c=null){this.eventManager=e,this.sharedStylesHost=t,this.appId=n,this.removeStylesOnCompDestroy=r,this.doc=i,this.ngZone=a,this.nonce=o,this.tracingService=s,this.cssVarNamespace=c??``,this.defaultRenderer=new Gy(e,i,a,this.tracingService,this.cssVarNamespace)}createRenderer(e,t){if(!e||!t)return this.defaultRenderer;let n=this.getOrCreateRenderer(e,t);return n instanceof Yy?n.applyToHost(e):n instanceof Jy&&n.applyStyles(),n}getOrCreateRenderer(e,t){let n=this.rendererByCompId,r=n.get(t.id);if(!r){let i=this.doc,a=this.ngZone,o=this.eventManager,s=this.sharedStylesHost,c=this.removeStylesOnCompDestroy,l=this.tracingService;switch(t.encapsulation){case yu.Emulated:r=new Yy(o,s,t,this.appId,c,i,a,l,this.cssVarNamespace);break;case yu.ShadowDom:return new qy(o,e,t,i,a,this.nonce,l,this.cssVarNamespace,s);case yu.ExperimentalIsolatedShadowDom:return new qy(o,e,t,i,a,this.nonce,l,this.cssVarNamespace);default:r=new Jy(o,s,t,c,i,a,l,this.cssVarNamespace)}n.set(t.id,r)}return r}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(e){this.rendererByCompId.delete(e)}static ɵfac=function(t){return new(t||e)(da(Ey),da(om),da(sc),da(zy),da(Ms),da(Gs),da(dc),da(id,8),da(By,8))};static ɵprov=ki({token:e,factory:e.ɵfac})}return e})(),Gy=class{eventManager;doc;ngZone;tracingService;cssVarNamespace;data=Object.create(null);throwOnSyntheticProps=!0;constructor(e,t,n,r,i=``){this.eventManager=e,this.doc=t,this.ngZone=n,this.tracingService=r,this.cssVarNamespace=i}destroy(){}destroyNode=null;createElement(e,t){return t?this.doc.createElementNS(Ny[t]||t,e):this.doc.createElement(e)}createComment(e){return this.doc.createComment(e)}createText(e){return this.doc.createTextNode(e)}appendChild(e,t){(Ky(e)?e.content:e).appendChild(t)}insertBefore(e,t,n){if(e){let r=Ky(e)?e.content:e;if(n!=null&&n.parentNode!==r)throw new vi(-5106,!1);r.insertBefore(t,n)}}removeChild(e,t){t.remove()}selectRootElement(e,t){let n=typeof e==`string`?this.doc.querySelector(e):e;if(!n)throw new vi(-5104,!1);return t||(n.textContent=``),n}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,n,r){if(r){t=r+`:`+t;let i=Ny[r];i?e.setAttributeNS(i,t,n):e.setAttribute(t,n)}else e.setAttribute(t,n)}removeAttribute(e,t,n){if(n){let r=Ny[n];r?e.removeAttributeNS(r,t):e.removeAttribute(`${n}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,n,r){let i=t.startsWith(`--`);i&&(t=t.replace(`%NS%`,this.cssVarNamespace)),i||r&(zu.DashCase|zu.Important)?e.style.setProperty(t,n,r&zu.Important?`important`:``):e.style[t]=n}removeStyle(e,t,n){let r=t.startsWith(`--`);r&&(t=t.replace(`%NS%`,this.cssVarNamespace)),r||n&zu.DashCase?e.style.removeProperty(t):e.style[t]=``}setProperty(e,t,n){e!=null&&(e[t]=n)}setValue(e,t){e.nodeValue=t}listen(e,t,n,r){if(typeof e==`string`&&(e=Iv().getGlobalEventTarget(this.doc,e),!e))throw new vi(-5102,!1);let i=this.decoratePreventDefault(n);return this.tracingService?.wrapEventListener&&(i=this.tracingService.wrapEventListener(e,t,i)),this.eventManager.addEventListener(e,t,i,r)}decoratePreventDefault(e){return t=>{if(t===`__ngUnwrap__`)return e;e(t)===!1&&t.preventDefault()}}};function Ky(e){return e.tagName===`TEMPLATE`&&e.content!==void 0}var qy=class extends Gy{hostEl;sharedStylesHost;shadowRoot;constructor(e,t,n,r,i,a,o,s,c){super(e,r,i,o,s),this.hostEl=t,this.sharedStylesHost=c,this.shadowRoot=t.attachShadow({mode:`open`}),this.sharedStylesHost&&this.sharedStylesHost.addHost(this.shadowRoot);let l=n.styles;l=Uy(n.id,l).map(e=>e.replace(/%NS%/g,s));for(let e of l){let t=document.createElement(`style`);a&&t.setAttribute(`nonce`,a),t.textContent=e,this.shadowRoot.appendChild(t)}let u=n.getExternalStyles?.();if(u)for(let e of u){let t=jy(e,r);a&&t.setAttribute(`nonce`,a),this.shadowRoot.appendChild(t)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}appendChild(e,t){return super.appendChild(this.nodeOrShadowRoot(e),t)}insertBefore(e,t,n){return super.insertBefore(this.nodeOrShadowRoot(e),t,n)}removeChild(e,t){return super.removeChild(null,t)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}destroy(){this.sharedStylesHost&&this.sharedStylesHost.removeHost(this.shadowRoot)}},Jy=class extends Gy{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(e,t,n,r,i,a,o,s,c){super(e,i,a,o,s),this.sharedStylesHost=t,this.removeStylesOnCompDestroy=r;let l=n.styles,u=c?Uy(c,l):l;this.styles=u.map(e=>e.replace(/%NS%/g,s)),this.styleUrls=n.getExternalStyles?.(c)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&Ku.size===0&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},Yy=class extends Jy{contentAttr;hostAttr;constructor(e,t,n,r,i,a,o,s,c){let l=r+`-`+n.id;super(e,t,n,i,a,o,s,c,l),this.contentAttr=Vy(l),this.hostAttr=Hy(l)}applyToHost(e){this.applyStyles(),this.setAttribute(e,this.hostAttr,``)}createElement(e,t){let n=super.createElement(e,t);return super.setAttribute(n,this.contentAttr,``),n}},Xy=class e extends _ne{supportsDOMEvents=!0;static makeCurrent(){gne(new e)}onAndCancel(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.remove()}createElement(e,t){return t||=this.getDefaultDocument(),t.createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument(`fakeTitle`)}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return t===`window`?window:t===`document`?e:t===`body`?e.body:null}getBaseHref(e){let t=Qy();return t==null?null:$y(t)}resetBaseElement(){Zy=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return xy(document.cookie,e)}},Zy=null;function Qy(){return Zy||=document.head.querySelector(`base`),Zy?Zy.getAttribute(`href`):null}function $y(e){return new URL(e,document.baseURI).pathname}var eb=[`alt`,`control`,`meta`,`shift`],tb={"\b":`Backspace`," ":`Tab`,"":`Delete`,"\x1B":`Escape`,Del:`Delete`,Esc:`Escape`,Left:`ArrowLeft`,Right:`ArrowRight`,Up:`ArrowUp`,Down:`ArrowDown`,Menu:`ContextMenu`,Scroll:`ScrollLock`,Win:`OS`},nb={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey},rb=(()=>{class e extends Cy{constructor(e){super(e)}supports(t){return e.parseEventName(t)!=null}addEventListener(t,n,r,i){let a=e.parseEventName(n),o=e.eventCallback(a.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Iv().onAndCancel(t,a.domEventName,o,i))}static parseEventName(t){let n=t.toLowerCase().split(`.`),r=n.shift();if(n.length===0||r!==`keydown`&&r!==`keyup`)return null;let i=e._normalizeKey(n.pop()),a=``,o=n.indexOf(`code`);if(o>-1&&(n.splice(o,1),a=`code.`),eb.forEach(e=>{let t=n.indexOf(e);t>-1&&(n.splice(t,1),a+=e+`.`)}),a+=i,n.length!=0||i.length===0)return null;let s={};return s.domEventName=r,s.fullKey=a,s}static matchEventFullKeyCode(e,t){let n=tb[e.key]||e.key,r=``;return t.indexOf(`code.`)>-1&&(n=e.code,r=`code.`),n==null||!n?!1:(n=n.toLowerCase(),n===` `?n=`space`:n===`.`&&(n=`dot`),eb.forEach(t=>{if(t!==n){let n=nb[t];n(e)&&(r+=t+`.`)}}),r+=n,r===t)}static eventCallback(t,n,r){return i=>{e.matchEventFullKeyCode(i,t)&&r.runGuarded(()=>n(i))}}static _normalizeKey(e){return e===`esc`?`escape`:e}static ɵfac=function(t){return new(t||e)(da(Ms))};static ɵprov=ki({token:e,factory:e.ɵfac})}return e})();async function ib(e,t,n){return pne({rootComponent:e,...ab(t,n)})}function ab(e,t){return{platformRef:t?.platformRef,appProviders:[...ub,...e?.providers??[]],platformProviders:lb}}function ob(){Xy.makeCurrent()}function sb(){return new rc}function cb(){return su(document),document}var lb=[{provide:uc,useValue:Sy},{provide:lc,useValue:ob,multi:!0},{provide:Ms,useFactory:cb}],ub=[{provide:Ga,useValue:`root`},{provide:rc,useFactory:sb},{provide:Ty,useClass:wy,multi:!0},{provide:Ty,useClass:rb,multi:!0},Wy,{provide:om,useClass:My},{provide:My,useExisting:om},Ey,{provide:Ep,useExisting:Wy},[]];function db(e,t){let n=`\x1B[${e}m`,r=`\x1B[${t}m`;return((e,...t)=>{if(Array.isArray(e)&&`raw`in e){let i=e,a=``;for(let e=0;e{let r=new hb({code:i,why:pb(a.why,e),fix:pb(a.fix,e),docs:o,cause:e.cause,sources:e.sources,data:pb(a.data,e)},s);for(let e of t)e(r,n);return r};n[i]=s}return n}function vb(e){return t=>{let n=`${e.bold(e.red(`[${t.name}]`))} ${t.message}`,r=[];return t.fix&&r.push(`${e.dim(`fix:`)} ${t.fix}`),t.sources?.length&&r.push(`${e.dim(`sources:`)} ${t.sources.join(`, `)}`),t.docs&&r.push(`${e.dim(`see:`)} ${e.cyan(t.docs)}`),r.length===0?n:[n,...r.map((t,n)=>`${e.dim(n{e=n,t=r}),resolve:e,reject:t}}var wb=Math.random.bind(Math),Tb=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function Eb(e=21){let t=``,n=e;for(;n--;)t+=Tb[wb()*64|0];return t}var Db=6e4,Ob=e=>e,kb=Ob,{clearTimeout:Ab,setTimeout:jb}=globalThis;function Mb(e,t){let{post:n,on:r,off:i=()=>{},eventNames:a=[],serialize:o=Ob,deserialize:s=kb,resolver:c,bind:l=`rpc`,timeout:u=Db,proxify:d=!0}=t,f=!1,p=new Map,m,h;async function g(e,r,i,a){if(f)throw Error(`[birpc] rpc is closed, cannot call "${e}"`);let s={m:e,a:r,t:`q`};a&&(s.o=!0);let c=async e=>n(o(e));if(i){await c(s);return}if(m)try{await m}finally{m=void 0}let{promise:l,resolve:d,reject:g}=Cb(),_=Eb();s.i=_;let ee;async function te(n=s){return u>=0&&(ee=jb(()=>{try{if(t.onTimeoutError?.call(h,e,r)!==!0)throw Error(`[birpc] timeout on calling "${e}"`)}catch(e){g(e)}p.delete(_)},u),typeof ee==`object`&&(ee=ee.unref?.())),p.set(_,{resolve:d,reject:g,timeoutId:ee,method:e}),await c(n),l}try{t.onRequest?await t.onRequest.call(h,s,te,d):await te()}catch(e){if(t.onGeneralError?.call(h,e)!==!0)throw e;return}finally{Ab(ee),p.delete(_)}return l}let _={$call:(e,...t)=>g(e,t,!1),$callOptional:(e,...t)=>g(e,t,!1,!0),$callEvent:(e,...t)=>g(e,t,!0),$callRaw:e=>g(e.method,e.args,e.event,e.optional),$rejectPendingCalls:te,get $closed(){return f},get $meta(){return t.meta},$close:ee,$functions:e};h=d?new Proxy({},{get(t,n){if(Object.hasOwn(_,n))return _[n];if(n===`then`&&!a.includes(`then`)&&!(`then`in e))return;let r=(...e)=>g(n,e,!0);if(a.includes(n))return r.asEvent=r,r;let i=(...e)=>g(n,e,!1);return i.asEvent=r,i}}):_;function ee(e){f=!0,p.forEach(({reject:t,method:n})=>{let r=Error(`[birpc] rpc is closed, cannot call "${n}"`);if(e)return e.cause??=r,t(e);t(r)}),p.clear(),i(ne)}function te(e){let t=Array.from(p.values()).map(({method:t,reject:n})=>e?e({method:t,reject:n}):n(Error(`[birpc]: rejected pending call "${t}".`)));return p.clear(),t}async function ne(r,...i){let a;try{a=s(r)}catch(e){if(t.onGeneralError?.call(h,e)!==!0)throw e;return}if(a.t===`q`){let{m:r,a:s,o:u}=a,d,f,p=await(c?c.call(h,r,e[r]):e[r]);if(u&&(p||=()=>void 0),!p)f=Error(`[birpc] function "${r}" not found`);else try{d=await p.apply(l===`rpc`?h:e,s)}catch(e){f=e}if(a.i){if(f&&t.onFunctionError&&t.onFunctionError.call(h,f,r,s)===!0)return;if(!f)try{await n(o({t:`s`,i:a.i,r:d}),...i);return}catch(e){if(f=e,t.onGeneralError?.call(h,e,r,s)!==!0)throw e}try{await n(o({t:`s`,i:a.i,e:f}),...i)}catch(e){if(t.onGeneralError?.call(h,e,r,s)!==!0)throw e}}}else{let{i:e,r:t,e:n}=a,r=p.get(e);r&&(Ab(r.timeoutId),n?r.reject(n):r.resolve(t)),p.delete(e)}}return m=r(ne),h}function Nb(e,t){return t.safety?t.safety:e===`static`||e===`query`||e==null?`read`:`action`}var Pb=Object.freeze({type:`object`,additionalProperties:!0});function Fb(e){let t=e[`~standard`];if(t.jsonSchema)try{return t.jsonSchema.input({target:`draft-2020-12`})}catch{return Pb}return Pb}function Ib(e){if(!e||e.length===0)return{type:`object`,properties:{}};let t={},n=[];for(let r=0;rn[`arg${t}`]);if(`arg0`in n){let e=[];for(;`arg${e.length}`in n;)e.push(n[`arg${e.length}`]);return e}return Object.keys(n).length===0?[]:void 0}function Rb(e,t){return Lb(e,t)??[e]}function zb(e){return typeof e==`string`?`'${e}'`:new Ub().serialize(e)}var Bb=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,Vb=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[Bb.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function Hb(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;ia?-1:1)}return e.length===t.length?r:e.lengththis.compare(e[0],t[0])),r=`${e}{`;for(let e=0;ethis.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`,`)}]`};for(let t of[`BigInt64Array`,`BigUint64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`n,`)}${e.length>0?`n`:``}]`};return e})(),Wb=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],Gb=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],Kb=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`,qb=[],Jb=class{_data=new Yb;_hash=new Yb([...Wb]);_nDataBytes=0;_minBufferSize=0;finalize(e){e&&this._append(e);let t=this._nDataBytes*8,n=this._data.sigBytes*8;return this._data.words[n>>>5]|=128<<24-n%32,this._data.words[(n+64>>>9<<4)+14]=Math.floor(t/4294967296),this._data.words[(n+64>>>9<<4)+15]=t,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(e,t){let n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7];for(let n=0;n<64;n++){if(n<16)qb[n]=e[t+n]|0;else{let e=qb[n-15],t=(e<<25|e>>>7)^(e<<14|e>>>18)^e>>>3,r=qb[n-2],i=(r<<15|r>>>17)^(r<<13|r>>>19)^r>>>10;qb[n]=t+qb[n-7]+i+qb[n-16]}let d=s&c^~s&l,f=r&i^r&a^i&a,p=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),m=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),h=u+m+d+Gb[n]+qb[n],g=p+f;u=l,l=c,c=s,s=o+h|0,o=a,a=i,i=r,r=h+g|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+o|0,n[4]=n[4]+s|0,n[5]=n[5]+c|0,n[6]=n[6]+l|0,n[7]=n[7]+u|0}_append(e){typeof e==`string`&&(e=Yb.fromUtf8(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_process(e){let t,n=this._data.sigBytes/64;n=e?Math.ceil(n):Math.max((n|0)-this._minBufferSize,0);let r=n*16,i=Math.min(r*4,this._data.sigBytes);if(r){for(let e=0;e>>2]|=(n.charCodeAt(e)&255)<<24-e%4*8;return new e(i,r)}toBase64(){let e=[];for(let t=0;t>>2]>>>24-t%4*8&255,r=this.words[t+1>>>2]>>>24-(t+1)%4*8&255,i=this.words[t+2>>>2]>>>24-(t+2)%4*8&255,a=n<<16|r<<8|i;for(let n=0;n<4&&t*8+n*6>>6*(3-n)&63))}return e.join(``)}concat(e){if(this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4),this.sigBytes%4)for(let t=0;t>>2]>>>24-t%4*8&255;this.words[this.sigBytes+t>>>2]|=n<<24-(this.sigBytes+t)%4*8}else for(let t=0;t>>2]=e.words[t>>>2];this.sigBytes+=e.sigBytes}};function Xb(e){return new Jb().finalize(e).toBase64()}function Zb(e){return Xb(zb(e))}function Qb(e){return Zb(e)}function $b(){let e={};function t(t,...n){let r=e[t]||[];for(let e=0,t=r.length;e{e[t]=e[t]?.filter(e=>n!==e)}}function i(e,t){let n=r(e,((...e)=>(n(),t(...e))));return n}return{_listeners:e,emit:t,emitOnce:n,on:r,once:i}}var ex=/^[\w+.-]{2,}:\/\//;function tx(e){return e.endsWith(`/`)?e:`${e}/`}function nx(e){return(e.endsWith(`/`)?e.slice(0,-1):e)||`/`}function rx(e,...t){let n=e;for(let e of t)e&&e!==`/`&&(n=n?tx(n)+e.replace(/^\.?\//,``):e);return n}function ix(e,t){if(!t||t===`/`||ex.test(e))return e;let n=nx(t);return e.startsWith(n)?e:rx(n,e)}function ax(e,t){let n=e.match(ex);return t+(n?e.slice(n[0].length):e)}var ox=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function sx(e=21){let t=``,n=e;for(;n--;)t+=ox[Math.random()*64|0];return t}var cx=Symbol.for(`immer-nothing`),lx=Symbol.for(`immer-draftable`),ux=Symbol.for(`immer-state`),dx=[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},`This object has been frozen and should not be mutated`,function(e){return`Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? `+e},`An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.`,`Immer forbids circular references`,"The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},`Object.defineProperty() cannot be used on an Immer draft`,`Object.setPrototypeOf() cannot be used on an Immer draft`,`Immer only supports deleting array indices`,`Immer only supports setting array indices and the 'length' property`,function(e){return`'original' expects a draft, got: ${e}`}];function fx(e,...t){{let n=dx[e],r=Ix(n)?n.apply(null,t):n;throw Error(`[Immer] ${r}`)}}var px=Object,mx=px.getPrototypeOf,hx=`constructor`,gx=`prototype`,_x=`configurable`,vx=`enumerable`,yx=`writable`,bx=`value`,xx=e=>!!e&&!!e[ux];function Sx(e){return e?Tx(e)||Mx(e)||!!e[lx]||!!e[hx]?.[lx]||Nx(e)||Px(e):!1}var Cx=px[gx][hx].toString(),wx=new WeakMap;function Tx(e){if(!e||!Fx(e))return!1;let t=mx(e);if(t===null||t===px[gx])return!0;let n=px.hasOwnProperty.call(t,hx)&&t[hx];if(n===Object)return!0;if(!Ix(n))return!1;let r=wx.get(n);return r===void 0&&(r=Function.toString.call(n),wx.set(n,r)),r===Cx}function Ex(e,t,n=!0){Dx(e)===0?(n?Reflect.ownKeys(e):px.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Dx(e){let t=e[ux];return t?t.type_:Mx(e)?1:Nx(e)?2:Px(e)?3:0}var Ox=(e,t,n=Dx(e))=>n===2?e.has(t):px[gx].hasOwnProperty.call(e,t),kx=(e,t,n=Dx(e))=>n===2?e.get(t):e[t],Ax=(e,t,n,r=Dx(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function jx(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var Mx=Array.isArray,Nx=e=>e instanceof Map,Px=e=>e instanceof Set,Fx=e=>typeof e==`object`,Ix=e=>typeof e==`function`,Lx=e=>typeof e==`boolean`;function Rx(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var zx=e=>Fx(e)?e?.[ux]:null,Bx=e=>e.copy_||e.base_,Vx=e=>e.modified_?e.copy_:e.base_;function Hx(e,t){if(Nx(e))return new Map(e);if(Px(e))return new Set(e);if(Mx(e))return Array[gx].slice.call(e);let n=Tx(e);if(t===!0||t===`class_only`&&!n){let t=px.getOwnPropertyDescriptors(e);delete t[ux];let n=Reflect.ownKeys(t);for(let r=0;r1&&px.defineProperties(e,{set:Gx,add:Gx,clear:Gx,delete:Gx}),px.freeze(e),t&&Ex(e,(e,t)=>{Ux(t,!0)},!1),e)}function Wx(){fx(2)}var Gx={[bx]:Wx};function Kx(e){return e===null||!Fx(e)||px.isFrozen(e)}var qx=`MapSet`,Jx=`Patches`,Yx=`ArrayMethods`,Xx={};function Zx(e){let t=Xx[e];return t||fx(0,e),t}var Qx=e=>!!Xx[e];function $x(e,t){Xx[e]||(Xx[e]=t)}var eS,tS=()=>eS,nS=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Qx(qx)?Zx(qx):void 0,arrayMethodsPlugin_:Qx(Yx)?Zx(Yx):void 0});function rS(e,t){t&&(e.patchPlugin_=Zx(Jx),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function iS(e){aS(e),e.drafts_.forEach(sS),e.drafts_=null}function aS(e){e===eS&&(eS=e.parent_)}var oS=e=>eS=nS(eS,e);function sS(e){let t=e[ux];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function cS(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[ux].modified_&&(iS(t),fx(4)),Sx(e)&&(e=lS(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[ux].base_,e,t)}else e=lS(t,n);return uS(t,e,!0),iS(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===cx?void 0:e}function lS(e,t){if(Kx(t))return t;let n=t[ux];if(!n)return vS(t,e.handledSet_,e);if(!fS(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);gS(n,e)}return n.copy_}function uS(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ux(t,n)}function dS(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var fS=(e,t)=>e.scope_===t,pS=[];function mS(e,t,n,r){let i=Bx(e),a=e.type_;if(r!==void 0&&kx(i,r,a)===t){Ax(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;Ex(i,(e,n)=>{if(xx(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??pS;for(let e of o)Ax(i,e,n,a)}function hS(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!fS(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=Vx(i);mS(e,i.draft_??i,a,n),gS(i,r)})}function gS(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}dS(e)}}function _S(e,t,n){let{scope_:r}=e;if(xx(n)){let i=n[ux];fS(i,r)&&i.callbacks_.push(function(){DS(e),mS(e,n,Vx(i),t)})}else Sx(n)&&e.callbacks_.push(function(){let i=Bx(e);e.type_===3?i.has(n)&&vS(n,r.handledSet_,r):kx(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&vS(kx(e.copy_,t,e.type_),r.handledSet_,r)})}function vS(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||xx(e)||t.has(e)||!Sx(e)||Kx(e)?e:(t.add(e),Ex(e,(r,i)=>{if(xx(i)){let t=i[ux];fS(t,n)&&(Ax(e,r,Vx(t),e.type_),dS(t))}else Sx(i)&&vS(i,t,n)}),e)}function yS(e,t){let n=Mx(e),r={type_:+!!n,scope_:t?t.scope_:tS(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=bS;n&&(i=[r],a=xS);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var bS={get(e,t){if(t===ux)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=Bx(e);if(!Ox(i,t,e.type_))return wS(e,i,t);let a=i[t];if(e.finalized_||!Sx(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Rx(t))return a;if(a===SS(e.base_,t)||CS(e,t,a)){DS(e);let n=e.type_===1?+t:t,r=kS(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in Bx(e)},ownKeys(e){return Reflect.ownKeys(Bx(e))},set(e,t,n){let r=TS(Bx(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=SS(Bx(e),t),i=r?.[ux];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.delete(t),!0;if(jx(n,r)&&(n!==void 0||Ox(e.base_,t,e.type_)))return!0;DS(e),ES(e)}return e.copy_[t]===n&&(n!==void 0||Ox(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),_S(e,t,n),!0)},deleteProperty(e,t){return DS(e),SS(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),ES(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=Bx(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[yx]:!0,[_x]:e.type_!==1||t!==`length`,[vx]:r[vx],[bx]:n[t]}},defineProperty(){fx(11)},getPrototypeOf(e){return mx(e.base_)},setPrototypeOf(){fx(12)}},xS={};for(let e in bS){let t=bS[e];xS[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}xS.deleteProperty=function(e,t){return isNaN(parseInt(t))&&fx(13),xS.set.call(this,e,t,void 0)},xS.set=function(e,t,n){return t!==`length`&&isNaN(parseInt(t))&&fx(14),bS.set.call(this,e[0],t,n,e[0])};function SS(e,t){let n=e[ux];return(n?Bx(n):e)[t]}function CS(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!Sx(n)||n[ux]?!1:e.baseRefs_.has(n)}function wS(e,t,n){let r=TS(t,n);return r?bx in r?r[bx]:r.get?.call(e.draft_):void 0}function TS(e,t){if(!(t in e))return;let n=mx(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=mx(n)}}function ES(e){e.modified_||(e.modified_=!0,e.parent_&&ES(e.parent_))}function DS(e){e.copy_||=(e.assigned_=new Map,Hx(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var OS=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(Ix(e)&&!Ix(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}Ix(t)||fx(6),n!==void 0&&!Ix(n)&&fx(7);let r;if(Sx(e)){let i=oS(this),a=kS(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?iS(i):aS(i)}return rS(i,n),cS(r,i)}if(!e||!Fx(e)){if(r=t(e),r===void 0&&(r=e),r===cx&&(r=void 0),this.autoFreeze_&&Ux(r,!0),n){let t=[],i=[];Zx(Jx).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}fx(1,e)},this.produceWithPatches=(e,t)=>{if(Ix(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},Lx(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Lx(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Lx(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Sx(e)||fx(8),xx(e)&&(e=AS(e));let t=oS(this),n=kS(t,e,void 0);return n[ux].isManual_=!0,aS(t),n}finishDraft(e,t){let n=e&&e[ux];(!n||!n.isManual_)&&fx(9);let{scope_:r}=n;return rS(r,t),cS(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=Zx(Jx).applyPatches_;return xx(e)?r(e,t):this.produce(e,e=>r(e,t))}};function kS(e,t,n,r){let[i,a]=Nx(t)?Zx(qx).proxyMap_(t,n):Px(t)?Zx(qx).proxySet_(t,n):yS(t,n);return(n?.scope_??tS()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?hS(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function AS(e){return xx(e)||fx(10,e),jS(e)}function jS(e){if(!Sx(e)||Kx(e))return e;let t=e[ux],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Hx(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Hx(e,!0);return Ex(n,(e,t)=>{Ax(n,e,jS(t))},r),t&&(t.finalized_=!1),n}function MS(){dx.push(`Sets cannot have "replace" patches.`,function(e){return`Unsupported patch operation: `+e},function(e){return`Cannot apply patch, path doesn't resolve: `+e},`Patching reserved attributes like __proto__, prototype and constructor is not allowed`);function e(n,r=[]){if(n.key_!==void 0){let e=n.parent_.copy_??n.parent_.base_,t=zx(kx(e,n.key_)),i=kx(e,n.key_);if(i===void 0||i!==n.draft_&&i!==n.base_&&i!==n.copy_||t!=null&&t.base_!==n.base_)return null;let a=n.parent_.type_===3,o;if(a){let e=n.parent_;o=Array.from(e.drafts_.keys()).indexOf(n.key_)}else o=n.key_;if(!(a&&e.size>o||Ox(e,o)))return null;r.push(o)}if(n.parent_)return e(n.parent_,r);r.reverse();try{t(n.copy_,r)}catch{return null}return r}function t(e,t){let n=e;for(let e=0;e{let u=kx(o,e,c),f=kx(s,e,c),p=l?Ox(o,e)?n:`add`:r;if(u===f&&p===n)return;let m=t.concat(e);i.push(p===r?{op:p,path:m}:{op:p,path:m,value:d(f)}),a.push(p===`add`?{op:r,path:m}:p===r?{op:`add`,path:m,value:d(u)}:{op:n,path:m,value:d(u)})})}function s(e,t,n,i){let{base_:a,copy_:o}=e,s=0;a.forEach(e=>{if(!o.has(e)){let a=t.concat([s]);n.push({op:r,path:a,value:e}),i.unshift({op:`add`,path:a,value:e})}s++}),s=0,o.forEach(e=>{if(!a.has(e)){let a=t.concat([s]);n.push({op:`add`,path:a,value:e}),i.unshift({op:r,path:a,value:e})}s++})}function c(e,t,r){let{patches_:i,inversePatches_:a}=r;i.push({op:n,path:[],value:t===cx?void 0:t}),a.push({op:n,path:[],value:e})}function l(e,t){return t.forEach(t=>{let{path:i,op:a}=t,o=e;for(let e=0;e[e,u(t)]));if(Px(e))return new Set(Array.from(e).map(u));let t=Object.create(mx(e));for(let n in e)t[n]=u(e[n]);return Ox(e,lx)&&(t[lx]=e[lx]),t}function d(e){return xx(e)?u(e):e}$x(Jx,{applyPatches_:l,generatePatches_:i,generateReplacementPatches_:c,getPath:e})}globalThis.Iterator?.from;var NS=new OS,PS=NS.produce,FS=NS.produceWithPatches.bind(NS),IS=NS.applyPatches.bind(NS),LS=1e3;function RS(e,t){if(e.add(t),e.size>LS){let t=e.values().next().value;t!==void 0&&e.delete(t)}}function zS(e){let{enablePatches:t=!1}=e;t&&MS();let n=$b(),r=e.initialValue,i=new Set;return{on:n.on,value:()=>r,patch:(e,t=sx())=>{i.has(t)||(MS(),r=IS(r,e),RS(i,t),n.emit(`updated`,r,void 0,t))},mutate:(e,a=sx())=>{if(!i.has(a)){if(RS(i,a),t){let[t,i]=FS(r,e);if(t===r)return;r=t,n.emit(`updated`,r,i,a)}else{let t=PS(r,e);if(t===r)return;r=t,n.emit(`updated`,r,void 0,a)}}},syncIds:i}}var BS=typeof self==`object`?self:globalThis,VS=new Set([`Error`,`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`,`AggregateError`]),HS=new Set([`Boolean`,`Number`,`String`,`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float16Array`,`Float32Array`,`Float64Array`,`BigInt64Array`,`BigUint64Array`]);function US(e,t){let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o,r=VS.has(e)?BS[e]:void 0;return n(new(r??BS.Error)(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}if(typeof a==`string`&&HS.has(a))return n(new BS[a](o),i);throw TypeError(`unable to deserialize unsafe or unknown type: ${String(a)}`)};return r}function WS(e){return US(new Map,e)(0)}var GS=``,{toString:KS}={},{keys:qS}=Object;function JS(e){let t=typeof e;if(t!==`object`||!e)return[0,t];let n=KS.call(e).slice(8,-1);switch(n){case`Array`:return[1,GS];case`Object`:return[2,GS];case`Date`:return[3,GS];case`RegExp`:return[4,GS];case`Map`:return[5,GS];case`Set`:return[6,GS];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]}function YS([e,t]){return e===0&&(t===`function`||t===`symbol`)}function XS(e,t,n,r){let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=JS(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize ${s}`);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of qS(r))(e||!YS(JS(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(YS(JS(n))||YS(JS(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!YS(JS(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a}function ZS(e,t={}){let n=[];return XS(!(t.json||t.lossy),!!t.json,new Map,n)(e),n}var{parse:QS,stringify:$S}=JSON,eC={json:!0,lossy:!0};function tC(e){return WS(QS(e))}function nC(e){return $S(ZS(e,eC))}function rC(e){return WS(e)}function iC(e){return nC(e)}function aC(e){return tC(e)}var oC=256,sC=class extends Error{name=`StreamClosedError`};function cC(e={}){let t=e.id??sx(),n=Math.max(0,e.replayWindow??0),r=$b(),i=new AbortController,a=[],o=!1,s=0;function c(e){if(o)throw new sC(`Cannot write to a closed stream "${t}"`);s+=1,n>0&&(a.push({seq:s,chunk:e}),a.length>n&&(a.length-n===1?a.shift():a.splice(0,a.length-n))),r.emit(`chunk`,s,e)}function l(e){if(o)return;o=!0;let t=uC(e);i.abort(e),r.emit(`end`,t)}function u(){o||(o=!0,i.signal.aborted||i.abort(`stream closed`),r.emit(`end`,void 0))}function d(e){o||i.signal.aborted||i.abort(e??`aborted`)}let f=new WritableStream({write(e){c(e)},close(){u()},abort(e){l(e)}});return{id:t,signal:i.signal,get closed(){return o},get lastSeq(){return s},write:c,error:l,close:u,abort:d,writable:f,events:r,buffer:a}}function lC(e={}){let t=e.id??sx(),n=Math.max(1,e.highWaterMark??oC),r=[],i=0,a=!1,o=!1,s,c,l,u;function d(){if(c){if(r.length>0){let e=r.shift(),t=c;c=void 0,t.resolve({value:e,done:!1});return}if(a){let e=c;if(c=void 0,s){let t=Error(s.message);t.name=s.name,e.reject(t)}else e.resolve({value:void 0,done:!0})}}}function f(){if(l){for(;r.length>0;){let e=r.shift();try{l.enqueue(e)}catch{break}}if(a&&l){try{if(s){let e=Error(s.message);e.name=s.name,l.error(e)}else l.close()}catch{}l=void 0}}}function p(t,s){if(!(a||o)&&!(t<=i)){if(i=t,r.push(s),r.length>n){let t=r.length-n;r.splice(0,t),e.onOverflow?.(t)}d(),u&&f()}}function m(e){a||(a=!0,s=e,d(),u&&f())}function h(){o||a||(o=!0,e.onCancel?.(),m(void 0))}function g(){return u||(u=new ReadableStream({start(e){l=e,f()},cancel(){h()}}),u)}return{id:t,get cancelled(){return o},get done(){return a},get lastSeenSeq(){return i},get readable(){return g()},cancel:h,_push:p,_end:m,[Symbol.asyncIterator](){return{next(){if(r.length>0)return Promise.resolve({value:r.shift(),done:!1});if(a){if(s){let e=Error(s.message);return e.name=s.name,Promise.reject(e)}return Promise.resolve({value:void 0,done:!0})}return new Promise((e,t)=>{c={resolve:e,reject:t}})},return(){return h(),Promise.resolve({value:void 0,done:!0})}}}}}function uC(e){if(e instanceof Error)return{name:e.name||`Error`,message:e.message};if(typeof e==`string`)return{name:`Error`,message:e};try{return{name:`Error`,message:JSON.stringify(e)}}catch{return{name:`Error`,message:String(e)}}}var dC=128;function fC(e){return e.replace(/[^\w-]+/g,`_`).slice(0,dC)}var pC=`modulepreload`,mC=function(e,t){return new URL(e,t).href},hC={},gC=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=mC(t,n),t=s(t),t in hC)return;hC[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:pC,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},_C=`__connection.json`,vC=`__DEVFRAME_CONNECTION__`,yC=`x-birpc-session`,bC=`__rpc-dump/index.json`,xC=`devframe:services`,SC=`devframe_otp`,CC=`devframe_auth_token`;yb.postMessage.remoteAssetsError;var wC=class{cacheMap=new Map;options;keySerializer;constructor(e){this.options=e,this.keySerializer=e.keySerializer||(e=>Qb(e))}updateOptions(e){this.options={...this.options,...e}}cached(e,t){let n=this.cacheMap.get(e);if(n)return n.get(this.keySerializer(t))}has(e,t){return this.cacheMap.get(e)?.has(this.keySerializer(t))??!1}apply(e,t){let n=this.cacheMap.get(e.m)||new Map;n.set(this.keySerializer(e.a),t),this.cacheMap.set(e.m,n)}validate(e){return this.options.functions.includes(e)}clear(e){e?this.cacheMap.delete(e):this.cacheMap.clear()}},TC=Sb({docsBase:`https://devfra.me/errors`,codes:{DF0019:{why:e=>`RPC function "${e.name}" has \`agent\` set but \`jsonSerializable\` is \`false\`; MCP requires JSON-serializable data.`,fix:"Remove `jsonSerializable: false`, or remove `agent` to keep it RPC-only."},DF0020:{why:e=>`RPC function "${e.name}" declares \`jsonSerializable: true\` but the value at "${e.path}" is a ${e.type}.`,fix:"Either drop `jsonSerializable: true` (falls back to structured-clone) or change the value to a JSON-safe shape."},DF0021:{why:e=>`RPC function "${e.name}" is already registered`,fix:"Use the `force` parameter to overwrite an existing registration."},DF0022:{why:e=>`RPC function "${e.name}" is not registered. Use register() to add new functions.`},DF0023:{why:e=>`RPC function "${e.name}" is not registered`},DF0024:{why:e=>`Either handler or setup function must be provided for RPC function "${e.name}"`},DF0025:{why:e=>`Function "${e.name}" not found in dump store`},DF0026:{why:e=>`No dump match for "${e.name}" with args: ${e.args}`},DF0027:{why:e=>`Function "${e.name}" with type "${e.type}" cannot have dump configuration. Only "static" and "query" types support dumps.`},DF0028:{why:e=>`Function "${e.name}" with type "${e.type}" cannot use \`snapshot: true\`. Only "query" functions support this sugar; "static" functions have equivalent default behavior already.`,fix:"Remove `snapshot: true`, or change the function type to `query`."},DF0043:{why:e=>`RPC function "${e.name}" received an invalid argument at position ${e.index}: ${e.issues}`,fix:"Pass a value that satisfies the `args` schema declared for this function."},DF0044:{why:e=>`RPC function "${e.name}" returned a value that failed its \`returns\` schema: ${e.issues}`,fix:"Make the handler return a value that satisfies the `returns` schema, or relax the schema."}}});function EC(e){if(e.agent&&e.jsonSerializable===!1)throw TC.DF0019({name:e.name});e.agent&&!e.jsonSerializable&&(e.jsonSerializable=!0)}async function DC(e,t){let n=e[`~standard`].validate(t);return n instanceof Promise?await n:n}function OC(e){return e.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `)}async function kC(e,t,n){let r=n.slice();if(!t||t.length===0)return r;for(let r=0;r{n.get(t)===r&&n.delete(t)}),n.set(t,r)),await r}if(!e.__promise){let n=Promise.resolve(e.setup(t));n.catch(()=>{e.__promise===n&&(e.__promise=void 0)}),e.__promise=n}return await e.__promise}async function MC(e,t){let n=e.handler;if(!n){let r=await jC(e,t);if(!r.handler)throw TC.DF0024({name:e.name});n=r.handler}let r=e.args,i=e.returns;if(!r&&!i)return n;let a=n;return async(...t)=>{let n=await kC(e.name,r,t),o=await a(...n);return await AC(e.name,i,o)}}var NC=class{context;definitions=new Map;functions;_onChanged=[];constructor(e){this.context=e;let t=this.definitions,n=this;this.functions=new Proxy({},{get(e,r){let i=t.get(r);if(i)return MC(i,n.context)},has(e,n){return t.has(n)},getOwnPropertyDescriptor(e,n){return{value:t.get(n)?.handler,configurable:!0,enumerable:!0}},ownKeys(){return Array.from(t.keys())}})}register(e,t=!1){if(this.definitions.has(e.name)&&!t)throw TC.DF0021({name:e.name});EC(e),this.definitions.set(e.name,e),this._onChanged.forEach(t=>t(e.name))}update(e,t=!1){if(!this.definitions.has(e.name)&&!t)throw TC.DF0022({name:e.name});EC(e),this.definitions.set(e.name,e),this._onChanged.forEach(t=>t(e.name))}onChanged(e){return this._onChanged.push(e),()=>{let t=this._onChanged.indexOf(e);t!==-1&&this._onChanged.splice(t,1)}}async getHandler(e){return await MC(this.definitions.get(e),this.context)}getSchema(e){let t=this.definitions.get(e);if(!t)throw TC.DF0023({name:String(e)});return{args:t.args,returns:t.returns}}has(e){return this.definitions.has(e)}get(e){return this.definitions.get(e)}list(){return Array.from(this.definitions.keys())}};function PC(e,t=``){return JSON.stringify(e,function(e,n){let r=this,i=r==null?n:r[e];if(i===void 0){if(Array.isArray(r))throw IC(t,`undefined`,r,e);return n}return i!==null&&FC(i,r,e,t),n})}function FC(e,t,n,r){if(typeof e==`bigint`)throw IC(r,`BigInt`,t,n);if(typeof e!=`object`)return;if(e instanceof Map)throw IC(r,`Map`,t,n);if(e instanceof Set)throw IC(r,`Set`,t,n);if(e instanceof Date)throw IC(r,`Date`,t,n);if(Array.isArray(e))return;let i=Object.getPrototypeOf(e);if(i!==null&&i!==Object.prototype)throw IC(r,e.constructor?.name??`class instance`,t,n)}function IC(e,t,n,r){let i=LC(n,r);return TC.DF0020({name:e||``,type:t,path:i})}function LC(e,t){return Array.isArray(e)?`[${t}]`:t===``?``:t}var RC=`__DEVFRAME_CONNECTION_META__`,zC=`__DEVFRAME_CONNECTION_AUTH_TOKEN__`;function BC(e){let t=[()=>window?.[e],()=>globalThis?.[e],()=>parent.window?.[e]];for(let e of t)try{let t=e();if(t)return t}catch{}}function VC(){return BC(vC)}function HC(){return BC(RC)}function UC(e){if(e)return e;try{let e=localStorage.getItem(zC);if(e)return e}catch{}return BC(zC)}function WC(e){globalThis[vC]=e,globalThis[RC]={...e.connectionMeta,baseUrl:e.metaBaseUrl},e.authToken&&GC(e.authToken)}function GC(e){try{localStorage.setItem(zC,e)}catch{}globalThis[zC]=e;let t=VC();t&&(globalThis[vC]={...t,authToken:e})}function KC(e){let t=ix(_C,e);try{return new URL(t,globalThis.location?.href).href}catch{return t}}function qC(e,t){return t&&t!==e.authToken?{...e,authToken:t}:e}function JC(){let e=VC();if(e)return qC(e,UC()??e.authToken??e.connectionMeta.authToken);let t=HC();if(t)return{connectionMeta:t,metaBaseUrl:t.baseUrl??KC(`./`),authToken:UC(t.authToken)}}async function YC(e={}){if(e.connection){let t=qC(e.connection,UC(e.authToken??e.connection.authToken??e.connection.connectionMeta.authToken));return WC(t),t}let t=Array.isArray(e.baseURL)?e.baseURL:[e.baseURL??`./`];if(e.connectionMeta){let n={connectionMeta:e.connectionMeta,metaBaseUrl:KC(t[0]??`./`),authToken:UC(e.authToken??e.connectionMeta.authToken)};return WC(n),n}let n=JC();if(n){let t=qC(n,UC(e.authToken??n.authToken??n.connectionMeta.authToken));return WC(t),t}let r=[];for(let n of t){let t=ix(_C,n),i=KC(n);try{let n=await fetch(t);if(!n.ok)throw Error(`Failed to fetch connection meta from ${i}: ${n.status}`);let r=await n.json(),a=n.url||i,o={connectionMeta:r,metaBaseUrl:r.baseUrl?new URL(r.baseUrl,a).href:a,authToken:UC(e.authToken??r.authToken)};return WC(o),o}catch(e){r.push(e)}}throw Error(`Failed to get connection meta from ${t.join(`, `)}`,{cause:r})}var XC=class extends Error{name=`DevframeConnectionError`;kind;constructor(e,t,n){super(t,n),this.kind=e}};function ZC(e=SC){try{let t=globalThis.location?.hash?.replace(/^#/,``)??``;return new URLSearchParams(t).get(e)||void 0}catch{return}}function QC(e){try{let t=new URL(globalThis.location.href),n=new URLSearchParams(t.hash.replace(/^#/,``));if(!n.has(e))return;n.delete(e),t.hash=n.toString(),globalThis.history?.replaceState(globalThis.history.state,``,t.href)}catch{}}function $C(e=SC){let t=ZC(e);return t&&QC(e),t}async function ew(e,t={}){let n=$C(t.param??`devframe_otp`);return n?e.isTrusted?!0:e.requestTrustWithCode(n):!1}function tw(e){let t={},n=new WeakMap,r,i=()=>(r??=e.sharedState.get(xC,{initialValue:{}}).then(e=>(t=e.value(),e.on(`updated`,e=>{t=e}),e)),r);return i(),{state:i,has:e=>e in t,keys:()=>Object.keys(t),get:r=>{let i=t[r];if(!i)return;let a=n.get(i);return a||(a={...i,rpc:e.scope(i.scope).rpc},n.set(i,a)),a}}}function nw(e){let t=new Map,n=new Map,r=new Map,i=new Set,a=e.connectionMeta.backend===`static`;function o(e,t){let n=r.get(e);return n&&typeof n==`object`&&!Array.isArray(n)&&typeof t==`object`&&!Array.isArray(t)?{...n,...t}:t}e.client.register({name:yb.broadcast.clientStateUpdated,type:`event`,handler:(e,n,r)=>{let i=t.get(e);i&&!i.syncIds.has(r)&&i.mutate(()=>o(e,n),r)}}),e.client.register({name:yb.broadcast.clientStatePatch,type:`event`,handler:(e,n,r)=>{let i=t.get(e);i&&!i.syncIds.has(r)&&i.patch(n,r)}});function s(t,n){let r=[];return r.push(n.on(`updated`,(n,r,i)=>{a||(r?e.callEvent(`devframe:rpc:server-state:patch`,t,r,i):e.callEvent(`devframe:rpc:server-state:set`,t,n,i))})),()=>{for(let e of r)e()}}return{keys:()=>Array.from(t.keys()),onKeyAdded(e){return i.add(e),()=>{i.delete(e)}},delete(e){let i=n.get(e);n.delete(e);let a=t.delete(e);return r.delete(e),i?.(),a},get:async(c,l)=>{if(l?.initialValue!==void 0&&r.set(c,l.initialValue),t.has(c))return t.get(c);let u=zS({initialValue:l?.initialValue,enablePatches:!1});async function d(){if(a||e.callEvent(`devframe:rpc:server-state:subscribe`,c),l?.initialValue!==void 0){t.set(c,u);for(let e of i)e(c);return e.call(`devframe:rpc:server-state:get`,c).then(e=>{e!==void 0&&u.mutate(()=>o(c,e))}).catch(e=>{console.error(`Error getting server state`,e)}),n.set(c,s(c,u)),u}{let r=await e.call(`devframe:rpc:server-state:get`,c);u.mutate(()=>o(c,r)),t.set(c,u);for(let e of i)e(c);return n.set(c,s(c,u)),u}}return new Promise((t,n)=>{if(e.isTrusted)d().then(t,n);else{t(u);let n=!1;e.events.on(yb.client.isTrustedUpdated,e=>{e&&!n&&(n=!0,d())})}})}}}var rw=new Map;function iw(e=rw){let t=new Map;return{serialize:n=>{let r;return n.t===`q`?r=n.m:(r=t.get(n.i),t.delete(n.i)),!(n.t===`s`&&`e`in n)&&r&&e.get(r)?.jsonSerializable===!0?PC(n,r??``):`s:${iC(n)}`},deserialize:e=>{let n=e.startsWith(`s:`)?aC(e.slice(2)):JSON.parse(e);return n.t===`q`&&n.i&&n.m&&t.set(n.i,n.m),n}}}function aw(){}function ow(e){let t=e.search(/\n\n|\r\n\r\n/);if(!(t<0))return{frame:e.slice(0,t),rest:e.slice(t+(e[t]===`\r`?4:2))}}function sw(e){let t=`message`,n=[];for(let r of e.split(/\r?\n/))r.startsWith(`:`)||(r.startsWith(`event:`)?t=r.slice(6).trimStart():r.startsWith(`data:`)&&n.push(r.slice(5).replace(/^ /,``)));return{event:t,data:n}}function cw(e){let{onConnected:t=aw,onError:n=aw,onDisconnected:r=aw,definitions:i,fetch:a=globalThis.fetch.bind(globalThis)}=e,o=e.url;e.authToken&&(o=`${o}${o.includes(`?`)?`&`:`?`}${CC}=${encodeURIComponent(e.authToken)}`);let s=iw(i),c=new AbortController,l=!1,u,d,f,p,m=new Promise((e,t)=>{f=e,p=t});m.catch(()=>{});function h(e){l||(l=!0,p(e),n(e),r())}function g(){l||(l=!0,p(Error(`Devframe SSE stream closed`)),r())}function _(e,n){if(e===`session`){f(n),t();return}u?.(n)}async function ee(e){let t=e.getReader();d=t;let n=new TextDecoder,r=``;for(;;){let{done:e,value:i}=await t.read();if(e)break;for(r+=n.decode(i,{stream:!0});;){let e=ow(r);if(!e)break;r=e.rest;let{event:t,data:n}=sw(e.frame);n.length>0&&_(t,n.join(` -`))}}g()}return(async()=>{try{let e=await a(o,{headers:{accept:`text/event-stream`},signal:c.signal});if(!e.ok||!e.body)throw Error(`Devframe SSE stream request failed: ${e.status}`);await ee(e.body)}catch(e){if(c.signal.aborted){g();return}h(e instanceof Error?e:Error(String(e)))}})(),{close:()=>{l=!0,c.abort(),d?.cancel().catch(()=>{})},on:e=>{u=e},post:async e=>{let t;try{t=await m}catch{return}if(l){n(Error(`Devframe SSE channel is closed; message dropped`));return}try{let n=await a(o,{method:`POST`,headers:{"content-type":`text/plain; charset=utf-8`,[yC]:t},body:e});if(n.status===200){let e=await n.text();e&&u?.(e);return}if(!n.ok)throw Error(`Devframe SSE POST failed: ${n.status}`)}catch(e){n(e instanceof Error?e:Error(String(e)))}},serialize:s.serialize,deserialize:s.deserialize}}function lw(e,t){let{channel:n,rpcOptions:r={}}=t;return Mb(e,{...n,timeout:-1,...r,proxify:!1})}function uw(e){let{transport:t,authToken:n,connectionMeta:r,events:i,clientRpc:a,rpcOptions:o={},callTimeout:s=0}=e,c=!1,l=`connecting`,u=null,d=Promise.withResolvers();function f(e,t=null){if(t?u=t:e===`connected`&&(u=null),e===l)return;let n=l;l=e,i.emit(yb.client.connectionStatus,e,n)}let p=new Set;function m(e){for(let t of[...p])t.reject(e)}function h(){return l===`disconnected`||l===`error`?new XC(`connection`,`[devframe] Not connected to the devframe server`,{cause:u??void 0}):l===`unauthorized`?new XC(`auth`,`[devframe] Not authorized by the devframe server`,{cause:u??void 0}):null}function g(e,t){return new Promise((n,r)=>{let a=!1,o,c={reject(e){a||(l(),i.emit(yb.client.error,e,t),r(e))}};function l(){a=!0,p.delete(c),o&&clearTimeout(o)}p.add(c),s>0&&(o=setTimeout(()=>{c.reject(new XC(`timeout`,`[devframe] RPC call "${t}" timed out after ${s}ms`))},s)),e.then(e=>{a||(l(),n(e))},e=>{if(a)return;l();let n=e instanceof Error?e:Error(String(e));i.emit(yb.client.error,n,t),r(n)})})}let _=new Map;for(let e of r.jsonSerializableMethods??[])_.set(e,{jsonSerializable:!0});let ee=e.createChannel({definitions:_,onError(e){f(`error`,e),i.emit(yb.client.connectionError,e),m(new XC(`connection`,`[devframe] Connection to the devframe server failed`,{cause:e}))},onDisconnected(){l!==`error`&&f(`disconnected`),m(new XC(`connection`,`[devframe] Disconnected from the devframe server`,{cause:u??void 0}))}}),te=lw(a.functions,{channel:ee,rpcOptions:o});a.register({name:yb.broadcast.authRevoked,type:`event`,handler:()=>{c=!1;let e=new XC(`auth`,`[devframe] The devframe server revoked this client's trust`);f(`unauthorized`,e),i.emit(yb.client.connectionError,e),m(e),i.emit(yb.client.isTrustedUpdated,!1)}});let ne=n;async function re(e){ne=e;let t=await te.$call(`anonymous:devframe:auth`,{authToken:e,ua:navigator.userAgent,origin:location.origin});if(c=t.isTrusted,c)d.resolve(!0),f(`connected`);else{let e=new XC(`auth`,`[devframe] The devframe server refused this client's credentials`);f(`unauthorized`,e),i.emit(yb.client.connectionError,e)}return i.emit(yb.client.isTrustedUpdated,c),t.isTrusted}async function ie(e){let t=(await te.$call(`anonymous:devframe:auth:exchange`,{code:e,ua:navigator.userAgent,origin:location.origin}))?.authToken??null;return t&&(ne=t,c=!0,d.resolve(!0),f(`connected`),i.emit(yb.client.isTrustedUpdated,!0)),t}async function ae(e={}){await te.$call(`anonymous:devframe:auth:request-code`,{ua:navigator.userAgent,origin:location.origin,...e.reissue?{reissue:!0}:{}})}async function oe(){return c?!0:re(ne??``)}async function se(e=6e4){if(c&&d.resolve(!0),e<=0)return d.promise;let t;try{return await Promise.race([d.promise,new Promise((n,r)=>{t=setTimeout(()=>{r(Error(`[devframe] Timeout waiting for rpc to be trusted`))},e)})]),c}finally{clearTimeout(t)}}return{transport:t,get isTrusted(){return c},get status(){return l},get connectionError(){return u},requestTrust:oe,requestTrustWithToken:re,requestTrustWithCode:ie,requestAuthCode:ae,ensureTrusted:se,call:(...e)=>{let t=String(e[0]),n=h();return n?(i.emit(yb.client.error,n,t),Promise.reject(n)):g(te.$call(...e),t)},callEvent:(...e)=>{let t=h();if(t){i.emit(yb.client.error,t,String(e[0]));return}return te.$callEvent(...e)},callOptional:(...e)=>{let t=String(e[0]),n=h();return n?(i.emit(yb.client.error,n,t),Promise.reject(n)):g(te.$callOptional(...e),t)},close:()=>{ee.close()}}}function dw(e,t,n){let r=(()=>{try{return new URL(t,n.href)}catch{return new URL(n.href)}})();if(e&&typeof e==`object`){if(e.host!=null||e.port!=null){let t=e.host??`${r.hostname}:${e.port}`;return new URL(e.path??`/`,`${r.protocol}//${t}`).href}return new URL(e.path??``,r).href}let i=e??``;return/^https?:\/\//i.test(i)?i:new URL(i,r).href}function fw(e){let{authToken:t,connectionMeta:n,metaBaseUrl:r,events:i,clientRpc:a,rpcOptions:o={},sseOptions:s={},callTimeout:c=0}=e,l=dw(n.sse,r??`./`,location);return uw({transport:`sse`,authToken:t,connectionMeta:n,events:i,clientRpc:a,rpcOptions:o,callTimeout:c,createChannel:e=>cw({url:l,authToken:t,definitions:e.definitions,...s,onConnected(){s.onConnected?.()},onError(t){e.onError(t),s.onError?.(t)},onDisconnected(){e.onDisconnected(),s.onDisconnected?.()}})})}function pw(e){let{name:t,message:n,cause:r,...i}=e,a=r instanceof Error?r:mw(r)?pw(r):r,o=a===void 0?Error(n):Error(n,{cause:a});return o.name=t,Object.assign(o,i),o}function mw(e){return typeof e==`object`&&!!e&&typeof e.message==`string`&&typeof e.name==`string`}function hw(e){return typeof e==`object`&&!!e&&e.type===`static`&&typeof e.path==`string`}function gw(e){return typeof e==`object`&&!!e&&e.type===`query`&&typeof e.records==`object`&&e.records!==null}function _w(e){return typeof e==`object`&&!!e&&(`output`in e||`error`in e)}function vw(e){if(e.error)throw pw(e.error);return e.output}function yw(e){return e.some(e=>e!=null)}function bw(e){return typeof e==`object`&&e&&`serialization`in e&&`data`in e?e.data:e}function xw(e,t){let n=new Map,r=new Map;function i(e,t){return t===`structured-clone`&&Array.isArray(e)?rC(e):e}function a(e,t){return i(bw(e),t)}async function o(e){n.has(e.path)||n.set(e.path,t(e.path).then(t=>a(t,e.serialization)));let r=await n.get(e.path);return _w(r)?vw(r):r}async function s(e,n){return r.has(e)||r.set(e,t(e).then(e=>a(e,n))),await r.get(e)}async function c(t,n){if(!(t in e))throw Error(`[devframe-rpc] Function "${t}" not found in dump store`);let r=e[t];if(hw(r)){if(yw(n))throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`);return await o(r)}if(gw(r)){let e=Qb(n),i=r.records[e];if(i)return vw(await s(i,r.serialization));if(r.fallback)return vw(await s(r.fallback,r.serialization));throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}if(!yw(n))return r;throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}return{call:async(e,t)=>await c(e,t),callOptional:async(t,n)=>{if(t in e)return await c(t,n)},callEvent:async(e,t)=>{}}}async function Sw(e){let t=xw(await e.fetchJsonFromBases(bC),e.fetchJsonFromBases);return{transport:`static`,isTrusted:!0,status:`connected`,connectionError:null,requestTrust:async()=>!0,requestTrustWithToken:async()=>!0,requestTrustWithCode:async()=>null,requestAuthCode:async()=>{},ensureTrusted:async()=>!0,call:(...e)=>t.call(e[0],e.slice(1)),callEvent:(...e)=>t.callEvent(e[0],e.slice(1)),callOptional:(...e)=>t.callOptional(e[0],e.slice(1)),close:()=>{}}}var Cw=``;function ww(e,t){return`${e}${Cw}${t}`}function Tw(e){let t=new Map,n=new Map;e.client.register({name:yb.broadcast.streamingChunk,type:`event`,handler(e,n,r,i){t.get(ww(e,n))?._push(r,i)}}),e.client.register({name:yb.broadcast.streamingEnd,type:`event`,handler(e,n,r){let i=ww(e,n),a=t.get(i);a&&(a._end(r),t.delete(i))}}),e.client.register({name:yb.broadcast.streamingUploadCancel,type:`event`,handler(e,t){let r=ww(e,t),i=n.get(r);i&&(i.abort(`server cancelled upload`),n.delete(r))}}),e.events.on(yb.client.isTrustedUpdated,n=>{if(n)for(let[n,r]of t){if(r.cancelled||r.done)continue;let t=n.indexOf(Cw);if(t<0)continue;let i=n.slice(0,t),a=n.slice(t+1);e.callEvent(`devframe:streaming:subscribe`,i,a,{afterSeq:r.lastSeenSeq})}});function r(n,r,i={}){let a=ww(n,r),o=t.get(a);if(o)return o;let s=lC({id:r,highWaterMark:i.highWaterMark,onOverflow(e){console.warn(`[devframe] DF0029: Stream "${n}#${r}" dropped ${e} chunk(s) after exceeding the client high-water mark.`)},onCancel(){e.callEvent(`devframe:streaming:cancel`,n,r),t.delete(a)}});if(t.set(a,s),e.isTrusted)e.callEvent(`devframe:streaming:subscribe`,n,r,{afterSeq:0});else{let i=e.events.on(yb.client.isTrustedUpdated,o=>{o&&(i(),t.has(a)&&!s.cancelled&&!s.done&&e.callEvent(`devframe:streaming:subscribe`,n,r,{afterSeq:s.lastSeenSeq}))})}return s}function i(t,r){let i=ww(t,r),a=n.get(i);if(a)return a;let o=cC({id:r});return o.events.on(`chunk`,(n,i)=>{e.callEvent(`devframe:streaming:upload-chunk`,t,r,n,i)}),o.events.on(`end`,a=>{e.callEvent(`devframe:streaming:upload-end`,t,r,a),n.delete(i)}),n.set(i,o),o}return{subscribe:r,upload:i}}function Ew(){}var Dw=new Map;function Ow(e){let t=e.url;e.authToken&&(t=`${t}?${CC}=${encodeURIComponent(e.authToken)}`);let n=new WebSocket(t),{onConnected:r=Ew,onError:i=Ew,onDisconnected:a=Ew,definitions:o=Dw}=e;n.addEventListener(`open`,e=>{r(e)}),n.addEventListener(`error`,e=>{let t=e instanceof Error?e:Error(e.type);i(t)}),n.addEventListener(`close`,e=>{a(e)});let s=iw(o);return{close:()=>{n.close()},on:e=>{n.addEventListener(`message`,t=>{e(t.data)})},post:e=>{if(n.readyState===WebSocket.OPEN){n.send(e);return}if(n.readyState===WebSocket.CONNECTING){let t=()=>{i(),n.readyState===WebSocket.OPEN&&n.send(e)},r=()=>i();function i(){n.removeEventListener(`open`,t),n.removeEventListener(`close`,r)}n.addEventListener(`open`,t),n.addEventListener(`close`,r);return}i(Error(`Devframe WebSocket is not open; message dropped`))},serialize:s.serialize,deserialize:s.deserialize}}function kw(e,t,n){let r=(()=>{try{return new URL(t,n.href)}catch{return new URL(n.href)}})(),i=r.protocol===`https:`?`wss:`:`ws:`;if(e&&typeof e==`object`){if(e.host!=null||e.port!=null){let t=e.host??`${r.hostname}:${e.port}`,n=new URL(e.path??`/`,`${i}//${t}`);return n.protocol=i,n.href}let t=new URL(e.path??``,r);return t.protocol=i,t.href}if(typeof e==`number`)return`${i}//${r.hostname}:${e}`;let a=e??``;if(/^wss?:\/\//i.test(a))return a;if(/^https?:\/\//i.test(a))return ax(a,/^https/i.test(a)?`wss://`:`ws://`);let o=new URL(a,r);return o.protocol=i,o.href}function Aw(e){let{authToken:t,connectionMeta:n,metaBaseUrl:r,events:i,clientRpc:a,rpcOptions:o={},wsOptions:s={},callTimeout:c=0}=e,l=kw(n.websocket,r??`./`,location);return uw({transport:`websocket`,authToken:t,connectionMeta:n,events:i,clientRpc:a,rpcOptions:o,callTimeout:c,createChannel:e=>Ow({url:l,authToken:t,definitions:e.definitions,...s,onConnected(e){s.onConnected?.(e)},onError(t){e.onError(t),s.onError?.(t)},onDisconnected(t){e.onDisconnected(),s.onDisconnected?.(t)}})})}function jw(e){return e.includes(`:`)}function Mw(e,t){return jw(t)?t:`${e}:${t}`}function Nw(e){return{async get(t){return(await e()).value()?.[t]},async set(t,n){(await e()).mutate(e=>{if(e===void 0)return{[t]:n};e[t]=n})},async delete(t){(await e()).mutate(e=>{e!==void 0&&delete e[t]})},async all(){return(await e()).value()??{}},async onChange(t){return(await e()).on(`updated`,e=>t(e??{}))}}}function Pw(e,t,n){let r=`devframe:settings:${n}:${t}`,i;function a(){return i||=(async()=>(await e.ensureTrusted(),e.sharedState.get(r)))().catch(e=>{throw i=void 0,e}),i}return Nw(a)}function Fw(e,t){return{global:Pw(e,t,`global`),project:Pw(e,t,`project`)}}function Iw(e,t){return{namespace:t,base:e,rpc:{namespace:t,register(n){if(jw(n.name))throw Error(`[devframe] Scoped client RPC registration for namespace "${t}" received an already-namespaced function name "${n.name}". Pass a bare name without a ":" separator.`);e.client.register({...n,name:`${t}:${n.name}`})},call:((n,...r)=>e.call(Mw(t,n),...r)),callEvent:((n,...r)=>e.callEvent(Mw(t,n),...r)),callOptional:((n,...r)=>e.callOptional(Mw(t,n),...r)),sharedState:((n,r)=>e.sharedState.get(Mw(t,n),r)),streaming:{subscribe:(n,r,i)=>e.streaming.subscribe(Mw(t,n),r,i),upload:(n,r)=>e.streaming.upload(Mw(t,n),r)}},settings:Fw(e,t),scope:e.scope}}function Lw(){if(typeof document<`u`){let e=document.modelContext;if(e)return e}if(typeof navigator<`u`){let e=navigator.modelContext;if(e)return e}}function Rw(e,t={}){let n=t.modelContext??Lw();if(!n)return()=>{};let r=n,i=new Map,a=new Map;function o(t,n){let o=fC(t.name),s=a.get(o);if(s&&s!==t.name){console.warn(`[devframe] WebMCP tool name "${o}" (from "${t.name}") collides with "${s}"; keeping the first registration.`);return}let c=new AbortController,l=Nb(t.type,n),u=r.registerTool({name:o,description:n.description,inputSchema:Ib(t.args),annotations:{title:n.title??t.name,readOnlyHint:l===`read`,destructiveHint:l===`destructive`},execute:n=>zw(t,e.context,n)},{signal:c.signal});u&&`then`in u&&u.then(()=>{},()=>{}),a.set(o,t.name),i.set(t.name,()=>{c.abort(),u&&`unregister`in u&&typeof u.unregister==`function`&&u.unregister(),a.delete(o)})}function s(t){let n=t?[t]:[...e.definitions.keys()];for(let t of n){i.get(t)?.(),i.delete(t);let n=e.definitions.get(t),r=n?.agent;n&&r&&o(n,r)}}s();let c=e.onChanged(e=>s(e));return()=>{c();for(let e of i.values())e();i.clear()}}async function zw(e,t,n){try{let r=Rb(n,e.args?.length);return{content:[{type:`text`,text:Bw(await(await MC(e,t))(...r))}]}}catch(e){return{isError:!0,content:[{type:`text`,text:Vw(e)}]}}}function Bw(e){return e===void 0?`undefined`:typeof e==`string`?e:JSON.stringify(e,null,2)}function Vw(e){if(!(e instanceof Error))return String(e);let t=e.cause instanceof Error?` (cause: ${e.cause.message})`:``;return`${e.name}: ${e.message}${t}`}function Hw(e,t){if(t.backend===`static`)return`static`;let n=t.websocket!==void 0,r=t.sse!==void 0;if(e===`websocket`){if(!n)throw Error(`[devframe] transport: 'websocket' was requested, but this server does not advertise a WebSocket endpoint`);return`websocket`}if(e===`sse`){if(!r)throw Error(`[devframe] transport: 'sse' was requested, but this server does not advertise an SSE endpoint`);return`sse`}if(t.backend===`sse`&&r)return`sse`;if(n)return`websocket`;if(r)return`sse`;throw Error(`[devframe] This server advertises no RPC transport (backend "none"), so there is nothing to connect to. Enable the WebSocket or SSE endpoint on the server, or use its static/MCP surfaces instead.`)}async function Uw(e={}){let{baseURL:t=`./`,rpcOptions:n={},cacheOptions:r=!1}=e,i=$b(),a=Array.isArray(t)?t:[t],o=await YC(e),{connectionMeta:s,metaBaseUrl:c,authToken:l}=o,u=a[0]??`./`;try{u=new URL(`.`,c).href}catch{}let d=new wC({functions:[],...typeof e.cacheOptions==`object`?e.cacheOptions:{}}),f={rpc:void 0},p=new NC(f),m=e.webmcp===!1?void 0:Rw(p),h,g=!1,_=0,ee;function te(){_++,ee=void 0,d.clear(),r===!0&&d.updateOptions({functions:[]})}r&&(p.register({name:yb.broadcast.cacheInvalidate,type:`event`,handler:te}),i.on(yb.client.connectionStatus,te),i.on(yb.client.isTrustedUpdated,te));async function ne(e){let t=[u,...a.filter(e=>e!==u)].filter(e=>e!=null),n=[];for(let r of t)try{return await fetch(ix(e,r)).then(t=>{if(!t.ok)throw Error(`Failed to fetch ${e} from ${r}: ${t.status}`);return t.json()})}catch(e){n.push(e)}throw Error(`Failed to load ${e} from ${t.join(`, `)}`,{cause:n})}let re=e.callTimeout??0,ie=re>0?re:1/0,ae,oe={authToken:l,connectionMeta:s,metaBaseUrl:c,events:i,clientRpc:p,callTimeout:e.callTimeout,rpcOptions:{...n,async onRequest(e,t,i){let a=performance.now()+ie;if(await n.onRequest?.call(this,e,t,i),r===!0&&e.i&&ae.isTrusted&&!e.m.startsWith(`anonymous:`)&&e.m!==`devframe:rpc:cacheable-functions`){function t(){if(performance.now()>=a)throw new XC(`timeout`,`[devframe] RPC call "${e.m}" timed out after ${re}ms`)}for(;!ee&&(t(),!(g||ae.status!==`connected`));){let e=_;ee=ae.callOptional(`devframe:rpc:cacheable-functions`).then(t=>{e===_&&d.updateOptions({functions:t??[]})}).catch(t=>{throw e===_&&(ee=void 0),t}),await ee}await ee,t()}let o=_;if(r&&e.i&&!g&&ae.isTrusted&&d.validate(e.m)){if(d.has(e.m,e.a))return i(d.cached(e.m,e.a));let n=await t(e);o===_&&!g&&d.apply(e,n)}else await t(e)}}},se=Hw(e.transport??`auto`,s);ae=se===`static`?await Sw({fetchJsonFromBases:ne}):se===`sse`?fw({...oe,sseOptions:e.sseOptions}):Aw({...oe,wsOptions:e.wsOptions});let ce;try{ce=new BroadcastChannel(`devframe-auth`)}catch{}let le,ue=!1;function de(e){return((...t)=>ue||!le?e(...t):le.then(()=>e(...t)))}function fe(){g=!0,te();try{h?.(),m?.()}finally{try{ce?.close()}finally{ae.close?.()}}}let pe={events:i,get isTrusted(){return ae.isTrusted},get status(){return ae.status},get connectionError(){return ae.connectionError},get transport(){return ae.transport??se},get connection(){return o},connectionMeta:s,ensureTrusted:ae.ensureTrusted,requestTrust:ae.requestTrust,requestTrustWithToken:async e=>(GC(e),o={...o,authToken:e},ae.requestTrustWithToken(e)),requestTrustWithCode:async e=>{let t=await ae.requestTrustWithCode(e);if(!t)return!1;GC(t),o={...o,authToken:t};try{ce?.postMessage({type:`auth-update`,authToken:t})}catch{}return!0},requestAuthCode:e=>ae.requestAuthCode(e),call:de(ae.call),callEvent:de(ae.callEvent),callOptional:de(ae.callOptional),client:p,sharedState:void 0,services:void 0,streaming:void 0,cacheManager:d,scope:void 0,close:fe};pe.sharedState=nw(pe),pe.streaming=Tw(pe),pe.services=tw(pe);let me=new Map;pe.scope=(e=>{if(!e)return pe;let t=me.get(e);return t||(t=Iw(pe,e),me.set(e,t)),t}),f.rpc=pe;function he(){try{return typeof window<`u`&&window.self===window.top}catch{return!1}}async function ge(){if(e.simpleAuth!==!1&&he()&&typeof globalThis.prompt==`function`)for(await pe.requestAuthCode().catch(()=>{});!pe.isTrusted;){let e=globalThis.prompt(`devframe: enter the authentication code shown in your terminal`);if(e==null)return;let t=e.trim();if(t&&await pe.requestTrustWithCode(t))return}}async function _e(){let t=await ae.requestTrust(),n=e.otpParam??`devframe_otp`,r=n?await ew(pe,{param:n}):!1;t||r||pe.isTrusted||await ge()}return le=_e().then(()=>{ue=!0},()=>{ue=!0}),s.mcp&&gC(async()=>{let{setupBrowserAgentRpcBridge:e}=await import(`./browser-agent-rpc-BXhoSh1z-D8KenRn9.js`);return{setupBrowserAgentRpcBridge:e}},[],import.meta.url).then(({setupBrowserAgentRpcBridge:e})=>{g||(h=e(pe))}).catch(()=>{}),ce&&(ce.onmessage=e=>{e.data?.type===`auth-update`&&e.data.authToken&&pe.requestTrustWithToken(e.data.authToken)}),pe}var Ww=Uw,Gw=[`components`,`injectors`,`signals`,`ngrx`,`tanstackQuery`,`forms`,`router`,`pipes`,`http`,`analog`,`capacitor`,`errors`,`plugins`],Kw=[`angular`,`ngrx`,`analog`,`angular-native`,`nativescript`,`capacitor`];function qw(e){return`pangular:${e}`}var Jw=[`forms`,`router`,`ngrx`,`http`,`analog`,`components`,`tanstackQuery`,`plugins`],Yw={refreshMs:{default:3e3,min:500,max:8e3},navigations:{default:50,min:5,max:500},formTimeline:{default:200,min:10,max:2e3},httpCalls:{default:200,min:10,max:2e3},changeLog:{default:200,min:10,max:2e3},cdCycles:{default:200,min:10,max:2e3},capacitorCalls:{default:200,min:10,max:2e3},idleAfterMs:{default:6e4,min:0,max:6e5}},Xw={"opted-out":`the request sets transferCache: false`,post:`POST requests are left out unless includePostRequests is set`,method:`only GET, HEAD and POST requests are cached`,"auth-headers":`it sends an Authorization, Proxy-Authorization or Cookie header`,credentials:`it sends credentials (withCredentials or credentials: include/same-origin)`,"no-cache-request":`the request asks for no-store, no-cache or private`,"no-cache-response":`the response has Cache-Control no-store, no-cache or private`,"set-cookie":`the response sets a cookie`,error:`failed responses are not stored`,mocked:`a fault rule answered before the transfer cache ran`,"cache-off-or-filter":`the transfer cache is off, or its filter (or another withHttpTransferCacheOptions setting) left it out`},Zw=[[200,`OK`],[201,`Created`],[202,`Accepted`],[203,`Non-Authoritative Information`],[204,`No Content`],[205,`Reset Content`],[206,`Partial Content`],[207,`Multi-Status`],[208,`Already Reported`],[226,`IM Used`],[300,`Multiple Choices`],[301,`Moved Permanently`],[302,`Found`],[303,`See Other`],[304,`Not Modified`],[307,`Temporary Redirect`],[308,`Permanent Redirect`],[400,`Bad Request`],[401,`Unauthorized`],[402,`Payment Required`],[403,`Forbidden`],[404,`Not Found`],[405,`Method Not Allowed`],[406,`Not Acceptable`],[407,`Proxy Authentication Required`],[408,`Request Timeout`],[409,`Conflict`],[410,`Gone`],[411,`Length Required`],[412,`Precondition Failed`],[413,`Content Too Large`],[414,`URI Too Long`],[415,`Unsupported Media Type`],[416,`Range Not Satisfiable`],[417,`Expectation Failed`],[418,`I'm a Teapot`],[421,`Misdirected Request`],[422,`Unprocessable Content`],[423,`Locked`],[424,`Failed Dependency`],[425,`Too Early`],[426,`Upgrade Required`],[428,`Precondition Required`],[429,`Too Many Requests`],[431,`Request Header Fields Too Large`],[451,`Unavailable For Legal Reasons`],[499,`Client Closed Request`],[500,`Internal Server Error`],[501,`Not Implemented`],[502,`Bad Gateway`],[503,`Service Unavailable`],[504,`Gateway Timeout`],[505,`HTTP Version Not Supported`],[506,`Variant Also Negotiates`],[507,`Insufficient Storage`],[508,`Loop Detected`],[510,`Not Extended`],[511,`Network Authentication Required`],[520,`Web Server Returned an Unknown Error`],[521,`Web Server Is Down`],[522,`Connection Timed Out`],[523,`Origin Is Unreachable`],[524,`A Timeout Occurred`]];function Qw(e){return Zw.some(([t])=>t===e)}var $w=/^[a-z][a-z0-9-]{0,39}$/;function eT(e,t){let n=t.plugins?.[e],r=t.inspectors.plugins&&$w.test(e)&&(n?.enabled??!0);return{enabled:r,tools:r&&t.agent.tools.plugins&&(n?.tools??!0),actions:r&&t.actions.plugins&&(n?.actions??!0)}}var tT=`pangular`,nT={mod:`Mod`,ctrl:`Ctrl`,control:`Ctrl`,meta:`Meta`,cmd:`Meta`,command:`Meta`,alt:`Alt`,option:`Alt`,opt:`Alt`,shift:`Shift`},rT=[`Mod`,`Ctrl`,`Meta`,`Alt`,`Shift`];function iT(e){if(typeof e!=`string`||e.length>40)return;let t=e.split(`+`).map(e=>e.trim());if(t.some(e=>!e))return;let n=new Set,r;for(let e of t){let t=nT[e.toLowerCase()];if(t){if(n.has(t))return;n.add(t);continue}if(r!==void 0)return;if(/^[a-z0-9]$/i.test(e))r=e.toUpperCase();else if(/^f([1-9]|1[0-2])$/i.test(e))r=e.toUpperCase();else return}if(r&&[...n].some(e=>e!==`Shift`)&&!(n.has(`Mod`)&&(n.has(`Ctrl`)||n.has(`Meta`))))return[...rT.filter(e=>n.has(e)),r].join(`+`)}function aT(e,t,n){let r=t.split(`+`),i=r.pop(),a=new Set(r),o=a.has(`Ctrl`)||a.has(`Mod`)&&!n,s=a.has(`Meta`)||a.has(`Mod`)&&n;if(e.ctrlKey!==o||e.metaKey!==s||e.altKey!==a.has(`Alt`)||e.shiftKey!==a.has(`Shift`))return!1;if(/^F\d+$/.test(i))return e.key.toUpperCase()===i;let c=/^\d$/.test(i)?`Digit${i}`:`Key${i}`;return e.code?e.code===c:e.key.toUpperCase()===i}function oT(e,t){if(!t)return e.replace(/^Mod\b/,`Ctrl`);let n={Mod:`⌘`,Meta:`⌘`,Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`};return e.split(`+`).map(e=>n[e]??e).join(``)}var sT=[{id:`dashboard`,label:`Dashboard`},{id:`timeline`,label:`Timeline`},{id:`audit`,label:`Audit`},{id:`analog`,label:`Analog`,inspector:`analog`},{id:`components`,label:`Components`,inspector:`components`},{id:`routes`,label:`Routes`,inspector:`router`},{id:`signals`,label:`Signals`,inspector:`signals`},{id:`injectors`,label:`Injectors`,inspector:`injectors`},{id:`store`,label:`Store`,inspector:`ngrx`},{id:`queries`,label:`Queries`,inspector:`tanstackQuery`},{id:`forms`,label:`Forms`,inspector:`forms`},{id:`pipes`,label:`Pipes`,inspector:`pipes`},{id:`network`,label:`SSR & HTTP`,inspector:`http`},{id:`errors`,label:`Errors`,inspector:`errors`},{id:`capacitor`,label:`Capacitor`,inspector:`capacitor`},{id:`plugins`,label:`Plugins`,inspector:`plugins`}],cT=1e4;function lT(e){return sT.filter(t=>!(`inspector`in t)||e.inspectors[t.inspector])}var uT={components:`a component instance, by its id in the component tree`,injectors:`a component's element injector, by the component's id`,forms:`a form, by its id`},dT=200;function fT(e){let t=new URLSearchParams({tab:e.tab});return e.id&&t.set(`id`,e.id),e.page&&t.set(`page`,e.page),`#${t.toString()}`}function pT(e){let t=new URLSearchParams(e.replace(/^#/,``)),n=e=>{let n=t.get(e)?.trim();return n&&n.length<=dT?n:void 0},r=n(`tab`);if(!r)return null;let i=n(`id`),a=n(`page`);return{tab:r,...i?{id:i}:{},...a?{page:a}:{}}}var mT=[{id:`settings`,title:`Open settings`,group:`Go to`,keywords:`preferences tabs`},{id:`pick-component`,title:`Pick component on page`,group:`Actions`,keywords:`select inspect element`,inspector:`components`},{id:`cd-record-start`,title:`Start recording change detection`,group:`Actions`,keywords:`profiler cycles`,inspector:`components`},{id:`cd-record-stop`,title:`Stop recording change detection`,group:`Actions`,keywords:`profiler cycles`,inspector:`components`},{id:`cd-clear`,title:`Clear change detection recording`,group:`Actions`,keywords:`reset recordings cycles`,inspector:`components`},{id:`theme:system`,title:`Theme: follow the system`,group:`Theme`,keywords:`auto`},{id:`theme:light`,title:`Theme: light`,group:`Theme`},{id:`theme:dark`,title:`Theme: dark`,group:`Theme`},{id:`dock:float`,title:`Popup: float`,group:`Popup`,keywords:`dock`,popupOnly:!0},{id:`dock:bottom`,title:`Popup: dock to the bottom`,group:`Popup`,keywords:`dock`,popupOnly:!0},{id:`dock:right`,title:`Popup: dock to the right`,group:`Popup`,keywords:`dock`,popupOnly:!0},{id:`dock:reset-size`,title:`Popup: reset the docked size`,group:`Popup`,keywords:`splitter resize height width`,popupOnly:!0},{id:`popout`,title:`Popup: open in its own window`,group:`Popup`,keywords:`pop out detach new window`,popupOnly:!0},{id:`popout:return`,title:`Popup: back into the page`,group:`Popup`,keywords:`pop in attach dock window`,popupOnly:!0}];function hT(e){let t=lT(e).map(e=>({id:`tab:${e.id}`,title:`Go to ${e.label}`,group:`Go to`,keywords:`tab open`})),n=mT.filter(t=>!t.inspector||e.inspectors[t.inspector]).map(({inspector:e,...t})=>t);return[...t,...n]}function gT(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function _T(e,t){return typeof e==`boolean`?e:t}var vT=100,yT=100;function bT(e){if(!Array.isArray(e))return[];let t=e.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(e=>e&&e.length<=yT);return[...new Set(t)].slice(0,vT)}function xT(e,t){let{default:n,min:r,max:i}=Yw[t];return typeof e!=`number`||!Number.isFinite(e)?n:Math.min(i,Math.max(r,Math.round(e)))}function ST(e,t){return Object.fromEntries(e.map(e=>[e,t(e)]))}function CT(e){let t=gT(e),n=gT(t.agent),r=gT(t.inspectors),i=gT(n.tools),a=gT(t.actions),o=_T(t.actions,!0),s=gT(t.redaction),c=gT(t.limits),l=ST(Gw,e=>_T(r[e],!0));return{inspectors:l,agent:{readOnly:_T(n.readOnly,!1),tools:ST(Gw,e=>l[e]&&_T(i[e],!0)),browserTools:_T(n.browserTools,!1)},actions:ST(Jw,e=>l[e]&&_T(a[e],o)),redaction:{secretNames:bT(s.secretNames),unmask:bT(s.unmask)},limits:Object.fromEntries(Object.keys(Yw).map(e=>[e,xT(c[e],e)])),popup:{hotkey:ET(gT(t.popup).hotkey)},plugins:TT(t.plugins)}}var wT=100;function TT(e){let t={};for(let[n,r]of Object.entries(gT(e)).slice(0,wT)){if(!$w.test(n))continue;if(typeof r==`boolean`){t[n]={enabled:r,tools:!0,actions:!0};continue}let e=gT(r);r!==void 0&&Object.keys(e).length&&(t[n]={enabled:_T(e.enabled,!0),tools:_T(e.tools,!0),actions:_T(e.actions,!0)})}return t}function ET(e){return e===!1?!1:iT(e)??`Alt+Shift+P`}function DT(e){let t=e?.configs;return CT(t?.[tT])}function OT(e){return`${{forms:`Writing to forms`,router:`Navigating and clearing navigations`,ngrx:`Restoring NgRx state and dispatching actions`,http:`Changing HTTP mock rules and SSR overrides, and clearing HTTP calls`,analog:`Calling API routes and clearing server calls`,components:`Editing component properties and signals`,tanstackQuery:`Invalidating and refetching TanStack queries`,plugins:`Running plugin actions`}[e]} is turned off in the devtools config (actions.${e}).`}var kT=[`pangular:build-meta`],AT={components:`Components`,injectors:`Injectors`,signals:`Signals`,ngrx:`NgRx`,tanstackQuery:`TanStack Query`,forms:`Forms`,router:`Router`,pipes:`Pipes`,http:`HTTP`,analog:`Analog`,capacitor:`Capacitor`,errors:`Errors`,plugins:`Plugins`},jT={forms:`Form writes`,router:`Navigation`,ngrx:`NgRx restore and dispatch`,http:`HTTP mocking`,analog:`Analog API calls`,components:`Component edits`,tanstackQuery:`TanStack Query invalidate and refetch`,plugins:`Plugin actions`},MT={refreshMs:e=>`poll every ${e} ms`,navigations:e=>`${e} navigations`,formTimeline:e=>`${e} form events`,httpCalls:e=>`${e} HTTP calls`,changeLog:e=>`${e} NgRx changes`,cdCycles:e=>`${e} change detection cycles`,capacitorCalls:e=>`${e} Capacitor plugin calls`,idleAfterMs:e=>e?`idle ${e/1e3} s after the last agent call`:`never idle`};function NT(e){let t=[],n=(e,n)=>{n.length&&t.push({label:e,value:n.join(`, `)})},r=Gw.filter(t=>e.inspectors[t]);n(`Inspectors off`,Gw.filter(t=>!e.inspectors[t]).map(e=>AT[e])),n(`Agent`,e.agent.readOnly?[`Read-only`]:[]),n(`Hidden from the agent`,r.filter(t=>!e.agent.tools[t]).map(e=>AT[e])),n(`Blocked actions`,Jw.filter(t=>e.inspectors[t]&&!e.actions[t]).map(e=>jT[e])),n(`Extra secret names`,e.redaction.secretNames),n(`Unmasked names`,e.redaction.unmask),n(`Limits`,Object.keys(Yw).filter(t=>e.limits[t]!==Yw[t].default).map(t=>MT[t](e.limits[t]))),e.popup.hotkey!==`Alt+Shift+P`&&n(`Popup shortcut`,[e.popup.hotkey===!1?`Off`:e.popup.hotkey]);let i=Object.entries(e.plugins??{});return n(`Plugins off`,i.filter(([,e])=>!e.enabled).map(([e])=>e)),n(`Plugin tools or actions off`,i.filter(([,e])=>e.enabled&&(!e.tools||!e.actions)).map(([e,t])=>`${e} (${[!t.tools&&`tools`,!t.actions&&`actions`].filter(Boolean).join(`, `)})`)),t}function PT(e){let t={tags:[],directives:[],text:``},n=e.toLowerCase();return n=n.replace(/<\s*([^<>\s]+)\s*>/g,(e,n)=>(t.tags.push({value:n,exact:!0}),` `)),n=n.replace(/\[\s*([^[\]\s]+)\s*\]/g,(e,n)=>(t.directives.push({value:n,exact:!0}),` `)),n=n.replace(/(^|\s)([<[])([^<>[\]\s]*)$/,(e,n,r,i)=>(i&&(r===`<`?t.tags:t.directives).push({value:i,exact:!1}),n)),t.text=n.replace(/\s+/g,` `).trim(),t}function FT(e){return!e.tags.length&&!e.directives.length&&!e.text}function IT(e,t){let n=e.tag.toLowerCase(),r=(e.directives??[]).map(e=>e.toLowerCase()),i=(e.attributes??[]).map(e=>e.toLowerCase()),a=[...r,...r.map(e=>e.replace(/directive$/,``)),...i];for(let{value:e,exact:r}of t.tags)if(r?n!==e:!n.startsWith(e))return!1;for(let{value:e,exact:n}of t.directives)if(!a.some(t=>n?t===e:t.includes(e)))return!1;if(t.text){let a=t.text;if(!(e.name.toLowerCase().includes(a)||n.includes(a)||r.some(e=>e.includes(a))||i.some(e=>e.includes(a))))return!1}return!0}var LT={debugApi:{subject:`Live data`,since:`12.0`},injectorProviders:{subject:`Reading providers and environment injectors`,since:`16.2`},injectorMetadata:{subject:`The full injector tree`,since:`17.0`},isSignal:{subject:`Telling signals apart in component values`,since:`17.1`},signalGraph:{subject:`The live signal graph`,since:`20.1`},deferBlocks:{subject:`Listing @defer blocks`,since:`19.1`},forBlocks:{subject:`Listing @for blocks`,since:`22.0`},profiler:{subject:`Recording change detection`,since:`20.0`},angularProfiling:{subject:`Angular profiling`,since:`20.0`},routerInstance:{subject:`The router debug util`,since:`20.3`}};function RT(e){let t=/^(\d+)\.(\d+)/.exec(e.trim());return t?`${t[1]}.${t[2]}`:e.trim()}function zT(e){let t=/^(\d+)(?:\.(\d+))?/.exec(e.trim());return t?[Number(t[1]),Number(t[2]??0)]:null}function BT(e,t){let n=zT(e),r=zT(t);return!n||!r?!1:n[0]===r[0]?n[1]>=r[1]:n[0]>r[0]}function VT(e,t){return e?.capabilities?.[t]===!1}function HT(e,t){let n=LT[e],r=`${n.subject} needs Angular ${n.since} or later`;if(!t)return`${r}; this page's Angular version is unknown.`;let i=RT(t);return BT(t,n.since)?`${r} in a development build; this page runs Angular ${i} without it, which usually means a production build.`:`${r}; this page runs Angular ${i}.`}var UT=`pangular-page-id`,WT=null;function GT(e){WT=e}function KT(){if(WT)return WT;try{return new URLSearchParams(location.search).get(`pageId`)||(window.top===window?null:sessionStorage.getItem(UT)||null)}catch{return null}}function qT(e,t){if(t.chosen&&e[t.chosen])return t.chosen;if(t.host)return t.host;if(t.previous&&e[t.previous])return t.previous;let n=null;for(let t of Object.values(e))(!n||t.reportedAt>n.reportedAt)&&(n=t);return n?.pageId??null}function JT(e,t){return e?t?e.pages?.[t]??null:e:null}function YT(e,t){return e?t?e.pages?.[t]??null:e.graph??null:null}function XT(){return{functions:[...kT]}}function ZT(e,t,n){return e?e.scope(`pangular`).rpc.call(t,...n===void 0?[]:[n]):Promise.resolve(null)}function QT(e,t,n){return ZT(e,t,n).then(e=>e,()=>null)}function $T(e){return e?.connectionMeta.backend===`static`}function eE(e){let t=()=>{let t=e()?.scope(`pangular`).rpc;t&&(t.callEvent(`request-page-highlight`,null),t.callEvent(`request-form-highlight`,null))};return addEventListener(`pagehide`,t),()=>{removeEventListener(`pagehide`,t),t()}}function tE(e=globalThis){delete e.__DEVFRAME_CONNECTION__,delete e.__DEVFRAME_CONNECTION_META__}function nE(e){return e.split(`@`)[1]??``}var rE={signal:`Signal Forms`,reactive:`Reactive`,template:`Template-driven`},iE={own:`validator`,directive:`template attribute`,tree:`cross-field rule`,async:`async`,parse:`parse`,submission:`server`,schema:`schema`,manual:`setErrors`},aE=QT,oE={key:`name looks secret`,"input-type":`password input`,autocomplete:`autocomplete is a secret kind`,marker:`marked as mask`,parent:`inside a secret group`,config:`listed in mask`};function sE(e){return oE[e]??e}var cE=`https://pangular-inspector.dev/security/#opt-fields-in-or-out`;async function lE(e,t){return await aE(e,`request-form-action`,t)??{ok:!1,error:`The devtools server did not answer.`}}function uE(e){return`${e.ok?e.message??`Done.`:e.error??`Failed.`}${e.skipped?.length?` Skipped: ${e.skipped.map(e=>`${e.path} (${e.reason})`).join(`, `)}.`:``}${e.status?` Status: ${e.status}.`:``}`}var dE=/"(?:[^"\\\n]|\\.)*"|`([^`\n]*)`|\*\*/g;function fE(e){return(e??``).replace(/^_Labels, paths.*_\n\n/,``).replace(dE,(e,t)=>t??(e===`**`?``:e))}function pE(e){return DT(e?.connectionMeta)}function mE(e,t){return pE(e).actions[t]}var hE={components:`components`,routes:`router`,signals:`signals`,injectors:`injectors`,store:`ngrx`,queries:`tanstackQuery`,forms:`forms`,pipes:`pipes`,network:`http`,analog:`analog`,capacitor:`capacitor`,errors:`errors`,plugins:`plugins`};function gE(e){return hE[e]}var _E=`https://pangular-inspector.dev/getting-started/configuration/#inspectors-and-agent-tools`;function vE(e,t){let n=hE[e];return!n||t.inspectors[n]}function yE(e,t){e&1&&(E(),jg(0,`rect`,5)(1,`rect`,6)(2,`rect`,7)(3,`rect`,8))}function bE(e,t){e&1&&(E(),jg(0,`path`,9)(1,`circle`,10)(2,`circle`,11)(3,`path`,12))}function xE(e,t){e&1&&(E(),jg(0,`path`,13)(1,`path`,14))}function SE(e,t){e&1&&(E(),jg(0,`path`,15)(1,`path`,16)(2,`path`,17))}function CE(e,t){e&1&&(E(),jg(0,`circle`,18)(1,`path`,19)(2,`circle`,20))}function wE(e,t){e&1&&(E(),jg(0,`path`,1))}function TE(e,t){e&1&&(E(),jg(0,`path`,21)(1,`path`,22)(2,`path`,23)(3,`path`,24))}function EE(e,t){e&1&&(E(),jg(0,`ellipse`,25)(1,`path`,26)(2,`path`,27))}function DE(e,t){e&1&&(E(),jg(0,`rect`,28)(1,`path`,29)(2,`path`,30)(3,`path`,31))}function OE(e,t){e&1&&(E(),jg(0,`circle`,32)(1,`path`,9)(2,`path`,33))}function kE(e,t){e&1&&(E(),jg(0,`path`,34)(1,`path`,35)(2,`path`,36)(3,`path`,37)(4,`circle`,38))}function AE(e,t){e&1&&(E(),jg(0,`circle`,39)(1,`path`,40))}function jE(e,t){e&1&&(E(),jg(0,`ellipse`,41)(1,`path`,42)(2,`path`,43)(3,`path`,44)(4,`path`,45))}function ME(e,t){e&1&&(E(),jg(0,`circle`,32)(1,`path`,46)(2,`path`,47))}function NE(e,t){e&1&&(E(),jg(0,`path`,2))}function PE(e,t){e&1&&(E(),jg(0,`path`,3))}function FE(e,t){e&1&&(E(),jg(0,`path`,4))}var IE=class e{name=$.required();static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-tab-icon`]],inputs:{name:[1,`name`]},decls:18,vars:1,consts:[[`viewBox`,`0 0 24 24`,`width`,`16`,`height`,`16`,`fill`,`none`,`stroke`,`currentColor`,`stroke-width`,`1.8`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,`aria-hidden`,`true`],[`d`,`M22 12h-4l-3 9L9 3l-3 9H2`],[`d`,`M10 3h4v3a2 2 0 1 0 4 0V5h1a2 2 0 0 1 2 2v4h-2a2 2 0 1 0 0 4h2v4a2 2 0 0 1-2 2h-4v-2a2 2 0 1 0-4 0v2H7a2 2 0 0 1-2-2v-4H4a2 2 0 1 1 0-4h1V7a2 2 0 0 1 2-2h3Z`],[`d`,`m8 3 4 8 5-5 5 15H2L8 3z`],[`fill`,`currentColor`,`stroke`,`none`,`transform`,`translate(1.8 1.8) scale(0.85)`,`d`,`M24 3.7l-5.766 5.766 5.725 5.736-3.713 3.712L5.073 3.742 8.786.03l5.736 5.726L20.284 0 24 3.7zM.029 8.785l3.713-3.713 15.173 15.173-3.713 3.714-5.732-5.726L3.7 24 0 20.285l5.754-5.764L.029 8.785z`],[`x`,`3`,`y`,`3`,`width`,`7`,`height`,`9`,`rx`,`1.5`],[`x`,`14`,`y`,`3`,`width`,`7`,`height`,`5`,`rx`,`1.5`],[`x`,`14`,`y`,`12`,`width`,`7`,`height`,`9`,`rx`,`1.5`],[`x`,`3`,`y`,`16`,`width`,`7`,`height`,`5`,`rx`,`1.5`],[`d`,`M3 12h18`],[`cx`,`7`,`cy`,`12`,`r`,`2`],[`cx`,`14`,`cy`,`12`,`r`,`2`],[`d`,`M18 7v10`],[`d`,`M9 11l2 2 4-4`],[`d`,`M12 3 4 6v6c0 4.5 3.4 8.3 8 9 4.6-.7 8-4.5 8-9V6l-8-3Z`],[`d`,`M12 2 3 7l9 5 9-5-9-5Z`],[`d`,`m3 12 9 5 9-5`],[`d`,`m3 17 9 5 9-5`],[`cx`,`6`,`cy`,`19`,`r`,`3`],[`d`,`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`],[`cx`,`18`,`cy`,`5`,`r`,`3`],[`d`,`M12 22v-5`],[`d`,`M9 8V2`],[`d`,`M15 8V2`],[`d`,`M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z`],[`cx`,`12`,`cy`,`5`,`rx`,`9`,`ry`,`3`],[`d`,`M3 5v14a9 3 0 0 0 18 0V5`],[`d`,`M3 12a9 3 0 0 0 18 0`],[`x`,`3`,`y`,`4`,`width`,`18`,`height`,`16`,`rx`,`2`],[`d`,`M7 9h10`],[`d`,`M7 13h6`],[`d`,`M7 17h8`],[`cx`,`12`,`cy`,`12`,`r`,`9`],[`d`,`M12 3a14 14 0 0 1 0 18a14 14 0 0 1 0-18Z`],[`d`,`M4 7h10`],[`d`,`M4 17h6`],[`d`,`m14 13 4 4-4 4`],[`d`,`M10 17h8`],[`cx`,`18`,`cy`,`7`,`r`,`3`],[`cx`,`12`,`cy`,`12`,`r`,`3`],[`d`,`M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1Z`],[`cx`,`11`,`cy`,`5`,`rx`,`8`,`ry`,`3`],[`d`,`M3 5v6c0 1.66 3.58 3 8 3`],[`d`,`M3 11v6c0 1.66 3.58 3 8 3`],[`d`,`M21 14a4 4 0 1 1-1.2-2.85L21 12.3`],[`d`,`M21 9v3.3h-3.3`],[`d`,`M12 7v6`],[`d`,`M12 16.5v.01`]],template:function(e,t){if(e&1&&(E(),z(0,`svg`,0),j(1,yE,4,0)(2,bE,4,0)(3,xE,2,0)(4,SE,3,0)(5,CE,3,0)(6,wE,1,0,`:svg:path`,1)(7,TE,4,0)(8,EE,3,0)(9,DE,4,0)(10,OE,3,0)(11,kE,5,0)(12,AE,2,0)(13,jE,5,0)(14,ME,3,0)(15,NE,1,0,`:svg:path`,2)(16,PE,1,0,`:svg:path`,3)(17,FE,1,0,`:svg:path`,4),B()),e&2){let e;O(),M((e=t.name())===`dashboard`?1:e===`timeline`?2:e===`audit`?3:e===`components`?4:e===`routes`?5:e===`signals`?6:e===`injectors`?7:e===`store`?8:e===`forms`?9:e===`network`?10:e===`pipes`?11:e===`settings`?12:e===`queries`?13:e===`errors`?14:e===`plugins`?15:e===`analog`?16:e===`capacitor`?17:-1)}},styles:[`[_nghost-%COMP%] { +`);return r>=0?n.slice(0,r):n}function wi(e,t){return e?t?`${e} ${t}`:e:t||``}var Ti=xi({__forward_ref__:xi});function Ei(e){return e.__forward_ref__=Ei,e}function Di(e){return Oi(e)?e():e}function Oi(e){return typeof e==`function`&&Object.hasOwn(e,Ti)&&e.__forward_ref__===Ei}function ki(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function Ai(e){return ji(e,Pi)}function ji(e,t){return Object.hasOwn(e,t)&&e[t]||null}function Mi(e){return(e?.[Pi]??null)||null}function Ni(e){return e&&Object.hasOwn(e,Fi)?e[Fi]:null}var Pi=xi({ɵprov:xi}),Fi=xi({ɵinj:xi}),Ii=class{_desc;ngMetadataName=`InjectionToken`;ɵprov;constructor(e,t){this._desc=e,this.ɵprov=void 0,typeof t==`number`?this.__NG_ELEMENT_ID__=t:t!==void 0&&(this.ɵprov=ki({token:this,providedIn:t.providedIn||`root`,factory:t.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};function Li(e){return e&&!!e.ɵproviders}var Ri=xi({ɵcmp:xi}),zi=xi({ɵdir:xi}),Bi=xi({ɵpipe:xi}),Vi=xi({ɵfac:xi}),Hi=xi({__NG_ELEMENT_ID__:xi}),Ui=xi({__NG_ENV_ID__:xi});function Wi(e){return qi(e,`@Component`),e[Ri]||null}function Gi(e){return qi(e,`@Directive`),e[zi]||null}function Ki(e){return qi(e,`@Pipe`),e[Bi]||null}function qi(e,t){if(e==null)throw new vi(-919,!1)}function Ji(e){return typeof e==`string`?e:e==null?``:String(e)}var Yi=xi({ngErrorCode:xi}),Xi=xi({ngErrorMessage:xi}),Zi=xi({ngTokenPath:xi});function Qi(e,t){return ea(``,-200,t)}function $i(e,t){throw new vi(-201,!1)}function ea(e,t,n){let r=new vi(t,e);return r[Yi]=t,r[Xi]=e,n&&(r[Zi]=n),r}function ta(e){return e[Yi]}var na;function ra(){return na}function ia(e){let t=na;return na=e,t}function aa(e,t,n){let r=Ai(e);if(r&&r.providedIn==`root`)return r.value===void 0?r.value=r.factory():r.value;if(n&8)return null;if(t!==void 0)return t;$i(e,``)}var oa=globalThis,sa={},ca=`__NG_DI_FLAG__`,la=class{injector;constructor(e){this.injector=e}retrieve(e,t){let n=fa(t)||0;try{return this.injector.get(e,n&8?null:sa,n)}catch(e){if(qn(e))return e;throw e}}};function ua(e,t=0){let n=Wn();if(n===void 0)throw new vi(-203,!1);if(n===null)return aa(e,void 0,t);{let r=pa(t),i=n.retrieve(e,r);if(qn(i)){if(r.optional)return null;throw i}return i}}function da(e,t=0){return(ra()||ua)(Di(e),t)}function C(e,t){return da(e,fa(t))}function fa(e){return e===void 0||typeof e==`number`?e:0|(e.optional&&8)|(e.host&&1)|(e.self&&2)|(e.skipSelf&&4)}function pa(e){return{optional:!!(e&8),host:!!(e&1),self:!!(e&2),skipSelf:!!(e&4)}}function ma(e){let t=[];for(let n=0;nArray.isArray(e)?ya(e,t):t(e))}function ba(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function xa(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function Sa(e,t){let n=[];for(let r=0;rt;){let t=i-2;e[i]=e[t],i--}e[t]=n,e[t+1]=r}}function wa(e,t,n){let r=Ea(e,t);return r>=0?e[r|1]=n:(r=~r,Ca(e,r,t,n)),r}function Ta(e,t){let n=Ea(e,t);if(n>=0)return e[n|1]}function Ea(e,t){return Da(e,t,1)}function Da(e,t,n){let r=0,i=e.length>>n;for(;i!==r;){let a=r+(i-r>>1),o=e[a<t?i=a:r=a+1}return~(i<{n.push(e)};return ya(t,e=>{let t=e;La(t,a,[],r)&&(i||=[],i.push(t))}),i!==void 0&&Ia(i,a),n}function Ia(e,t){for(let n=0;n{t(e,r)})}}function La(e,t,n,r){if(e=Di(e),!e)return!1;let i=null,a=Ni(e),o=!a&&Wi(e);if(!a&&!o){let t=e.ngModule;if(a=Ni(t),a)i=t;else return!1}else if(o&&!o.standalone)return!1;else i=e;let s=r.has(i);if(o){if(s)return!1;if(r.add(i),o.dependencies){let e=typeof o.dependencies==`function`?o.dependencies():o.dependencies;for(let i of e)La(i,t,n,r)}}else if(a){if(a.imports!=null&&!s){r.add(i);let e;try{ya(a.imports,i=>{La(i,t,n,r)&&(e||=[],e.push(i))})}finally{}e!==void 0&&Ia(e,t)}if(!s){let e=ga(i)||(()=>new i);t({provide:i,useFactory:e,deps:ka},i),t({provide:Ma,useValue:i,multi:!0},i),t({provide:Aa,useValue:()=>da(i),multi:!0},i)}let o=a.providers;if(o!=null&&!s){let n=e;Ra(o,e=>{t(e,n)})}}else return!1;return i!==e&&e.providers!==void 0}function Ra(e,t){for(let n of e)Li(n)&&(n=n.ɵproviders),Array.isArray(n)?Ra(n,t):t(n)}var za=xi({provide:String,useValue:xi});function Ba(e){return typeof e==`object`&&!!e&&za in e}function Va(e){return!!(e&&e.useExisting)}function Ha(e){return!!(e&&e.useFactory)}function Ua(e){return typeof e==`function`}function Wa(e){return!!e.useClass}var Ga=new Ii(``),Ka={},qa={},Ja=void 0;function Ya(){return Ja===void 0&&(Ja=new Na),Ja}var Xa=class{},Za=class extends Xa{parent;source;scopes;records=new Map;_ngOnDestroyHooks=new Set;_onDestroyHooks=[];get destroyed(){return this._destroyed}_destroyed=!1;injectorDefTypes;constructor(e,t,n,r){super(),this.parent=t,this.source=n,this.scopes=r,so(e,e=>this.processProvider(e)),this.records.set(ja,ro(void 0,this)),r.has(`environment`)&&this.records.set(Xa,ro(void 0,this));let i=this.records.get(Ga);i!=null&&typeof i.value==`string`&&this.scopes.add(i.value),this.injectorDefTypes=new Set(this.get(Ma,ka,{self:!0}))}retrieve(e,t){let n=fa(t)||0;try{return this.get(e,sa,n)}catch(e){if(qn(e))return e;throw e}}destroy(){no(this),this._destroyed=!0;let e=rn(null);try{for(let e of this._ngOnDestroyHooks)e.ngOnDestroy();let e=this._onDestroyHooks;this._onDestroyHooks=[];for(let t of e)t()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),rn(e)}}onDestroy(e){return no(this),this._onDestroyHooks.push(e),()=>this.removeOnDestroy(e)}runInContext(e){no(this);let t=Gn(this),n=ia(void 0);try{return e()}finally{Gn(t),ia(n)}}get(e,t=sa,n){if(no(this),Object.hasOwn(e,Ui))return e[Ui](this);let r=fa(n),i=Gn(this),a=ia(void 0);try{if(!(r&4)){let t=this.records.get(e);if(t===void 0){let n=oo(e)&&Ai(e);t=n&&this.injectableDefInScope(n)?ro(Qa(e),Ka):null,this.records.set(e,t)}if(t!=null)return this.hydrate(e,t,r)}let n=r&2?Ya():this.parent;return t=r&8&&t===sa?null:t,n.get(e,t)}catch(e){let t=ta(e);throw t===-200||t===-201?new vi(t,null):e}finally{ia(a),Gn(i)}}resolveInjectorInitializers(){let e=rn(null),t=Gn(this),n=ia(void 0);try{let e=this.get(Aa,ka,{self:!0});for(let t of e)t()}finally{Gn(t),ia(n),rn(e)}}toString(){return`R3Injector[...]`}processProvider(e){e=Di(e);let t=Ua(e)?e:Di(e&&e.provide),n=eo(e);if(!Ua(e)&&e.multi===!0){let n=this.records.get(t);n||(n=ro(void 0,Ka,!0),n.factory=()=>ma(n.multi),this.records.set(t,n)),t=e,n.multi.push(e)}this.records.set(t,n)}hydrate(e,t,n){let r=rn(null);try{if(t.value===qa)throw Qi(``);return t.value===Ka&&(t.value=qa,t.value=t.factory(void 0,n)),typeof t.value==`object`&&t.value&&ao(t.value)&&this._ngOnDestroyHooks.add(t.value),t.value}finally{rn(r)}}injectableDefInScope(e){if(!e.providedIn)return!1;let t=Di(e.providedIn);return typeof t==`string`?t===`any`||this.scopes.has(t):this.injectorDefTypes.has(t)}removeOnDestroy(e){let t=this._onDestroyHooks.indexOf(e);t!==-1&&this._onDestroyHooks.splice(t,1)}};function Qa(e){let t=Ai(e),n=t===null?ga(e):t.factory;if(n!==null)return n;if(e instanceof Ii)throw new vi(-204,!1);if(e instanceof Function)return $a(e);throw new vi(-204,!1)}function $a(e){if(e.length>0)throw new vi(-204,!1);let t=Mi(e);return t===null?()=>new e:()=>t.factory(e)}function eo(e){return Ba(e)?ro(void 0,e.useValue):ro(to(e),Ka)}function to(e,t,n){let r;if(Ua(e)){let t=Di(e);return ga(t)||Qa(t)}if(Ba(e))r=()=>Di(e.useValue);else if(Ha(e))r=()=>e.useFactory(...ma(e.deps||[]));else if(Va(e))r=(t,n)=>da(Di(e.useExisting),n!==void 0&&n&8?8:void 0);else{let t=Di(e&&(e.useClass||e.provide));if(io(e))r=()=>new t(...ma(e.deps));else return ga(t)||Qa(t)}return r}function no(e){if(e.destroyed)throw new vi(-205,!1)}function ro(e,t,n=!1){return{factory:e,value:t,multi:n?[]:void 0}}function io(e){return!!e.deps}function ao(e){return typeof e==`object`&&!!e&&typeof e.ngOnDestroy==`function`}function oo(e){return typeof e==`function`||typeof e==`object`&&e.ngMetadataName===`InjectionToken`}function so(e,t){for(let n of e)Array.isArray(n)?so(n,t):n&&Li(n)?so(n.ɵproviders,t):t(n)}function co(e,t){let n;e instanceof Za?(no(e),n=e):n=new la(e);let r=Gn(n),i=ia(void 0);try{return t()}finally{Gn(r),ia(i)}}function lo(){return ra()!==void 0||Wn()!=null}var uo=1;function fo(e){return Array.isArray(e)&&typeof e[uo]==`object`}function po(e){return Array.isArray(e)&&e[uo]===!0}function mo(e){return!!(e.flags&4)}function ho(e){return e.componentOffset>-1}function go(e){return(e.flags&1)==1}function _o(e){return!!e.template}function vo(e){return!!(e[2]&512)}function yo(e){return(e[2]&256)==256}var bo=(function(e){return e[e.NONE=0]=`NONE`,e[e.HTML=1]=`HTML`,e[e.STYLE=2]=`STYLE`,e[e.SCRIPT=3]=`SCRIPT`,e[e.URL=4]=`URL`,e[e.RESOURCE_URL=5]=`RESOURCE_URL`,e[e.ATTRIBUTE_NO_BINDING=6]=`ATTRIBUTE_NO_BINDING`,e})(bo||{}),xo=`math`;function So(e){for(;Array.isArray(e);)e=e[0];return e}function Co(e,t){return So(t[e])}function wo(e,t){return So(t[e.index])}function To(e,t){return e.data[t]}function Eo(e,t){return e[t]}function Do(e,t,n,r){n>=e.data.length&&(e.data[n]=null,e.blueprint[n]=null),t[n]=r}function Oo(e,t){let n=t[e];return fo(n)?n:n[0]}function ko(e){return(e[2]&128)==128}function Nee(e){return po(e[3])}function Ao(e,t){return t==null?null:e[t]}function jo(e){e[17]=0}function Mo(e){e[2]&1024||(e[2]|=1024,ko(e)&&Fo(e))}function Pee(e,t){for(;e>0;)t=t[14],e--;return t}function No(e){return!!(e[2]&9216||e[24]?.dirty)}function Po(e){e[10].changeDetectionScheduler?.notify(8),e[2]&64&&(e[2]|=1024),No(e)&&Fo(e)}function Fo(e){e[10].changeDetectionScheduler?.notify(0);let t=Lo(e);for(;t!==null&&!(t[2]&8192||(t[2]|=8192,!ko(t)));)t=Lo(t)}function Io(e,t){if(yo(e))throw new vi(911,!1);e[21]===null&&(e[21]=[]),e[21].push(t)}function Fee(e,t){if(e[21]===null)return;let n=e[21].indexOf(t);n!==-1&&e[21].splice(n,1)}function Lo(e){let t=e[3];return po(t)?t[3]:t}function Ro(e){return e[7]??=[]}function zo(e){return e.cleanup??=[]}function Iee(e,t,n,r){let i=Ro(t);i.push(n),e.firstCreatePass&&zo(e).push(r,i.length-1)}var Bo={lFrame:hs(null),bindingsEnabled:!0,skipHydrationRootTNode:null},Vo=!1;function Lee(){return Bo.lFrame.elementDepthCount}function Ree(){Bo.lFrame.elementDepthCount++}function Ho(){Bo.lFrame.elementDepthCount--}function Uo(){return Bo.bindingsEnabled}function Wo(){return Bo.skipHydrationRootTNode!==null}function Go(e){return Bo.skipHydrationRootTNode===e}function Ko(){Bo.skipHydrationRootTNode=null}function qo(){return Bo.lFrame.lView}function Jo(){return Bo.lFrame.tView}function w(e){return Bo.lFrame.contextLView=e,e[8]}function T(e){return Bo.lFrame.contextLView=null,e}function Yo(){let e=Xo();for(;e!==null&&e.type===64;)e=e.parent;return e}function Xo(){return Bo.lFrame.currentTNode}function zee(){let e=Bo.lFrame,t=e.currentTNode;return e.isParent?t:t.parent}function Zo(e,t){let n=Bo.lFrame;n.currentTNode=e,n.isParent=t}function Qo(){return Bo.lFrame.isParent}function $o(){Bo.lFrame.isParent=!1}function es(){return Bo.lFrame.contextLView}function ts(){return Vo}function ns(e){let t=Vo;return Vo=e,t}function rs(){let e=Bo.lFrame,t=e.bindingRootIndex;return t===-1&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}function is(){return Bo.lFrame.bindingIndex}function Bee(e){return Bo.lFrame.bindingIndex=e}function as(){return Bo.lFrame.bindingIndex++}function os(e){let t=Bo.lFrame,n=t.bindingIndex;return t.bindingIndex+=e,n}function Vee(){return Bo.lFrame.inI18n}function Hee(e,t){let n=Bo.lFrame;n.bindingIndex=n.bindingRootIndex=e,ss(t)}function Uee(){return Bo.lFrame.currentDirectiveIndex}function ss(e){Bo.lFrame.currentDirectiveIndex=e}function cs(e){let t=Bo.lFrame.currentDirectiveIndex;return t===-1?null:e[t]}function ls(){return Bo.lFrame.currentQueryIndex}function us(e){Bo.lFrame.currentQueryIndex=e}function ds(e){let t=e[1];return t.type===2?t.declTNode:t.type===1?e[5]:null}function fs(e,t,n){if(n&4){let r=t,i=e;for(;r=r.parent,r===null&&!(n&1)&&(r=ds(i),!(r===null||(i=i[14],r.type&10))););if(r===null)return!1;t=r,e=i}let r=Bo.lFrame=ms();return r.currentTNode=t,r.lView=e,!0}function ps(e){let t=ms(),n=e[1];Bo.lFrame=t,t.currentTNode=n.firstChild,t.lView=e,t.tView=n,t.contextLView=e,t.bindingIndex=n.bindingStartIndex,t.inI18n=!1}function ms(){let e=Bo.lFrame,t=e===null?null:e.child;return t===null?hs(e):t}function hs(e){let t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null,inI18n:!1};return e!==null&&(e.child=t),t}function gs(){let e=Bo.lFrame;return Bo.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}var _s=gs;function vs(){let e=gs();e.isParent=!0,e.tView=null,e.selectedIndex=-1,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function ys(e){return(Bo.lFrame.contextLView=Pee(e,Bo.lFrame.contextLView))[8]}function bs(){return Bo.lFrame.selectedIndex}function xs(e){Bo.lFrame.selectedIndex=e}function Ss(){let e=Bo.lFrame;return To(e.tView,e.selectedIndex)}function E(){Bo.lFrame.currentNamespace=`svg`}function Cs(){ws()}function ws(){Bo.lFrame.currentNamespace=null}function Ts(){return Bo.lFrame.currentNamespace}var Es=!0;function Ds(){return Es}function Os(e){Es=e}function ks(e,t=null,n=null,r){let i=As(e,t,n,r);return i.resolveInjectorInitializers(),i}function As(e,t=null,n=null,r,i=new Set){return new Za([n||ka,Pa(e)],t||Ya(),null,i)}var js=class e{static THROW_IF_NOT_FOUND=sa;static NULL=new Na;static create(e,t){if(Array.isArray(e))return ks({name:``},t,e,``);{let t=e.name??``;return ks({name:t},e.parent,e.providers,t)}}static ɵprov=ki({token:e,providedIn:`any`,factory:()=>da(ja)});static __NG_ELEMENT_ID__=-1},Ms=new Ii(``),Ns=class{static __NG_ELEMENT_ID__=Fs;static __NG_ENV_ID__=e=>e},Ps=class extends Ns{_lView;constructor(e){super(),this._lView=e}get destroyed(){return yo(this._lView)}onDestroy(e){let t=this._lView;return Io(t,e),()=>Fee(t,e)}};function Fs(){return new Ps(qo())}var Is=new Ii(``),Ls=(()=>{class e{taskId=0;pendingTasks=new Set;destroyed=!1;pendingTask=new Zr(!1);debugTaskTracker=C(Is,{optional:!0});get hasPendingTasks(){return!this.destroyed&&this.pendingTask.value}get hasPendingTasksObservable(){return this.destroyed?new Br(e=>{e.next(!1),e.complete()}):this.pendingTask}add(){!this.hasPendingTasks&&!this.destroyed&&this.pendingTask.next(!0);let e=this.taskId++;return this.pendingTasks.add(e),this.debugTaskTracker?.add(e),e}has(e){return this.pendingTasks.has(e)}remove(e){this.pendingTasks.delete(e),this.debugTaskTracker?.remove(e),this.pendingTasks.size===0&&this.hasPendingTasks&&this.pendingTask.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this.hasPendingTasks&&this.pendingTask.next(!1),this.destroyed=!0,this.pendingTask.unsubscribe()}static ɵprov=ki({token:e,providedIn:`root`,factory:()=>new e})}return e})(),Rs=class extends Yr{__isAsync;destroyRef=void 0;pendingTasks=void 0;constructor(e=!1){super(),this.__isAsync=e,lo()&&(this.destroyRef=C(Ns,{optional:!0})??void 0,this.pendingTasks=C(Ls,{optional:!0})??void 0)}emit(e){let t=rn(null);try{super.next(e)}finally{rn(t)}}subscribe(e,t,n){let r=e,i=t||(()=>null),a=n;if(e&&typeof e==`object`){let t=e;r=t.next?.bind(t),i=t.error?.bind(t),a=t.complete?.bind(t)}this.__isAsync&&(i=this.wrapInTimeout(i),r&&=this.wrapInTimeout(r),a&&=this.wrapInTimeout(a));let o=super.subscribe({next:r,error:i,complete:a});return e instanceof pr&&e.add(o),o}wrapInTimeout(e){return t=>{let n=this.pendingTasks?.add();setTimeout(()=>{try{e(t)}finally{n!==void 0&&this.pendingTasks?.remove(n)}})}}};function zs(...e){}function Bs(e){let t,n;function r(){e=zs;try{n!==void 0&&typeof cancelAnimationFrame==`function`&&cancelAnimationFrame(n),t!==void 0&&clearTimeout(t)}catch{}}return t=setTimeout(()=>{e(),r()}),typeof requestAnimationFrame==`function`&&(n=requestAnimationFrame(()=>{e(),r()})),()=>r()}function Vs(e){return queueMicrotask(()=>e()),()=>{e=zs}}var Hs=`isAngularZone`,Us=`isAngularZone_ID`,Ws=0,Gs=class e{hasPendingMacrotasks=!1;hasPendingMicrotasks=!1;isStable=!0;onUnstable=new Rs(!1);onMicrotaskEmpty=new Rs(!1);onStable=new Rs(!1);onError=new Rs(!1);constructor(e){let{enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:n=!1,shouldCoalesceRunChangeDetection:r=!1,scheduleInRootZone:i=!1}=e;if(typeof Zone>`u`)throw new vi(908,!1);Zone.assertZonePatched();let a=this;a._nesting=0,a._outer=a._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(a._inner=a._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(a._inner=a._inner.fork(Zone.longStackTraceZoneSpec)),a.shouldCoalesceEventChangeDetection=!r&&n,a.shouldCoalesceRunChangeDetection=r,a.callbackScheduled=!1,a.scheduleInRootZone=i,Ys(a)}static isInAngularZone(){return typeof Zone<`u`&&Zone.current.get(Hs)===!0}static assertInAngularZone(){if(!e.isInAngularZone())throw new vi(909,!1)}static assertNotInAngularZone(){if(e.isInAngularZone())throw new vi(909,!1)}run(e,t,n){return this._inner.run(e,t,n)}runTask(e,t,n,r){let i=this._inner,a=i.scheduleEventTask(`NgZoneEvent: `+r,e,Ks,zs,zs);try{return i.runTask(a,t,n)}finally{i.cancelTask(a)}}runGuarded(e,t,n){return this._inner.runGuarded(e,t,n)}runOutsideAngular(e){return this._outer.run(e)}},Ks={};function qs(e){if(e._nesting==0&&!e.hasPendingMicrotasks&&!e.isStable)try{e._nesting++,e.onMicrotaskEmpty.emit(null)}finally{if(e._nesting--,!e.hasPendingMicrotasks)try{e.runOutsideAngular(()=>e.onStable.emit(null))}finally{e.isStable=!0}}}function Js(e){if(e.isCheckStableRunning||e.callbackScheduled)return;e.callbackScheduled=!0;function t(){Bs(()=>{e.callbackScheduled=!1,Xs(e),e.isCheckStableRunning=!0,qs(e),e.isCheckStableRunning=!1})}e.scheduleInRootZone?Zone.root.run(()=>{t()}):e._outer.run(()=>{t()}),Xs(e)}function Ys(e){let t=()=>{Js(e)},n=Ws++;e._inner=e._inner.fork({name:`angular`,properties:{[Hs]:!0,[Us]:n,[Us+n]:!0},onInvokeTask:(n,r,i,a,o,s)=>{if(ec(s))return n.invokeTask(i,a,o,s);try{return Zs(e),n.invokeTask(i,a,o,s)}finally{(e.shouldCoalesceEventChangeDetection&&a.type===`eventTask`||e.shouldCoalesceRunChangeDetection)&&t(),Qs(e)}},onInvoke:(n,r,i,a,o,s,c)=>{try{return Zs(e),n.invoke(i,a,o,s,c)}finally{e.shouldCoalesceRunChangeDetection&&!e.callbackScheduled&&!tc(s)&&t(),Qs(e)}},onHasTask:(t,n,r,i)=>{t.hasTask(r,i),n===r&&(i.change==`microTask`?(e._hasPendingMicrotasks=i.microTask,Xs(e),qs(e)):i.change==`macroTask`&&(e.hasPendingMacrotasks=i.macroTask))},onHandleError:(t,n,r,i)=>(t.handleError(r,i),e.runOutsideAngular(()=>e.onError.emit(i)),!1)})}function Xs(e){e.hasPendingMicrotasks=!!(e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&e.callbackScheduled===!0)}function Zs(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function Qs(e){e._nesting--,qs(e)}var $s=class{hasPendingMicrotasks=!1;hasPendingMacrotasks=!1;isStable=!0;onUnstable=new Rs;onMicrotaskEmpty=new Rs;onStable=new Rs;onError=new Rs;run(e,t,n){return e.apply(t,n)}runGuarded(e,t,n){return e.apply(t,n)}runOutsideAngular(e){return e()}runTask(e,t,n,r){return e.apply(t,n)}};function ec(e){return nc(e,`__ignore_ng_zone__`)}function tc(e){return nc(e,`__scheduler_tick__`)}function nc(e,t){return!Array.isArray(e)||e.length!==1?!1:e[0]?.data?.[t]===!0}var rc=class{_console=console;handleError(e){this._console.error(`ERROR`,e)}},ic=new Ii(``,{factory:()=>{let e=C(Gs),t=C(Xa),n;return r=>{e.runOutsideAngular(()=>{t.destroyed&&!n?setTimeout(()=>{throw r}):(n??=t.get(rc),n.handleError(r))})}}}),ac={provide:Aa,useValue:()=>{C(rc,{optional:!0})},multi:!0};function D(e,t){let[n,r,i]=Fn(e,t?.equal),a=n;return a[nn],a.set=r,a.update=i,a.asReadonly=oc.bind(a),a}function oc(){let e=this[nn];if(e.readonlyFn===void 0){let t=()=>this();t[nn]=e,e.readonlyFn=t}return e.readonlyFn}var sc=new Ii(``,{factory:()=>cc}),cc=`ng`,lc=new Ii(``),uc=new Ii(``,{providedIn:`platform`,factory:()=>`unknown`}),dc=new Ii(``,{factory:()=>C(Ms).body?.querySelector(`[ngCspNonce]`)?.getAttribute(`ngCspNonce`)||null}),fc=(()=>{class e{view;node;constructor(e,t){this.view=e,this.node=t}static __NG_ELEMENT_ID__=pc}return e})();function pc(){return new fc(qo(),Yo())}var mc=class{},hc=new Ii(``,{factory:()=>!0}),gc=new Ii(``),_c=(()=>{class e{static ɵprov=ki({token:e,providedIn:`root`,factory:()=>new vc})}return e})(),vc=class{dirtyEffectCount=0;queues=new Map;add(e){this.enqueue(e),this.schedule(e)}schedule(e){e.dirty&&this.dirtyEffectCount++}remove(e){let t=e.zone,n=this.queues.get(t);n.has(e)&&(n.delete(e),e.dirty&&this.dirtyEffectCount--)}enqueue(e){let t=e.zone;this.queues.has(t)||this.queues.set(t,new Set);let n=this.queues.get(t);n.has(e)||n.add(e)}flush(){for(;this.dirtyEffectCount>0;){let e=!1;for(let[t,n]of this.queues)e||=t===null?this.flushQueue(n):t.run(()=>this.flushQueue(n));e||(this.dirtyEffectCount=0)}}flushQueue(e){let t=!1;for(let n of e)n.dirty&&(this.dirtyEffectCount--,t=!0,n.run());return t}},yc=class{[nn];constructor(e){this[nn]=e}destroy(){this[nn].destroy()}};function bc(e,t){let n=t?.injector??C(js),r=t?.manualCleanup===!0?null:n.get(Ns),i,a=n.get(fc,null,{optional:!0}),o=n.get(mc);return a===null?i=Tc(e,n.get(_c),o):(i=wc(a.view,o,e),r instanceof Ps&&r._lView===a.view&&(r=null)),i.injector=n,r!==null&&(i.onDestroyFns=[r.onDestroy(()=>i.destroy())]),new yc(i)}var xc={...Vn,cleanupFns:void 0,zone:null,onDestroyFns:null,run(){let e=ns(!1);try{Hn(this)}finally{ns(e)}},cleanup(){if(!this.cleanupFns?.length)return;let e=rn(null);try{for(;this.cleanupFns.length;)this.cleanupFns.pop()()}finally{this.cleanupFns=[],rn(e)}}},Sc={...xc,consumerMarkedDirty(){this.scheduler.schedule(this),this.notifier.notify(12)},destroy(){if(yn(this),this.onDestroyFns!==null)for(let e of this.onDestroyFns)e();this.cleanup(),this.scheduler.remove(this)}},Cc={...xc,consumerMarkedDirty(){this.view[2]|=8192,Fo(this.view),this.notifier.notify(13)},destroy(){if(yn(this),this.onDestroyFns!==null)for(let e of this.onDestroyFns)e();this.cleanup(),this.view[23]?.delete(this)}};function wc(e,t,n){let r=Object.create(Cc);return r.view=e,r.zone=typeof Zone<`u`?Zone.current:null,r.notifier=t,r.fn=Ec(r,n),e[23]??=new Set,e[23].add(r),r.consumerMarkedDirty(r),r}function Tc(e,t,n){let r=Object.create(Sc);return r.fn=Ec(r,e),r.scheduler=t,r.notifier=n,r.zone=typeof Zone<`u`?Zone.current:null,r.scheduler.add(r),r.notifier.notify(12),r}function Ec(e,t){return()=>{t(t=>(e.cleanupFns??=[]).push(t))}}function Dc(e){return typeof e==`function`&&e[nn]!==void 0}function Oc(e){return Dc(e)&&typeof e.set==`function`}var kc=Symbol(`InputSignalNode#UNSET`),Ac={...zn,transformFn:void 0,applyValueToInputSignal(e,t){Ln(e,t)}};function jc(e){return{toString:e}.toString()}var Mc=(function(e){return e[e.TemplateCreateStart=0]=`TemplateCreateStart`,e[e.TemplateCreateEnd=1]=`TemplateCreateEnd`,e[e.TemplateUpdateStart=2]=`TemplateUpdateStart`,e[e.TemplateUpdateEnd=3]=`TemplateUpdateEnd`,e[e.LifecycleHookStart=4]=`LifecycleHookStart`,e[e.LifecycleHookEnd=5]=`LifecycleHookEnd`,e[e.OutputStart=6]=`OutputStart`,e[e.OutputEnd=7]=`OutputEnd`,e[e.BootstrapApplicationStart=8]=`BootstrapApplicationStart`,e[e.BootstrapApplicationEnd=9]=`BootstrapApplicationEnd`,e[e.BootstrapComponentStart=10]=`BootstrapComponentStart`,e[e.BootstrapComponentEnd=11]=`BootstrapComponentEnd`,e[e.ChangeDetectionStart=12]=`ChangeDetectionStart`,e[e.ChangeDetectionEnd=13]=`ChangeDetectionEnd`,e[e.ChangeDetectionSyncStart=14]=`ChangeDetectionSyncStart`,e[e.ChangeDetectionSyncEnd=15]=`ChangeDetectionSyncEnd`,e[e.AfterRenderHooksStart=16]=`AfterRenderHooksStart`,e[e.AfterRenderHooksEnd=17]=`AfterRenderHooksEnd`,e[e.ComponentStart=18]=`ComponentStart`,e[e.ComponentEnd=19]=`ComponentEnd`,e[e.DeferBlockStateStart=20]=`DeferBlockStateStart`,e[e.DeferBlockStateEnd=21]=`DeferBlockStateEnd`,e[e.DynamicComponentStart=22]=`DynamicComponentStart`,e[e.DynamicComponentEnd=23]=`DynamicComponentEnd`,e[e.HostBindingsUpdateStart=24]=`HostBindingsUpdateStart`,e[e.HostBindingsUpdateEnd=25]=`HostBindingsUpdateEnd`,e})(Mc||{}),Nc=class{previousValue;currentValue;firstChange;constructor(e,t,n){this.previousValue=e,this.currentValue=t,this.firstChange=n}isFirstChange(){return this.firstChange}};function Pc(e,t,n,r){t===null?e[n]=r:t.applyValueToInputSignal(t,r)}var Fc=null,Ic=(()=>{Fc=Rc;let e=()=>Rc;return e.ngInherit=!0,e})();function Lc(){return Fc}function Rc(e){return e.type.prototype.ngOnChanges&&(e.setInput=Bc),zc}function zc(){let e=Hc(this),t=e?.current;if(t){let n=e.previous;if(n===Oa)e.previous=t;else for(let e in t)n[e]=t[e];e.current=null,this.ngOnChanges(t)}}function Bc(e,t,n,r,i){let a=this.declaredInputs[r],o=Hc(e)||Uc(e,{previous:Oa,current:null}),s=o.current||={},c=o.previous,l=c[a];s[a]=new Nc(l&&l.currentValue,n,c===Oa),Pc(e,t,i,n)}var Vc=`__ngSimpleChanges__`;function Hc(e){return Object.hasOwn(e,Vc)&&e[Vc]||null}function Uc(e,t){return e[Vc]=t}var Wc=[],Gc=function(e,t=null,n){for(let r=0;r=r)break}else t[c]<0&&(e[17]+=65536),(s>14>16&&(e[2]&3)===t&&(e[2]+=16384,Qc(o,a)):Qc(o,a)}var el=-1,tl=class{factory;name;injectImpl;resolving=!1;canSeeViewProviders;multi;componentProviders;index;providerFactory;constructor(e,t,n,r){this.factory=e,this.name=r,this.canSeeViewProviders=t,this.injectImpl=n}};function nl(e){return!!(e.flags&8)}function rl(e){return!!(e.flags&16)}function il(e,t,n){let r=0;for(;rt){o=a-1;break}}}for(;a>16}function fl(e,t){let n=dl(e),r=t;for(;n>0;)r=r[14],n--;return r}var pl=!0;function ml(e){let t=pl;return pl=e,t}var hl=255,gl=5,_l=0,vl={};function yl(e,t,n){let r;typeof n==`string`?r=n.charCodeAt(0)||0:Object.hasOwn(n,Hi)&&(r=n[Hi]),r??=n[Hi]=_l++;let i=r&hl,a=1<>gl)]|=a}function bl(e,t){let n=Sl(e,t);if(n!==-1)return n;let r=t[1];r.firstCreatePass&&(e.injectorIndex=t.length,xl(r.data,e),xl(t,null),xl(r.blueprint,null));let i=Cl(e,t),a=e.injectorIndex;if(ll(i)){let e=ul(i),n=fl(i,t),r=n[1].data;for(let i=0;i<8;i++)t[a+i]=n[e+i]|r[e+i]}return t[a+8]=i,a}function xl(e,t){e.push(0,0,0,0,0,0,0,0,t)}function Sl(e,t){return e.injectorIndex===-1||e.parent&&e.parent.injectorIndex===e.injectorIndex||t[e.injectorIndex+8]===null?-1:e.injectorIndex}function Cl(e,t){if(e.parent&&e.parent.injectorIndex!==-1)return e.parent.injectorIndex;let n=0,r=null,i=t;for(;i!==null;){if(r=Bl(i),r===null)return el;if(n++,i=i[14],r.injectorIndex!==-1)return r.injectorIndex|n<<16}return el}function wl(e,t,n){yl(e,t,n)}function Tl(e,t,n){if(n&8||e!==void 0)return e;$i(t,`NodeInjector`)}function El(e,t,n,r){if(n&8&&r===void 0&&(r=null),!(n&3)){let i=e[9],a=ia(void 0);try{return i?i.get(t,r,n&8):aa(t,r,n&8)}finally{ia(a)}}return Tl(r,t,n)}function Dl(e,t,n,r=0,i){if(e!==null){if(t[2]&2048&&!(r&2)){let i=zl(e,t,n,r,vl);if(i!==vl)return i}let i=Ol(e,t,n,r,vl);if(i!==vl)return i}return El(t,n,r,i)}function Ol(e,t,n,r,i){let a=Ml(n);if(typeof a==`function`){if(!fs(t,e,r))return r&1?Tl(i,n,r):El(t,n,r,i);try{let e;if(e=a(r),e==null&&!(r&8))$i(n);else return e}finally{_s()}}else if(typeof a==`number`){let i=null,o=Sl(e,t),s=el,c=r&1?t[15][5]:null;for((o===-1||r&4)&&(s=o===-1?Cl(e,t):t[o+8],s===el||!Pl(r,!1)?o=-1:(i=t[1],o=ul(s),t=fl(s,t)));o!==-1;){let e=t[1];if(Nl(a,o,e.data)){let e=kl(o,t,n,i,r,c);if(e!==vl)return e}s=t[o+8],s!==el&&Pl(r,t[1].data[o+8]===c)&&Nl(a,o,t)?(i=e,o=ul(s),t=fl(s,t)):o=-1}}return i}function kl(e,t,n,r,i,a){let o=t[1],s=o.data[e+8],c=Al(s,o,n,r==null?ho(s)&&pl:r!=o&&!!(s.type&3),i&1&&a===s);return c===null?vl:jl(t,o,c,s,i)}function Al(e,t,n,r,i){let a=e.providerIndexes,o=t.data,s=a&1048575,c=e.directiveStart,l=e.directiveEnd,u=a>>20,d=r?s:s+u,f=i?s+u:l;for(let e=d;e=c&&t.type===n)return e}if(i){let e=o[c];if(e&&_o(e)&&e.type===n)return c}return null}function jl(e,t,n,r,i){let a=e[n],o=t.data;if(a instanceof tl){let s=a;if(s.resolving)throw Qi(``);let c=ml(s.canSeeViewProviders);s.resolving=!0,o[n].type||o[n];let l=s.injectImpl?ia(s.injectImpl):null;fs(e,r,0);try{a=e[n]=s.factory(void 0,i,o,e,r),t.firstCreatePass&&n>=r.directiveStart&&Kc(n,o[n],t)}finally{l!==null&&ia(l),ml(c),s.resolving=!1,_s()}}return a}function Ml(e){if(typeof e==`string`)return e.charCodeAt(0)||0;let t=Object.hasOwn(e,Hi)?e[Hi]:void 0;return typeof t==`number`?t>=0?t&hl:Il:t}function Nl(e,t,n){let r=1<>gl)]&r)}function Pl(e,t){return!(e&2)&&!(e&1&&t)}var Fl=class{_tNode;_lView;constructor(e,t){this._tNode=e,this._lView=t}get(e,t,n){return Dl(this._tNode,this._lView,e,fa(n),t)}};function Il(){return new Fl(Yo(),qo())}function Ll(e){return jc(()=>{let t=e.prototype.constructor,n=t[Vi]||Rl(t),r=Object.prototype,i=Object.getPrototypeOf(e.prototype).constructor;for(;i&&i!==r;){let e=i[Vi]||Rl(i);if(e&&e!==n)return e;i=Object.getPrototypeOf(i)}return e=>new e})}function Rl(e){return Oi(e)?()=>{let t=Rl(Di(e));return t&&t()}:ga(e)}function zl(e,t,n,r,i){let a=e,o=t;for(;a!==null&&o!==null&&o[2]&2048&&!vo(o);){let e=Ol(a,o,n,r|2,vl);if(e!==vl)return e;r&=-5;let t=a.parent;if(!t){let e=o[20];if(e){let t=e.get(n,vl,r);if(t!==vl)return t}t=Bl(o),o=o[14]}a=t}return i}function Bl(e){let t=e[1],n=t.type;return n===2?t.declTNode:n===1?e[5]:null}function Vl(e){return{token:e.token,providedIn:e.autoProvided===!1?null:`root`,factory:e.factory,value:void 0}}function Hl(){return Ul(Yo(),qo())}function Ul(e,t){return new Wl(wo(e,t))}var Wl=(()=>{class e{nativeElement;constructor(e){this.nativeElement=e}static __NG_ELEMENT_ID__=Hl}return e})();function Gl(e){return e instanceof Wl?e.nativeElement:e}function Kl(){return this._results[Symbol.iterator]()}var ql=class{_emitDistinctChangesOnly;dirty=!0;_onDirty=void 0;_results=[];_changesDetected=!1;_changes=void 0;length=0;first=void 0;last=void 0;get changes(){return this._changes??=new Yr}constructor(e=!1){this._emitDistinctChangesOnly=e}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){this.dirty=!1;let n=va(e);(this._changesDetected=!_a(this._results,n,t))&&(this._results=n,this.length=n.length,this.last=n[this.length-1],this.first=n[0])}notifyOnChanges(){this._changes!==void 0&&(this._changesDetected||!this._emitDistinctChangesOnly)&&this._changes.next(this)}onDirty(e){this._onDirty=e}setDirty(){this.dirty=!0,this._onDirty?.()}destroy(){this._changes!==void 0&&(this._changes.complete(),this._changes.unsubscribe())}[Symbol.iterator]=Kl};function Jl(e){return(e.flags&128)==128}var Yl=(function(e){return e[e.OnPush=0]=`OnPush`,e[e.Eager=1]=`Eager`,e[e.Default=1]=`Default`,e})(Yl||{}),Xl=new Map,Zl=0;function Ql(){return Zl++}function $l(e){Xl.set(e[19],e)}function eu(e){Xl.delete(e[19])}var tu=`__ngContext__`;function nu(e,t){fo(t)?(e[tu]=t[19],$l(t)):e[tu]=t}function ru(e){return au(e[12])}function iu(e){return au(e[4])}function au(e){for(;e!==null&&!po(e);)e=e[4];return e}var ou=void 0;function su(e){ou=e}function cu(){if(ou!==void 0)return ou;if(typeof document<`u`)return document;throw new vi(210,!1)}var lu=!1,uu=new Ii(``,{factory:()=>lu}),du=new WeakMap;function fu(e,t){if(typeof e!=`object`||!e)return;let n=du.get(e);n||(n=new WeakSet,du.set(e,n)),n.add(t)}function pu(e){return(e.flags&32)==32}var mu=()=>null;function hu(e,t,n=!1){return mu(e,t,n)}function gu(e,t){let n=e.contentQueries;if(n!==null){let r=rn(null);try{for(let r=0;r|^->||--!>|)/g,Jee=`​$1​`;function Yee(e){return e.replace(Kee,e=>e.replace(qee,Jee))}function Xee(e,t){return e.createText(t)}function Zee(e,t,n){e.setValue(t,n)}function Qee(e,t){return e.createComment(Yee(t))}function wu(e,t,n){return e.createElement(t,n)}function Tu(e,t,n,r,i){e.insertBefore(t,n,r,i)}function Eu(e,t,n){e.appendChild(t,n)}function Du(e,t,n,r,i){r===null?Eu(e,t,n):Tu(e,t,n,r,i)}function Ou(e,t,n,r){e.removeChild(null,t,n,r)}function $ee(e,t,n){e.setAttribute(t,`style`,n)}function ete(e,t,n){n===``?e.removeAttribute(t,`class`):e.setAttribute(t,`class`,n)}function ku(e,t,n){let{mergedAttrs:r,classes:i,styles:a}=n;r!==null&&il(e,t,r),i!==null&&ete(e,t,i),a!==null&&$ee(e,t,a)}function Au(e){let t=tte();return t?t.sanitize(bo.URL,e)||``:Su(e,`URL`)?xu(e):Gee(Ji(e))}function tte(){let e=qo();return e&&e[10].sanitizer}function ju(e){return e.ownerDocument.defaultView}function Mu(e){return e.ownerDocument}function nte(e,t,n){let r=e.length;for(;;){let i=e.indexOf(t,n);if(i===-1)return i;if(i===0||e.charCodeAt(i-1)<=32){let n=t.length;if(i+n===r||e.charCodeAt(i+n)<=32)return i}n=i+1}}var Nu=`ng-template`;function rte(e,t,n,r){let i=0;if(r){for(;i-1){let e;for(;++ia?``:i[u+1].toLowerCase(),r&2&&l!==e){if(Fu(r))return!1;o=!0}}}}}return Fu(r)||o}function Fu(e){return!(e&1)}function ote(e,t,n,r){if(t===null)return-1;let i=0;if(r||!n){let n=!1;for(;i-1)for(n++;n0?`="`+t+`"`:``)+`]`}else r&8?i+=`.`+o:r&4&&(i+=` `+o)}else i!==``&&!Fu(o)&&(t+=Lu(a,i),i=``),r=o,a||=!Fu(r);n++}return i!==``&&(t+=Lu(a,i)),t}function fte(e){return e.map(dte).join(`,`)}function pte(e){let t=[],n=[],r=1,i=2;for(;r!1});function Vu(e){if(!e)return 0;let t=e.toLowerCase().indexOf(`ms`)>-1?1:1e3;return parseFloat(e)*t}function Hu(e,t){return e.getPropertyValue(t).split(`,`).map(e=>e.trim())}function gte(e){let t=Hu(e,`transition-property`),n=Hu(e,`transition-duration`),r=Hu(e,`transition-delay`),i={propertyName:``,duration:0,animationName:void 0};for(let e=0;ei.duration&&(i.propertyName=t[e],i.duration=a)}return i}function _te(e){let t=Hu(e,`animation-name`),n=Hu(e,`animation-delay`),r=Hu(e,`animation-duration`),i=Hu(e,`animation-iteration-count`),a={animationName:``,propertyName:void 0,duration:0};for(let e=0;ea.duration&&s!==`infinite`&&(a.animationName=t[e],a.duration=o)}return a}function Uu(e,t){return e!==void 0&&e.duration>t.duration}function Wu(e){return(e.animationName!=null||e.propertyName!=null)&&e.duration>0}function Gu(e){let t=e.effect?.getTiming();if(t===void 0)return;let n=typeof t.duration==`number`?t.duration:0,r=(t.delay??0)+n,i=e.playbackRate;return i!==void 0&&i!==0&&i!==1&&(r/=Math.abs(i)),r}function vte(e,t){let n=getComputedStyle(e),r=_te(n),i=gte(n),a=r.duration>i.duration?r:i;Uu(t.get(e),a)||Wu(a)&&t.set(e,a)}function yte(e,t,n){if(!n)return;let r=e.getAnimations();return r.length===0?vte(e,t):bte(e,t,r)}function bte(e,t,n){let r={animationName:void 0,propertyName:void 0,duration:0};for(let e of n){if(e.effect?.getTiming()?.iterations===1/0)continue;let t=Gu(e)??0,n,i;e.animationName?i=e.animationName:n=e.transitionProperty,t>=r.duration&&(r={animationName:i,propertyName:n,duration:t})}Uu(t.get(e),r)||Wu(r)&&t.set(e,r)}var Ku=new Set,xte=!1,Ste=1,qu=typeof document<`u`&&typeof document?.documentElement?.getAnimations==`function`;function Cte(e){return e[9].get(hte,xte)}function wte(e,t,n){let r=Yu.get(e);if(r){for(let e of t)r.classList.push(e);for(let e of n)r.cleanupFns.push(e)}else Yu.set(e,{classList:t,cleanupFns:n})}function Ju(e){let t=Yu.get(e);if(t){for(let e of t.cleanupFns)e();Yu.delete(e)}Xu.delete(e)}var Yu=new WeakMap,Xu=new WeakMap,Zu=new WeakMap;function Qu(e){return e?e[14]??e:null}var $u=new WeakSet;function Tte(e,t,n){let r=Zu.get(e);if(!r||r.length===0)return;let i=t.parentNode,a=t.previousSibling,o=Qu(n);for(let e=r.length-1;e>=0;e--){let{el:n,declarationView:s}=r[e],c=n.parentNode;n===t?(r.splice(e,1),$u.add(n),n.dispatchEvent(new CustomEvent(`animationend`,{detail:{cancel:!0}}))):(a&&n===a||c&&i&&c!==i&&(o===null||s===null||o===s))&&(r.splice(e,1),n.dispatchEvent(new CustomEvent(`animationend`,{detail:{cancel:!0}})),n.parentNode?.removeChild(n))}}function Ete(e,t,n){let r=Qu(n),i=Zu.get(e);i?i.some(e=>e.el===t)||i.push({el:t,declarationView:r}):Zu.set(e,[{el:t,declarationView:r}])}function ed(e){let t=e[26]??={};return t.enter??=new Map}function Dte(e){let t=typeof e==`function`?e():e,n=Array.isArray(t)?t:null;return typeof t==`string`&&(n=t.trim().split(/\s+/).filter(e=>e)),n}function td(e){return e.composedPath?e.composedPath()[0]:e.target}function nd(e,t){let n=Xu.get(t);if(n===void 0)return!0;if(t!==td(e))return!1;let r=e.animation;if(r){let e=Gu(r);if(e!==void 0&&e+Ste{class e{impl=null;execute(){this.impl?.execute()}static ɵprov=ki({token:e,providedIn:`root`,factory:()=>new e})}return e})(),cd=[0,1,2,3],ld=(()=>{class e{ngZone=C(Gs);scheduler=C(mc);errorHandler=C(rc,{optional:!0});sequences=new Set;deferredRegistrations=new Set;executing=!1;constructor(){C(id,{optional:!0})}execute(){let e=this.sequences.size>0;e&&Gc(Mc.AfterRenderHooksStart),this.executing=!0;for(let e of cd)for(let t of this.sequences)if(!t.erroredOrDestroyed&&t.hooks[e])try{t.pipelinedValue=this.ngZone.runOutsideAngular(()=>this.maybeTrace(()=>{let n=t.hooks[e];return n(t.pipelinedValue)},t.snapshot))}catch(e){t.erroredOrDestroyed=!0,this.errorHandler?.handleError(e)}this.executing=!1;for(let e of this.sequences)e.afterRun(),e.once&&(this.sequences.delete(e),e.destroy());for(let e of this.deferredRegistrations)this.sequences.add(e);this.deferredRegistrations.size>0&&this.scheduler.notify(7),this.deferredRegistrations.clear(),e&&Gc(Mc.AfterRenderHooksEnd)}register(e){let{view:t}=e;t===void 0?this.executing?this.deferredRegistrations.add(e):this.addSequence(e):((t[25]??=[]).push(e),Fo(t),t[2]|=8192)}addSequence(e){this.sequences.add(e),this.scheduler.notify(7)}unregister(e){this.executing&&this.sequences.has(e)?(e.erroredOrDestroyed=!0,e.pipelinedValue=void 0,e.once=!0):(this.sequences.delete(e),this.deferredRegistrations.delete(e))}maybeTrace(e,t){return t?t.run(rd.AFTER_NEXT_RENDER,e):e()}static ɵprov=ki({token:e,providedIn:`root`,factory:()=>new e})}return e})(),ud=class{impl;hooks;view;once;snapshot;erroredOrDestroyed=!1;pipelinedValue=void 0;unregisterOnDestroy;constructor(e,t,n,r,i,a=null){this.impl=e,this.hooks=t,this.view=n,this.once=r,this.snapshot=a,this.unregisterOnDestroy=i?.onDestroy(()=>this.destroy())}afterRun(){this.erroredOrDestroyed=!1,this.pipelinedValue=void 0,this.snapshot?.dispose(),this.snapshot=null}destroy(){this.impl.unregister(this),this.unregisterOnDestroy?.();let e=this.view?.[25];e&&(this.view[25]=e.filter(e=>e!==this))}};function dd(e,t){let n=t?.injector??C(js);return od(`NgAfterNextRender`),Ate(e,n,t,!0)}function kte(e){return e instanceof Function?[void 0,void 0,e,void 0]:[e.earlyRead,e.write,e.mixedReadWrite,e.read]}function Ate(e,t,n,r){let i=t.get(sd);i.impl??=t.get(ld);let a=t.get(id,null,{optional:!0}),o=n?.manualCleanup===!0?null:t.get(Ns),s=t.get(fc,null,{optional:!0}),c=new ud(i.impl,kte(e),s?.view,r,o,a?.snapshot(null));return i.impl.register(c),c}var fd=new Ii(``,{factory:()=>{let e=C(Xa),t=new Set;return e.onDestroy(()=>t.clear()),{queue:t,isScheduled:!1,scheduler:null,injector:e}}});function pd(e,t,n){let r=e.get(fd);if(Array.isArray(t))for(let e of t)r.queue.add(e),n?.detachedLeaveAnimationFns?.push(e);else r.queue.add(t),n?.detachedLeaveAnimationFns?.push(t);r.scheduler&&r.scheduler(e)}function jte(e,t){let n=e.get(fd);if(Array.isArray(t))for(let e of t)n.queue.delete(e);else n.queue.delete(t)}function Mte(e,t){let n=e.get(fd);if(t.detachedLeaveAnimationFns){for(let e of t.detachedLeaveAnimationFns)n.queue.delete(e);t.detachedLeaveAnimationFns=void 0}}function Nte(e){let t=e.get(fd);t.isScheduled||=(dd(()=>{t.isScheduled=!1;for(let e of t.queue)e();t.queue.clear()},{injector:t.injector}),!0)}function md(e){let t=e.get(fd);t.scheduler=Nte,t.scheduler(e)}function hd(e,t){for(let[n,r]of t)pd(e,r.animateFns)}function gd(e,t,n,r){let i=e?.[26]?.enter;t!==null&&i&&i.has(n.index)&&hd(r,i)}function _d(e,t,n,r){try{n.get(ja)}catch{return r(!1)}let i=e?.[26];i?.enter?.has(t.index)&&jte(n,i.enter.get(t.index).animateFns);let a=vd(e,t,i);if(a.size===0){let n=!1;if(e){let r=[];bd(e,t,r),n=r.length>0}if(!n)return r(!1)}e&&Ku.add(e[19]),pd(n,()=>yd(e,t,i||void 0,a,r),i||void 0)}function vd(e,t,n){let r=new Map,i=n?.leave;if(i&&i.has(t.index)&&r.set(t.index,i.get(t.index)),e&&i)for(let[n,a]of i){if(r.has(n))continue;let i=e[1].data[n].parent;for(;i;){if(i===t){r.set(n,a);break}i=i.parent}}return r}function yd(e,t,n,r,i){let a=[];if(n&&n.leave)for(let[e]of r){if(!n.leave.has(e))continue;let t=n.leave.get(e);for(let e of t.animateFns){let{promise:t}=e();a.push(t)}n.detachedLeaveAnimationFns=void 0}if(e&&bd(e,t,a),a.length>0){let t=n||e?.[26];if(t){let n=t.running;n&&a.push(n),t.running=Promise.allSettled(a),Sd(e,t.running,i)}else Promise.allSettled(a).then(()=>{e&&Ku.delete(e[19]),i(!0)})}else e&&Ku.delete(e[19]),i(!1)}function bd(e,t,n){if(t.type&12){let r=e[t.index];if(po(r))for(let e=10;e{e[26]?.running===t&&(e[26].running=void 0,Ku.delete(e[19])),n(!0)})}function Cd(e,t,n,r,i,a,o,s){if(i!=null){let c,l=!1;po(i)?c=i:fo(i)&&(l=!0,i=i[0]);let u=So(i);e===0&&r!==null?(gd(s,r,a,n),o==null?Eu(t,r,u):Tu(t,r,u,o||null,!0)):e===1&&r!==null?(gd(s,r,a,n),Tu(t,r,u,o||null,!0),Tte(a,u,s)):e===2?(s?.[26]?.leave?.has(a.index)&&Ete(a,u,s),$u.delete(u),_d(s,a,n,e=>{if($u.has(u)){$u.delete(u);return}Ou(t,u,l,e)})):e===3&&($u.delete(u),_d(s,a,n,()=>{t.destroyNode(u)})),c!=null&&qd(t,e,n,c,a,r,o)}}function wd(e,t){Ed(e,t),t[0]=null,t[5]=null}function Td(e,t,n,r,i,a){r[0]=i,r[5]=t,Ud(e,r,n,1,i,a)}function Ed(e,t){t[10].changeDetectionScheduler?.notify(9),Ud(e,t,t[11],2,null,null)}function Dd(e){let t=e[12];if(!t)return Ad(e[1],e);for(;t;){let n=null;if(fo(t))n=t[12];else{let e=t[10];e&&(n=e)}if(!n){for(;t&&!t[4]&&t!==e;)fo(t)&&Ad(t[1],t),t=t[3];t===null&&(t=e),fo(t)&&Ad(t[1],t),n=t&&t[4]}t=n}}function Od(e,t){let n=e[9],r=n.indexOf(t);n.splice(r,1)}function kd(e,t){if(yo(t))return;let n=t[11];n.destroyNode&&Ud(e,t,n,3,null,null),Dd(t)}function Ad(e,t){if(yo(t))return;let n=rn(null);try{t[2]&=-129,t[2]|=256,t[24]&&yn(t[24]),Md(e,t),jd(e,t),t[1].type===1&&t[11].destroy();let n=t[16];if(n!==null&&po(t[3])){n!==t[3]&&Od(n,t);let r=t[18];r!==null&&r.detachView(e)}eu(t)}finally{rn(n)}}function jd(e,t){let n=e.cleanup,r=t[7];if(n!==null)for(let e=0;e=0?r[t]():r[-t].unsubscribe(),e+=2}else{let t=r[n[e+1]];n[e].call(t)}r!==null&&(t[7]=null);let i=t[21];if(i!==null){t[21]=null;for(let e=0;e27&&rf(e,t,27,!1),Gc(o?Mc.TemplateUpdateStart:Mc.TemplateCreateStart,i,n),n(r,i)}finally{xs(a),Gc(o?Mc.TemplateUpdateEnd:Mc.TemplateCreateEnd,i,n)}}function cf(e,t,n){hf(e,t,n),(n.flags&64)==64&&gf(e,t,n)}function lf(e,t,n=wo){let r=t.localNames;if(r!==null){let i=t.index+1;for(let a=0;a=s&&i<=c){let o=t.data[i],s=r[e+1];of(o,n[i],s,a),l=!0}else if(i>c)break}}return o!==null&&Object.hasOwn(r.inputs,i)&&(of(r,n[o],i,a),l=!0),l}function Df(e,t){let n=Oo(t,e),r=n[1];Of(r,n);let i=n[0];i!==null&&n[6]===null&&(n[6]=hu(i,n[9])),Gc(Mc.ComponentStart);try{kf(r,n,n[8])}finally{Gc(Mc.ComponentEnd,n[8])}}function Of(e,t){for(let n=t.length;n{Fo(e.lView)},consumerOnSignalRead(){this.lView[24]=this}};function Vf(e){let t=e[24]??Object.create(Hf);return t.lView=e,t}var Hf={...on,consumerIsAlwaysLive:!0,kind:`template`,consumerMarkedDirty:e=>{let t=Lo(e.lView);for(;t&&!Uf(t[1]);)t=Lo(t);t&&Mo(t)},consumerOnSignalRead(){this.lView[24]=this}};function Uf(e){return e.type!==2}function Wf(e){if(e[23]===null)return;let t=!0;for(;t;){let n=!1;for(let t of e[23])if(t.dirty&&(n=!0,t.zone===null||Zone.current===t.zone?t.run():t.zone.run(()=>t.run()),e[23]===null))return;t=n&&!!(e[2]&8192)}}var Gf=100;function Kf(e,t=0){let n=e[10].rendererFactory;n.begin?.();try{qf(e,t)}finally{n.end?.()}}function qf(e,t){let n=ts();try{ns(!0),$f(e,t);let n=0;for(;No(e);){if(n===Gf)throw new vi(103,!1);n++,$f(e,1)}}finally{ns(n)}}function Jf(e,t,n,r){if(yo(t))return;let i=t[2];ps(t);let a=!0,o=null,s=null;Uf(e)?(s=Lf(t),o=mn(s)):an()===null?(a=!1,s=Vf(t),o=mn(s)):t[24]&&=(yn(t[24]),null);try{jo(t),Bee(e.bindingStartIndex),n!==null&&sf(e,t,n,2,r);let a=(i&3)==3;if(a){let n=e.preOrderCheckHooks;n!==null&&Jc(t,n,null)}else{let n=e.preOrderHooks;n!==null&&Yc(t,n,0,null),Xc(t,0)}if(Xf(t),Wf(t),Yf(t,0),e.contentQueries!==null&&gu(e,t),a){let n=e.contentCheckHooks;n!==null&&Jc(t,n)}else{let n=e.contentHooks;n!==null&&Yc(t,n,1),Xc(t,1)}tp(e,t);let o=e.components;o!==null&&ep(t,o,0);let s=e.viewQuery;if(s!==null&&_u(2,s,r),a){let n=e.viewCheckHooks;n!==null&&Jc(t,n)}else{let n=e.viewHooks;n!==null&&Yc(t,n,2),Xc(t,2)}if(e.firstUpdatePass===!0&&(e.firstUpdatePass=!1),t[22]){for(let e of t[22])e();t[22]=null}Ff(t),t[2]&=-73}catch(e){throw Fo(t),e}finally{s!==null&&(gn(s,o),a&&zf(s)),vs()}}function Yf(e,t){for(let n=ru(e);n!==null;n=iu(n))for(let e=10;e0&&(e[n-1][4]=r[4]);let a=xa(e,10+t);wd(r[1],r);let o=a[18];o!==null&&o.detachView(a[1]),r[3]=null,r[4]=null,r[2]&=-129}return r}function cp(e,t,n,r){let i=10+r,a=n.length;r>0&&(n[i-1][4]=t),r-1&&(sp(e,n),xa(t,n))}this._attachedToViewContainer=!1}kd(this._lView[1],this._lView)}onDestroy(e){Io(this._lView,e)}markForCheck(){np(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[2]&=-129}reattach(){Po(this._lView),this._lView[2]|=128}detectChanges(){this._lView[2]|=1024,Kf(this._lView)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new vi(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;let e=vo(this._lView),t=this._lView[16];t!==null&&!e&&Od(t,this._lView),Ed(this._lView[1],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new vi(902,!1);this._appRef=e;let t=vo(this._lView),n=this._lView[16];n!==null&&!t&&lp(n,this._lView),Po(this._lView)}},dp=(()=>{class e{_declarationLView;_declarationTContainer;elementRef;static __NG_ELEMENT_ID__=fp;constructor(e,t,n){this._declarationLView=e,this._declarationTContainer=t,this.elementRef=n}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(e,t){return this.createEmbeddedViewImpl(e,t)}createEmbeddedViewImpl(e,t,n){return new up(jf(this._declarationLView,this._declarationTContainer,e,{embeddedViewInjector:t,dehydratedView:n}))}}return e})();function fp(){return pp(Yo(),qo())}function pp(e,t){return e.type&4?new dp(t,e,Ul(e,t)):null}function mp(e,t,n,r,i){let a=e.data[t];if(a===null)a=hp(e,t,n,r,i),Vee()&&(a.flags|=32);else if(a.type&64){a.type=n,a.value=r,a.attrs=i;let e=zee();a.injectorIndex=e===null?-1:e.injectorIndex}return Zo(a,!0),a}function hp(e,t,n,r,i){let a=Xo(),o=Qo(),s=o?a:a&&a.parent,c=e.data[t]=_p(e,s,n,t,r,i);return gp(e,c,a,o),c}function gp(e,t,n,r){e.firstChild===null&&(e.firstChild=t),n!==null&&(r?n.child==null&&t.parent!==null&&(n.child=t):n.next===null&&(n.next=t,t.prev=n))}function _p(e,t,n,r,i,a){let o=t?t.injectorIndex:-1,s=0;return Wo()&&(s|=128),{type:n,index:r,insertBeforeIndex:null,injectorIndex:o,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,controlDirectiveIndex:-1,customControlIndex:-1,propertyBindings:null,flags:s,providerIndexes:0,value:i,namespace:Ts(),attrs:a,mergedAttrs:null,localNames:null,initialInputs:null,inputs:null,hostDirectiveInputs:null,outputs:null,hostDirectiveOutputs:null,directiveToIndex:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:t,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}function vp(e){let t=e[6]??[],n=e[3][11],r=[];for(let e of t)e.data.di===void 0?yp(e,n):r.push(e);e[6]=r}function yp(e,t){let n=0,r=e.firstChild;if(r){let i=e.data.r;for(;nnull,xp=()=>null;function Sp(e,t){return bp(e,t)}function Cp(e,t,n){return xp(e,t,n)}var wp=class{},Tp=class{},Ep=class{destroyNode=null;static __NG_ELEMENT_ID__=()=>Dp()};function Dp(){let e=qo(),t=Oo(Yo().index,e);return(fo(t)?t:e)[11]}var Op=(()=>{class e{static ɵprov=ki({token:e,providedIn:`root`,factory:()=>null})}return e})();function kp(e){return e.debugInfo?.className||e.type.name||null}var Ap={},jp=class{injector;parentInjector;constructor(e,t){this.injector=e,this.parentInjector=t}get(e,t,n){let r=this.injector.get(e,Ap,n);return r!==Ap||t===Ap?r:this.parentInjector.get(e,t,n)}};function Mp(e,t,n){return e[t]=n}function Np(e,t){return e[t]}function Pp(e,t,n){if(n===Ru)return!1;let r=e[t];return!Object.is(r,n)&&(e[t]=n,!0)}function Fp(e,t,n,r){let i=Pp(e,t,n);return Pp(e,t+1,r)||i}function Ip(e,t,n,r,i){let a=Fp(e,t,n,r);return Pp(e,t+2,i)||a}function Lp(e,t,n,r,i,a){let o=Fp(e,t,n,r);return Fp(e,t+2,i,a)||o}function Rp(e,t,n){return function r(i){let a=r.__ngNativeEl__;a!==void 0&&fu(i,a),np(ho(e)?Oo(e.index,t):t,5);let o=t[8],s=zp(t,o,n,i),c=r.__ngNextListenerFn__;for(;c;)s=zp(t,o,c,i)&&s,c=c.__ngNextListenerFn__;return s}}function zp(e,t,n,r){let i=rn(null);try{return Gc(Mc.OutputStart,t,n),n(r)!==!1}catch(t){return wf(e,t),!1}finally{Gc(Mc.OutputEnd,t,n),rn(i)}}function Bp(e,t,n,r,i,a,o,s){let c=go(e),l=!1,u=null;if(!r&&c&&(u=Hp(t,n,a,e.index)),u!==null){let e=u.__ngLastListenerFn__||u;e.__ngNextListenerFn__=o,u.__ngLastListenerFn__=o,l=!0}else{let o=wo(e,n),c=r?r(o):o;r||(s.__ngNativeEl__=o);let l=i.listen(c,a,s);Vp(a)||Up(r?t=>r(So(t[e.index])):e.index,t,n,a,s,l,!1)}return l}function Vp(e){return e.startsWith(`animation`)||e.startsWith(`transition`)}function Hp(e,t,n,r){let i=e.cleanup;if(i!=null)for(let e=0;er?n[r]:null}typeof a==`string`&&(e+=2)}return null}function Up(e,t,n,r,i,a,o){let s=t.firstCreatePass?zo(t):null,c=Ro(n),l=c.length;c.push(i,a),s&&s.push(r,e,l,(l+1)*(o?-1:1))}function Wp(e,t,n,r,i){let a=null,o=null,s=null,c=!1,l=e.directiveToIndex.get(n.type);if(typeof l==`number`?a=l:[a,o,s]=l,o!==null&&s!==null&&e.hostDirectiveOutputs&&Object.hasOwn(e.hostDirectiveOutputs,r)){let n=e.hostDirectiveOutputs[r];for(let a=0;a=o&&l<=s)c=!0,Gp(e,t,l,n[a+1],r,i);else if(l>s)break}}return Object.hasOwn(n.outputs,r)&&(c=!0,Gp(e,t,a,r,r,i)),c}function Gp(e,t,n,r,i,a){let o=t[n],s=t[1],c=o[s.data[n].outputs[r]].subscribe(a);Up(e.index,s,t,i,a,c,!0)}function Kp(){qp()}function qp(){let e=qo(),t=Jo(),n=Yo();if(t.firstCreatePass&&$p(t,n),n.controlDirectiveIndex===-1)return;od(`NgSignalForms`);let r=e[n.controlDirectiveIndex];t.data[n.controlDirectiveIndex].controlDef.create(r,new Xp(e,t,n))}function Jp(){Yp()}function Yp(){let e=qo(),t=Jo(),n=Ss();if(n.controlDirectiveIndex===-1)return;let r=t.data[n.controlDirectiveIndex].controlDef,i=e[n.controlDirectiveIndex];r.update(i,new Xp(e,t,n))}var Xp=class{lView;tView;tNode;hasPassThrough;constructor(e,t,n){this.lView=e,this.tView=t,this.tNode=n,this.hasPassThrough=!!(n.flags&4096)}get customControl(){return this.tNode.customControlIndex===-1?void 0:this.lView[this.tNode.customControlIndex]}get nativeElement(){return wo(this.tNode,this.lView)}get descriptor(){return`<${this.tNode.value}>`}listenToCustomControlOutput(e,t){let n=this.tView.data[this.tNode.customControlIndex];Wp(this.tNode,this.lView,n,e,Rp(this.tNode,this.lView,t))}listenToCustomControlModel(e){let t=this.tNode.flags&1024?`valueChange`:`checkedChange`,n=this.tView.data[this.tNode.customControlIndex];Wp(this.tNode,this.lView,n,t,Rp(this.tNode,this.lView,e))}listenToDom(e,t){Bp(this.tNode,this.tView,this.lView,void 0,this.lView[11],e,t,Rp(this.tNode,this.lView,t))}setInputOnDirectives(e,t,n){let r=this.tNode.inputs?.[e],i=this.tNode.hostDirectiveInputs?.[e];if(!r&&!i)return!1;let a=!1;if(r)for(let i of r){if(i===this.tNode.controlDirectiveIndex)continue;let r=this.lView[i],o=this.tView.data[i];(!n||n(Qp(r,o,e)))&&(of(o,r,e,t),a=!0)}if(i)for(let r=0;r0;){let e=n.shift();if(typeof e!=`function`){for(let n in e.inputs)t[e.inputs[n]]=!0;let r=Zp(e.directive);r!==null&&n.push(...r);continue}for(let r of e()){if(typeof r==`function`)continue;if(r.inputs)for(let e=0;e1){t.flags|=4096;return}em(e,t)}function em(e,t){for(let n=t.directiveStart;n{let r=t.hostDirectiveInputs[e],i=t.hostDirectiveOutputs[e+`Change`];if(!r||!i)return!1;for(let e=0;e=i&&a<=o)return t.flags|=n,t.customControlIndex=r,!0}}return!1};if(e(`value`,1024)||e(`checked`,2048))return}}function tm(e,t){return nm(e,t)&&rm(e,t+`Change`)}function nm(e,t){return t in e.inputs}function rm(e,t){return t in e.outputs}var im=Symbol(`BINDING`),am=new Ii(``);function om(e,t,n){let r=n?e.styles:null,i=n?e.classes:null,a=0;if(t!==null)for(let e=0;e0&&(n.directiveToIndex=new Map);for(let c=0;c0;){let n=e[--t];if(typeof n==`number`&&n<0)return n}return 0}function bm(e,t,n){if(n){if(t.exportAs)for(let r=0;r{let[n,r,i]=e[t],a={propName:n,templateName:t,isSignal:(r&af.SignalBased)!==0};return i&&(a.transform=i),a})}function Om(e){return Object.keys(e).map(t=>({propName:e[t],templateName:t}))}function km(e,t,n){let r=t instanceof Xa?t:t?.injector;return r&&e.getStandaloneInjector!==null&&(r=e.getStandaloneInjector(r)||r),r?new jp(n,r):n}function Am(e){let t=e.get(Tp,null);if(t===null)throw new vi(407,!1);return{rendererFactory:t,sanitizer:e.get(Op,null),changeDetectionScheduler:e.get(mc,null),ngReflect:!1,tracingService:e.get(id,null,{optional:!0})}}function jm(e,t,n){let r=Nm(e);return wu(t,r,r===`svg`?`svg`:r===`math`?xo:n)}function Mm(e){if((e&&`localName`in e&&typeof e.localName==`string`?e.localName:e?.tagName)?.toLowerCase()===`script`)throw new vi(905,!1)}function Nm(e){return(e.selectors[0][0]||`div`).toLowerCase()}var Pm=class{componentDef;ngModule;selector;componentType;ngContentSelectors;isBoundToModule;cachedInputs=null;cachedOutputs=null;get inputs(){return this.cachedInputs??=Dm(this.componentDef.inputs),this.cachedInputs}get outputs(){return this.cachedOutputs??=Om(this.componentDef.outputs),this.cachedOutputs}constructor(e,t){this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=fte(e.selectors),this.ngContentSelectors=e.ngContentSelectors??[],this.isBoundToModule=!!t}create(e,t,n,r,i,a,o){Gc(Mc.DynamicComponentStart);let s=rn(null);try{let s=this.componentDef,c=km(s,r||this.ngModule,e),l=Am(c),u=l.tracingService;return u&&u.componentCreate?u.componentCreate(kp(s),()=>this.createComponentRef(l,c,t,n,i,a,o)):this.createComponentRef(l,c,t,n,i,a,o)}finally{rn(s)}}createComponentRef(e,t,n,r,i,a,o){let s=this.componentDef,c=Fm(r,s,a,i),l=e.rendererFactory.createRenderer(null,s),u=r?uf(l,r,s.encapsulation,t):jm(s,l,o??null);Mm(u);let d=t.get(am,null),f=Im(u,()=>t.get(Ms,null)??cu());d&&d.addHost(f);let p=a?.some(Rm)||i?.some(e=>typeof e!=`function`&&e.bindings.some(Rm)),m=Qd(null,c,null,512|ef(s),null,null,e,l,t,null,hu(u,t,!0));d&&Tm&&f instanceof ShadowRoot&&Io(m,()=>{d.removeHost(f)}),m[27]=u,ps(m);let h=null;try{let e=Sm(27,m,2,`#host`,()=>c.directiveRegistry,!0,0);ku(l,u,e),nu(u,m),cf(c,m,e),vu(c,e,m),Cm(c,e),n!==void 0&&Bm(e,this.ngContentSelectors,n),h=Oo(e.index,m),m[8]=h[8],kf(c,m,null)}catch(e){throw h!==null&&eu(h),eu(m),e}finally{Gc(Mc.DynamicComponentEnd),vs()}return new zm(this.componentType,m,!!p)}};function Fm(e,t,n,r){let i=e?[`ng-version`,`22.1.7`]:pte(t.selectors[0]),a=null,o=null,s=0;if(n)for(let e of n)s+=e[im].requiredVars,e.create&&(e.targetIdx=0,(a??=[]).push(e)),e.update&&(e.targetIdx=0,(o??=[]).push(e));if(r)for(let e=0;e{if(n&1&&e)for(let t of e)t.create();if(n&2&&t)for(let e of t)e.update()}}function Rm(e){let t=e[im].kind;return t===`input`||t===`twoWay`}var zm=class extends wp{_rootLView;_hasInputBindings;instance;hostView;changeDetectorRef;componentType;location;previousInputValues=null;_tNode;constructor(e,t,n){super(),this._rootLView=t,this._hasInputBindings=n,this._tNode=To(t[1],27),this.location=Ul(this._tNode,t),this.instance=Oo(this._tNode.index,t)[8],this.hostView=this.changeDetectorRef=new up(t,void 0),this.componentType=e}setInput(e,t){this._hasInputBindings;let n=this._tNode;if(this.previousInputValues??=new Map,this.previousInputValues.has(e)&&Object.is(this.previousInputValues.get(e),t))return;let r=this._rootLView;Tf(n,r[1],r,e,t),this.previousInputValues.set(e,t),np(Oo(n.index,r),1)}get injector(){return new Fl(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}};function Bm(e,t,n){let r=e.projection=[];for(let e=0;e{class e{static __NG_ELEMENT_ID__=Hm}return e})();function Hm(){return Km(Yo(),qo())}var Um=class e extends Vm{_lContainer;_hostTNode;_hostLView;constructor(e,t,n){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=n}get element(){return Ul(this._hostTNode,this._hostLView)}get injector(){return new Fl(this._hostTNode,this._hostLView)}get parentInjector(){let e=Cl(this._hostTNode,this._hostLView);if(ll(e)){let t=fl(e,this._hostLView),n=ul(e),r=t[1].data[n+8];return new Fl(r,t)}return new Fl(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){let t=Wm(this._lContainer);return t!==null&&t[e]||null}get length(){return this._lContainer.length-10}createEmbeddedView(e,t,n){let r,i;typeof n==`number`?r=n:n!=null&&(r=n.index,i=n.injector);let a=Sp(this._lContainer,e.ssrId),o=e.createEmbeddedViewImpl(t||{},i,a);return this.insertImpl(o,r,Mf(this._hostTNode,a)),o}createComponent(e,t,n,r,i,a,o){let s,c=t||{};s=c.index,n=c.injector,r=c.projectableNodes,i=c.environmentInjector||c.ngModuleRef,a=c.directives,o=c.bindings;let l=new Pm(Wi(e)),u=n||this.parentInjector;if(!i&&l.ngModule==null){let e=this.parentInjector.get(Xa,null);e&&(i=e)}let d=Wi(l.componentType??{}),f=Sp(this._lContainer,d?.id??null),p=f?.firstChild??null,m=l.create(u,r,p,i,a,o,this._getHostElementNamespace());return this.insertImpl(m.hostView,s,Mf(this._hostTNode,f)),m}_getHostElementNamespace(){if(this._hostTNode.type&2){let e=this._hostTNode.parent??this._hostLView[5];return e!==null&&e.type&2&&typeof e.value==`string`&&e.value.toLowerCase()===`foreignobject`?null:e?.namespace??null}return this._hostTNode.namespace}insert(e,t){return this.insertImpl(e,t,!0)}insertImpl(t,n,r){let i=t._lView;if(Nee(i)){let n=this.indexOf(t);if(n!==-1)this.detach(n);else{let n=i[3],r=new e(n,n[5],n[3]);r.detach(r.indexOf(t))}}let a=this._adjustIndex(n),o=this._lContainer;return ap(o,i,a,r),t.attachToViewContainerRef(),ba(Gm(o),a,t),t}move(e,t){return this.insert(e,t)}indexOf(e){let t=Wm(this._lContainer);return t===null?-1:t.indexOf(e)}remove(e){let t=this._adjustIndex(e,-1),n=sp(this._lContainer,t);n&&(xa(Gm(this._lContainer),t),kd(n[1],n))}detach(e){let t=this._adjustIndex(e,-1),n=sp(this._lContainer,t);return n&&xa(Gm(this._lContainer),t)!=null?new up(n):null}_adjustIndex(e,t=0){return e??this.length+t}};function Wm(e){return e[8]}function Gm(e){return e[8]||=[]}function Km(e,t){let n,r=t[e.index];return po(r)?n=r:(n=rp(r,t,null,e),t[e.index]=n,nf(t,n)),Jm(n,t,e,r),new Um(n,e,t)}function qm(e,t){let n=e[11],r=n.createComment(``),i=wo(t,e);return Tu(n,n.parentNode(i),r,n.nextSibling(i),!1),r}var Jm=Zm,Ym=()=>!1;function Xm(e,t,n){return Ym(e,t,n)}function Zm(e,t,n,r){if(e[7])return;let i;i=n.type&8?So(r):qm(t,n),e[7]=i}var Qm=class e{queryList;matches=null;constructor(e){this.queryList=e}clone(){return new e(this.queryList)}setDirty(){this.queryList.setDirty()}},$m=class e{queries;constructor(e=[]){this.queries=e}createEmbeddedView(t){let n=t.queries;if(n!==null){let r=t.contentQueries===null?n.length:t.contentQueries[0],i=[];for(let e=0;e0)r.push(o[e/2]);else{let i=a[e+1],o=t[-n];for(let e=10;ee.trim())}function ph(e,t,n){e.queries===null&&(e.queries=new th),e.queries.track(new nh(t,n))}function mh(e,t){return e.queries.getByIndex(t)}function hh(e,t){let n=e[1],r=mh(n,t);return r.crossesNgTemplate?ch(n,e,t,[]):sh(n,e,r,t)}function gh(e,t,n){let r,i=Tn(()=>{r._dirtyCounter();let n=bh(r,e);if(t&&n===void 0)throw new vi(-951,!1);return n});return r=i[nn],r._dirtyCounter=D(0),r._flatValue=void 0,i}function _h(e){return gh(!0,!1,e)}function vh(e){return gh(!0,!0,e)}function yh(e,t){let n=e[nn];n._lView=qo(),n._queryIndex=t,n._queryList=lh(n._lView,t),n._queryList.onDirty(()=>n._dirtyCounter.update(e=>e+1))}function bh(e,t){let n=e._lView,r=e._queryIndex;if(n===void 0||r===void 0||n[2]&4)return t?void 0:ka;let i=lh(n,r),a=hh(n,r);return i.reset(a,Gl),t?i.first:i._changesDetected||e._flatValue===void 0?e._flatValue=i.toArray():e._flatValue}function xh(e){return!!e&&typeof e.then==`function`}function Sh(e){return!!e&&typeof e.subscribe==`function`}var Ch=class{},wh=class extends Ch{injector;instance=null;constructor(e){super();let t=new Za([...e.providers,{provide:Ch,useValue:this}],e.parent||Ya(),e.debugName,new Set([`environment`]));this.injector=t,e.runEnvironmentInitializers&&t.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(e){this.injector.onDestroy(e)}};function Th(e,t,n=null){return new wh({providers:e,parent:t,debugName:n,runEnvironmentInitializers:!0}).injector}var Eh=(()=>{class e{_injector;cachedInjectors=new Map;constructor(e){this._injector=e}getOrCreateStandaloneInjector(e){if(!e.standalone)return null;if(!this.cachedInjectors.has(e)){let t=Fa(!1,e.type),n=t.length>0?Th([t],this._injector,``):null;this.cachedInjectors.set(e,n)}return this.cachedInjectors.get(e)}ngOnDestroy(){try{for(let e of this.cachedInjectors.values())e!==null&&e.destroy()}finally{this.cachedInjectors.clear()}}static ɵprov=ki({token:e,providedIn:`environment`,factory:()=>new e(da(Xa))})}return e})();function k(e){return jc(()=>{let t=Mh(e),n={...t,decls:e.decls,vars:e.vars,template:e.template,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,onPush:e.changeDetection!==Yl.Eager,directiveDefs:null,pipeDefs:null,dependencies:t.standalone&&e.dependencies||null,getStandaloneInjector:t.standalone?e=>e.get(Eh).getOrCreateStandaloneInjector(n):null,getExternalStyles:null,signals:e.signals??!1,data:e.data||{},encapsulation:e.encapsulation||yu.Emulated,styles:e.styles||ka,_:null,schemas:e.schemas||null,tView:null,id:``};t.standalone&&od(`NgStandalone`),Nh(n);let r=e.dependencies;return n.directiveDefs=Ph(r,Dh),n.pipeDefs=Ph(r,Ki),n.id=Fh(n),n})}function Dh(e){return Wi(e)||Gi(e)}function Oh(e,t){if(e==null)return Oa;let n={};for(let r in e)if(Object.hasOwn(e,r)){let i=e[r],a,o,s,c;Array.isArray(i)?(s=i[0],a=i[1],o=i[2]??a,c=i[3]||null):(a=i,o=i,s=af.None,c=null),n[a]=[r,s,c],t[a]=o}return n}function kh(e){if(e==null)return Oa;let t={};for(let n in e)Object.hasOwn(e,n)&&(t[e[n]]=n);return t}function Ah(e){return jc(()=>{let t=Mh(e);return Nh(t),t})}function jh(e){return{type:e.type,name:e.name,factory:null,pure:e.pure!==!1,standalone:e.standalone??!0,onDestroy:e.type.prototype.ngOnDestroy||null}}function Mh(e){let t={};return{type:e.type,providersResolver:null,viewProvidersResolver:null,factory:null,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:t,inputConfig:e.inputs||Oa,exportAs:e.exportAs||null,standalone:e.standalone??!0,signals:e.signals===!0,selectors:e.selectors||ka,viewQuery:e.viewQuery||null,features:e.features||null,setInput:null,resolveHostDirectives:null,hostDirectives:null,controlDef:null,signalFormsInputPresence:null,inputs:Oh(e.inputs,t),outputs:kh(e.outputs),debugInfo:null}}function Nh(e){e.features?.forEach(t=>t(e))}function Ph(e,t){return e?()=>{let n=typeof e==`function`?e():e,r=[];for(let e of n){let n=t(e);n!==null&&r.push(n)}return r}:null}function Fh(e){let t=0,n=typeof e.consts==`function`?``:e.consts,r=[e.selectors,e.ngContentSelectors,e.hostVars,e.hostAttrs,n,e.vars,e.decls,e.encapsulation,e.standalone,e.signals,e.exportAs,JSON.stringify(e.inputs),JSON.stringify(e.outputs),Object.getOwnPropertyNames(e.type.prototype),!!e.contentQueries,!!e.viewQuery];for(let e of r.join(`|`))t=Math.imul(31,t)+e.charCodeAt(0)<<0;return t+=2147483648,`c`+t}var Ih=new Ii(``),Lh=(()=>{class e{resolve;reject;initialized=!1;done=!1;donePromise=new Promise((e,t)=>{this.resolve=e,this.reject=t});appInits=C(Ih,{optional:!0})??[];injector=C(js);constructor(){}runInitializers(){if(this.initialized)return;let e=[];for(let t of this.appInits){let n=co(this.injector,t);if(xh(n))e.push(n);else if(Sh(n)){let t=new Promise((e,t)=>{n.subscribe({complete:e,error:t})});e.push(t)}}let t=()=>{this.done=!0,this.resolve()};Promise.all(e).then(()=>{t()}).catch(e=>{this.reject(e)}),e.length===0&&t(),this.initialized=!0}static ɵfac=function(t){return new(t||e)};static ɵprov=Vl({token:e,factory:e.ɵfac})}return e})();function Rh(e){return t=>{t.controlDef={create:(e,t)=>{e?.ɵngControlCreate(t)},update:(e,t)=>{e?.ɵngControlUpdate?.(t)},passThroughInput:e}}}function zh(e){return Object.getPrototypeOf(e.prototype).constructor}function Bh(e){let t=zh(e.type),n=!0,r=[e];for(;t&&t!==Function.prototype&&t!==Object.prototype;){let i,a=Object.hasOwn(t,Ri)?t[Ri]:void 0,o=Object.hasOwn(t,zi)?t[zi]:void 0;if(_o(e))i=a??o;else{if(a)throw new vi(903,!1);i=o}if(i){if(n){r.push(i);let t=e;t.inputs=Uh(e.inputs),t.declaredInputs=Uh(e.declaredInputs),t.outputs=Uh(e.outputs);let n=i.hostBindings;n&&Kh(e,n);let a=i.viewQuery,o=i.contentQueries;if(a&&Wh(e,a),o&&Gh(e,o),Vh(e,i),Si(e.outputs,i.outputs),_o(i)&&i.data.animation){let t=e.data;t.animation=(t.animation||[]).concat(i.data.animation)}}let t=i.features;if(t)for(let r=0;r=0;r--){let i=e[r];i.hostVars=t+=i.hostVars,i.hostAttrs=sl(i.hostAttrs,n=sl(n,i.hostAttrs))}}function Uh(e){return e===Oa?{}:e===ka?[]:e}function Wh(e,t){let n=e.viewQuery;e.viewQuery=n?(e,r)=>{t(e,r),n(e,r)}:t}function Gh(e,t){let n=e.contentQueries;e.contentQueries=n?(e,r,i)=>{t(e,r,i),n(e,r,i)}:t}function Kh(e,t){let n=e.hostBindings;e.hostBindings=n?(e,r)=>{t(e,r),n(e,r)}:t}function qh(e,t,n,r,i,a,o,s){if(n.firstCreatePass){e.mergedAttrs=sl(e.mergedAttrs,e.attrs);let t=e.tView=Yd(2,e,i,a,o,n.directiveRegistry,n.pipeRegistry,null,n.schemas,n.consts,null);n.queries!==null&&(n.queries.template(n,e),t.queries=n.queries.embeddedTView(e))}s&&(e.flags|=s),Zo(e,!1);let c=Zh(n,t,e,r);Ds()&&Rd(n,t,c,e),nu(c,t);let l=rp(c,t,c,e);t[r+27]=l,nf(t,l),Xm(l,e,t)}function Jh(e,t,n,r,i,a,o,s,c,l,u){let d=n+27,f;return t.firstCreatePass?(f=mp(t,d,4,o||null,s||null),Uo()&&cm(t,e,f,Ao(t.consts,l),vf),qc(t,f)):f=t.data[d],qh(f,e,t,n,r,i,a,c),go(f)&&cf(t,e,f),l!=null&&lf(e,f,u),f}function Yh(e,t,n,r,i,a,o,s,c,l,u){let d=n+27,f;if(t.firstCreatePass){if(f=mp(t,d,4,o||null,s||null),l!=null){let e=Ao(t.consts,l);f.localNames=[];for(let t=0;t{throw new vi(600,``)})}var ng=10,rg=(()=>{class e{_runningTick=!1;_destroyed=!1;_destroyListeners=[];_views=[];internalErrorHandler=C(ic);afterRenderManager=C(sd);zonelessEnabled=C(hc);rootEffectScheduler=C(_c);dirtyFlags=0;tracingSnapshot=null;allTestViews=new Set;autoDetectTestViews=new Set;includeAllTestViews=!1;afterTick=new Yr;get allViews(){return[...(this.includeAllTestViews?this.allTestViews:this.autoDetectTestViews).keys(),...this._views]}get destroyed(){return this._destroyed}componentTypes=[];components=[];internalPendingTask=C(Ls);get isStable(){return this.internalPendingTask.hasPendingTasksObservable.pipe(gi(e=>!e))}constructor(){C(id,{optional:!0})}whenStable(){let e;return new Promise(t=>{e=this.isStable.subscribe({next:e=>{e&&t()}})}).finally(()=>{e.unsubscribe()})}_injector=C(Xa);_rendererFactory=null;get injector(){return this._injector}bootstrap(e,t){return this.bootstrapImpl(e,t)}bootstrapImpl(e,t,n=js.NULL){return this._injector.get(Gs).run(()=>{if(Gc(Mc.BootstrapComponentStart),!this._injector.get(Lh).done)throw new vi(405,``);let r=Wi(e),i=this._injector.get(Ch),a=new Pm(r,i);this.componentTypes.push(e);let{hostElement:o,directives:s,bindings:c}=ig(t),l=o||a.selector,u=a.create(n,[],l,i.injector,s,c),d=u.location.nativeElement,f=u.injector.get($h,null);return f?.registerApplication(d),u.onDestroy(()=>{this.detachView(u.hostView),ag(this.components,u),f?.unregisterApplication(d)}),this._loadComponent(u),Gc(Mc.BootstrapComponentEnd,u),u})}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick(){Gc(Mc.ChangeDetectionStart),this.tracingSnapshot===null?this.tickImpl():this.tracingSnapshot.run(rd.CHANGE_DETECTION,this.tickImpl)}tickImpl=()=>{if(this._runningTick)throw Gc(Mc.ChangeDetectionEnd),new vi(101,!1);let e=rn(null);try{this._runningTick=!0,this.synchronize()}finally{this._runningTick=!1,this.tracingSnapshot?.dispose(),this.tracingSnapshot=null,rn(e),this.afterTick.next(),Gc(Mc.ChangeDetectionEnd)}};synchronize(){this._rendererFactory===null&&!this._injector.destroyed&&(this._rendererFactory=this._injector.get(Tp,null,{optional:!0}));let e=0;for(;this.dirtyFlags!==0&&e++No(e))){this.dirtyFlags|=2;return}this.dirtyFlags&=-8}attachView(e){let t=e;this._views.push(t),t.attachToAppRef(this)}detachView(e){let t=e;ag(this._views,t),t.detachFromAppRef()}_loadComponent(e){this.attachView(e.hostView);try{this.tick()}catch(e){this.internalErrorHandler(e)}this.components.push(e),this._injector.get(eg,[]).forEach(t=>t(e))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(e=>e()),this._views.slice().forEach(e=>e.destroy())}finally{this._destroyed=!0,this._views=[],this._destroyListeners=[]}}onDestroy(e){return this._destroyListeners.push(e),()=>ag(this._destroyListeners,e)}destroy(){if(this._destroyed)throw new vi(406,!1);let e=this._injector;e.destroy&&!e.destroyed&&e.destroy()}get viewCount(){return this._views.length}static ɵfac=function(t){return new(t||e)};static ɵprov=Vl({token:e,factory:e.ɵfac})}return e})();function ig(e){return e===void 0||typeof e==`string`||e instanceof Element?{hostElement:e}:e}function ag(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function A(e,t,n,r){let i=qo();return Pp(i,as(),t)&&(Jo(),yf(Ss(),i,e,t,n,r)),A}function og(e){if(od(`NgAnimateEnter`),!qu)return og;let t=qo();if(Cte(t))return og;let n=Yo(),r=t[9].get(Gs);return Ote(ed(t),n,()=>sg(t,n,e,r)),md(t[9]),hd(t[9],ed(t)),og}function sg(e,t,n,r){let i=wo(t,e),a=e[11],o=Dte(n),s=[],c=!1,l=e=>{if(td(e)!==i)return;let t=e instanceof AnimationEvent?`animationend`:`transitionend`;r.runOutsideAngular(()=>{a.listen(i,t,u)})},u=e=>{td(e)===i&&(nd(e,i)&&(c=!0),cg(e,i,a))};if(o&&o.length>0){r.runOutsideAngular(()=>{s.push(a.listen(i,`animationstart`,l)),s.push(a.listen(i,`transitionstart`,l))}),wte(i,o,s);for(let e of o)a.addClass(i,e);r.runOutsideAngular(()=>{requestAnimationFrame(()=>{if(!c&&(yte(i,Xu,qu),!Xu.has(i))){for(let e of o)a.removeClass(i,e);Ju(i)}})})}}function cg(e,t,n){let r=Yu.get(t);if(td(e)===t&&r&&nd(e,t)){e.stopPropagation();for(let e of r.classList)n.removeClass(t,e);Ju(t)}}var lg=class{destroy(e){}updateValue(e,t){}swap(e,t){let n=Math.min(e,t),r=Math.max(e,t),i=this.detach(r);if(r-n>1){let e=this.detach(n);this.attach(n,i),this.attach(r,e)}else this.attach(n,i)}move(e,t){this.attach(t,this.detach(e))}};function ug(e,t,n,r,i){return e===n&&Object.is(t,r)?1:Object.is(i(e,t),i(n,r))?-1:0}function dg(e,t,n,r){let i,a,o=0,s=e.length-1;if(Array.isArray(t)){rn(r);let c=t.length-1;for(rn(null);o<=s&&o<=c;){let r=e.at(o),l=t[o],u=ug(o,r,o,l,n);if(u!==0){u<0&&e.updateValue(o,l),o++;continue}let d=e.at(s),f=t[c],p=ug(s,d,c,f,n);if(p!==0){p<0&&e.updateValue(s,f),s--,c--;continue}let m=n(o,r),h=n(s,d),g=n(o,l);if(Object.is(g,h)){let t=n(c,f);Object.is(t,m)?(e.swap(o,s),e.updateValue(s,f),c--,s--):e.move(s,o),e.updateValue(o,l),o++;continue}if(i??=new hg,a??=mg(e,o,s,n),fg(e,i,o,g))e.updateValue(o,l),o++,s++;else if(a.has(g))i.set(m,e.detach(o)),s--;else{let n=e.create(o,t[o]);e.attach(o,n),o++,s++}}for(;o<=c;)pg(e,i,n,o,t[o]),o++}else if(t!=null){rn(r);let c=t[Symbol.iterator]();rn(null);let l=c.next();for(;!l.done&&o<=s;){let t=e.at(o),r=l.value,u=ug(o,t,o,r,n);if(u!==0)u<0&&e.updateValue(o,r),o++,l=c.next();else{i??=new hg,a??=mg(e,o,s,n);let u=n(o,r);if(fg(e,i,o,u))e.updateValue(o,r),o++,s++,l=c.next();else if(!a.has(u))e.attach(o,e.create(o,r)),o++,s++,l=c.next();else{let r=n(o,t);i.set(r,e.detach(o)),s--}}}for(;!l.done;)pg(e,i,n,e.length,l.value),l=c.next()}for(;o<=s;)e.destroy(e.detach(s--));i?.forEach(t=>{e.destroy(t)})}function fg(e,t,n,r){return t!==void 0&&t.has(r)?(e.attach(n,t.get(r)),t.delete(r),!0):!1}function pg(e,t,n,r,i){if(fg(e,t,r,n(r,i)))e.updateValue(r,i);else{let t=e.create(r,i);e.attach(r,t)}}function mg(e,t,n,r){let i=new Set;for(let a=t;a<=n;a++)i.add(r(a,e.at(a)));return i}var hg=class{kvMap=new Map;_vMap=void 0;has(e){return this.kvMap.has(e)}delete(e){if(!this.has(e))return!1;let t=this.kvMap.get(e);return this._vMap!==void 0&&this._vMap.has(t)?(this.kvMap.set(e,this._vMap.get(t)),this._vMap.delete(t)):this.kvMap.delete(e),!0}get(e){return this.kvMap.get(e)}set(e,t){if(this.kvMap.has(e)){let n=this.kvMap.get(e);this._vMap===void 0&&(this._vMap=new Map);let r=this._vMap;for(;r.has(n);)n=r.get(n);r.set(n,t)}else this.kvMap.set(e,t)}forEach(e){for(let[t,n]of this.kvMap)if(e(n,t),this._vMap!==void 0){let r=this._vMap;for(;r.has(n);)n=r.get(n),e(n,t)}}};function j(e,t,n,r,i,a,o,s){od(`NgControlFlow`);let c=qo(),l=Jo();return Yh(c,l,e,t,n,r,i,Ao(l.consts,a),256,o,s),gg}function gg(e,t,n,r,i,a,o,s){od(`NgControlFlow`);let c=qo(),l=Jo();return Yh(c,l,e,t,n,r,i,Ao(l.consts,a),512,o,s),gg}function M(e,t){od(`NgControlFlow`);let n=qo(),r=as(),i=n[r]===Ru?-1:n[r],a=i===-1?void 0:Sg(n,27+i);if(Pp(n,r,e)){let r=rn(null);try{if(a!==void 0&&op(a,0),e!==-1){let r=27+e,i=Sg(n,r),a=Dg(n[1],r),o=Cp(i,a,n);ap(i,jf(n,a,t,{dehydratedView:o}),0,Mf(a,o))}}finally{rn(r)}}else if(a!==void 0){let e=ip(a,0);e!==void 0&&(e[8]=t)}}var _g=class{lContainer;$implicit;$index;constructor(e,t,n){this.lContainer=e,this.$implicit=t,this.$index=n}get $count(){return this.lContainer.length-10}};function vg(e){return e}function yg(e,t){return t}var bg=class{hasEmptyBlock;trackByFn;liveCollection;constructor(e,t,n){this.hasEmptyBlock=e,this.trackByFn=t,this.liveCollection=n}};function N(e,t,n,r,i,a,o,s,c,l,u,d,f){od(`NgControlFlow`);let p=qo(),m=Jo(),h=c!==void 0,g=qo(),_=new bg(h,s?o.bind(g[15][8]):o);g[27+e]=_,Yh(p,m,e+1,t,n,r,i,Ao(m.consts,a),256),h&&Yh(p,m,e+2,c,l,u,d,Ao(m.consts,f),512)}var xg=class extends lg{lContainer;hostLView;templateTNode;operationsCounter=void 0;needsIndexUpdate=!1;constructor(e,t,n){super(),this.lContainer=e,this.hostLView=t,this.templateTNode=n}get length(){return this.lContainer.length-10}at(e){return this.getLView(e)[8].$implicit}attach(e,t){let n=t[6];this.needsIndexUpdate||=e!==this.length,ap(this.lContainer,t,e,Mf(this.templateTNode,n)),Cg(this.lContainer,e)}detach(e){return this.needsIndexUpdate||=e!==this.length-1,wg(this.lContainer,e),Tg(this.lContainer,e)}create(e,t){let n=Sp(this.lContainer,this.templateTNode.tView.ssrId);return jf(this.hostLView,this.templateTNode,new _g(this.lContainer,t,e),{dehydratedView:n})}destroy(e){kd(e[1],e)}updateValue(e,t){this.getLView(e)[8].$implicit=t}reset(){this.needsIndexUpdate=!1}updateIndexes(){if(this.needsIndexUpdate)for(let e=0;e0){let e=n[9];Mte(e,r),Ku.delete(n[19]),r.detachedLeaveAnimationFns=void 0}}function wg(e,t){if(e.length<=10)return;let n=e[10+t],r=n?n[26]:void 0;r&&r.leave&&r.leave.size>0&&(r.detachedLeaveAnimationFns=[])}function Tg(e,t){return sp(e,t)}function Eg(e,t){return ip(e,t)}function Dg(e,t){return To(e,t)}function F(e,t,n){let r=qo();return Pp(r,as(),t)&&(Jo(),ff(Ss(),r,e,t,r[11],n)),F}function Og(e,t,n,r,i){Tf(t,e,n,i?`class`:`style`,r)}function I(e,t,n,r){let i=qo(),a=i[1],o=e+27,s=a.firstCreatePass?Sm(o,i,2,t,vf,Uo(),n,r):a.data[o];if(ho(s)){let n=i[10].tracingService;if(n&&n.componentCreate){let o=a.data[s.directiveStart+s.componentOffset];return n.componentCreate(kp(o),()=>(kg(e,t,i,s,r),I))}}return kg(e,t,i,s,r),I}function kg(e,t,n,r,i){if(Sf(r,n,e,t,jg),go(r)){let e=n[1];cf(e,n,r),vu(e,r,n)}i!=null&&lf(n,r)}function L(){let e=Jo(),t=Cf(Yo());return e.firstCreatePass&&Cm(e,t),Go(t)&&Ko(),Ho(),t.classesWithoutHost!=null&&nl(t)&&Og(e,t,qo(),t.classesWithoutHost,!0),t.stylesWithoutHost!=null&&rl(t)&&Og(e,t,qo(),t.stylesWithoutHost,!1),L}function R(e,t,n,r){return I(e,t,n,r),L(),R}function z(e,t,n,r){let i=qo(),a=i[1],o=e+27,s=a.firstCreatePass?wm(o,a,2,t,n,r):a.data[o];return Sf(s,i,e,t,jg),r!=null&&lf(i,s),z}function B(){return Go(Cf(Yo()))&&Ko(),Ho(),B}function Ag(e,t,n,r){return z(e,t,n,r),B(),Ag}var jg=(e,t,n,r,i)=>(Os(!0),wu(t[11],r,Ts()));function Mg(e,t,n){let r=qo(),i=r[1],a=e+27,o=i.firstCreatePass?Sm(a,r,8,`ng-container`,vf,Uo(),t,n):i.data[a];if(Sf(o,r,e,`ng-container`,Fg),go(o)){let e=r[1];cf(e,r,o),vu(e,o,r)}return n!=null&&lf(r,o),Mg}function Ng(){let e=Jo(),t=Cf(Yo());return e.firstCreatePass&&Cm(e,t),Ng}function Pg(e,t,n){return Mg(e,t,n),Ng(),Pg}var Fg=(e,t,n,r,i)=>(Os(!0),Qee(t[11],``));function V(){return qo()}function Ig(e,t,n){let r=qo();return Pp(r,as(),t)&&(Jo(),pf(Ss(),r,e,t,r[11],n)),Ig}var Lg=void 0;function Rg(e){let t=Math.floor(Math.abs(e)),n=e.toString().replace(/^[^.]*\.?/,``).length;return t===1&&n===0?1:5}var zg=[`en`,[[`a`,`p`],[`AM`,`PM`]],[[`AM`,`PM`]],[[`S`,`M`,`T`,`W`,`T`,`F`,`S`],[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`]],Lg,[[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]],Lg,[[`B`,`A`],[`BC`,`AD`],[`Before Christ`,`Anno Domini`]],0,[6,0],[`M/d/yy`,`MMM d, y`,`MMMM d, y`,`EEEE, MMMM d, y`],[`h:mm a`,`h:mm:ss a`,`h:mm:ss a z`,`h:mm:ss a zzzz`],[`{1}, {0}`,Lg,Lg,Lg],[`.`,`,`,`;`,`%`,`+`,`-`,`E`,`×`,`‰`,`∞`,`NaN`,`:`],[`#,##0.###`,`#,##0%`,`¤#,##0.00`,`#E0`],`USD`,`$`,`US Dollar`,{},`ltr`,Rg],Bg=Object.create(null);function Vg(e){let t=Wg(e),n=Hg(t);if(n)return n;let r=t.split(`-`)[0];if(n=Hg(r),n)return n;if(r===`en`)return zg;throw new vi(701,!1)}function Hg(e){if(!(e in Bg)){let t=oa.ng&&oa.ng.common&&oa.ng.common.locales&&oa.ng.common.locales[e];return t!==void 0&&(Bg[e]=t),t}return Bg[e]}var Ug={LocaleId:0,DayPeriodsFormat:1,DayPeriodsStandalone:2,DaysFormat:3,DaysStandalone:4,MonthsFormat:5,MonthsStandalone:6,Eras:7,FirstDayOfWeek:8,WeekendRange:9,DateFormat:10,TimeFormat:11,DateTimeFormat:12,NumberSymbols:13,NumberFormats:14,CurrencyCode:15,CurrencySymbol:16,CurrencyName:17,Currencies:18,Directionality:19,PluralCase:20,ExtraData:21};function Wg(e){return e.toLowerCase().replace(/_/g,`-`)}var Gg=`en-US`;function Kg(e){typeof e==`string`&&e.toLowerCase().replace(/_/g,`-`)}function H(e,t,n){let r=qo(),i=Jo(),a=Yo();return qg(i,r,r[11],a,e,t,n),H}function U(e,t,n){let r=qo(),i=Jo(),a=Yo();return(a.type&3||n)&&Bp(a,i,r,n,r[11],e,t,Rp(a,r,t)),U}function qg(e,t,n,r,i,a,o){let s=!0,c=null;if((r.type&3||o)&&(c??=Rp(r,t,a),Bp(r,e,t,o,n,i,a,c)&&(s=!1)),s){let e=r.outputs?.[i],n=r.hostDirectiveOutputs?.[i];if(n&&n.length)for(let e=0;e>17&32767}function r_(e){return(e&2)==2}function i_(e,t){return e&131071|t<<17}function a_(e){return e|2}function o_(e){return(e&131068)>>2}function s_(e,t){return e&-131069|t<<2}function c_(e){return(e&1)==1}function l_(e){return e|1}function u_(e,t,n,r,i,a){let o=a?t.classBindings:t.styleBindings,s=n_(o),c=o_(o);e[r]=n;let l=!1,u;if(Array.isArray(n)){let e=n;u=e[1],(u===null||Ea(e,u)>0)&&(l=!0)}else u=n;if(i){if(c!==0){let t=n_(e[s+1]);e[r+1]=t_(t,s),t!==0&&(e[t+1]=s_(e[t+1],r)),e[s+1]=i_(e[s+1],r)}else e[r+1]=t_(s,0),s!==0&&(e[s+1]=s_(e[s+1],r)),s=r}else e[r+1]=t_(c,0),s===0?s=r:e[c+1]=s_(e[c+1],r),c=r;l&&(e[r+1]=a_(e[r+1])),f_(e,u,r,!0),f_(e,u,r,!1),d_(t,u,e,r,a),o=t_(s,c),a?t.classBindings=o:t.styleBindings=o}function d_(e,t,n,r,i){let a=i?e.residualClasses:e.residualStyles;a!=null&&typeof t==`string`&&Ea(a,t)>=0&&(n[r+1]=l_(n[r+1]))}function f_(e,t,n,r){let i=e[n+1],a=t===null,o=r?n_(i):o_(i),s=!1;for(;o!==0&&(s===!1||a);){let n=e[o],i=e[o+1];p_(n,t)&&(s=!0,e[o+1]=r?l_(i):a_(i)),o=r?n_(i):o_(i)}s&&(e[n+1]=r?a_(i):l_(i))}function p_(e,t){return e===null||t==null||(Array.isArray(e)?e[1]:e)===t?!0:Array.isArray(e)&&typeof t==`string`?Ea(e,t)>=0:!1}var m_={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function h_(e){return e.substring(m_.key,m_.keyEnd)}function g_(e){return v_(e),__(e,y_(e,0,m_.textEnd))}function __(e,t){let n=m_.textEnd;return n===t?-1:(t=m_.keyEnd=b_(e,m_.key=t,n),y_(e,t,n))}function v_(e){m_.key=0,m_.keyEnd=0,m_.value=0,m_.valueEnd=0,m_.textEnd=e.length}function y_(e,t,n){for(;t32;)t++;return t}function x_(e,t,n){return w_(e,t,n,!1),x_}function G(e,t){return w_(e,t,null,!0),G}function S_(e){T_(Ite,C_,e,!0)}function C_(e,t){for(let n=g_(t);n>=0;n=__(t,n))wa(e,h_(t),!0)}function w_(e,t,n,r){let i=qo(),a=Jo(),o=os(2);if(a.firstUpdatePass&&D_(a,e,o,r),t!==Ru&&Pp(i,o,t)){let s=a.data[bs()];N_(a,s,i,i[11],e,i[o+1]=Rte(t,n),r,o)}}function T_(e,t,n,r){let i=Jo(),a=os(2);i.firstUpdatePass&&D_(i,null,a,r);let o=qo();if(n!==Ru&&Pp(o,a,n)){let s=i.data[bs()];if(I_(s,r)&&!E_(i,a)){let e=r?s.classesWithoutHost:s.stylesWithoutHost;e!==null&&(n=wi(e,n||``)),Og(i,s,o,n,r)}else Lte(i,s,o,o[11],o[a+1],o[a+1]=Fte(e,t,n),r,a)}}function E_(e,t){return t>=e.expandoStartIndex}function D_(e,t,n,r){let i=e.data;if(i[n+1]===null){let a=i[bs()],o=E_(e,n);I_(a,r)&&t===null&&!o&&(t=!1),t=O_(i,a,t,r),u_(i,a,t,n,o,r)}}function O_(e,t,n,r){let i=cs(e),a=r?t.residualClasses:t.residualStyles;if(i===null)(r?t.classBindings:t.styleBindings)===0&&(n=j_(null,e,t,n,r),n=M_(n,t.attrs,r),a=null);else{let o=t.directiveStylingLast;if(o===-1||e[o]!==i){if(n=j_(i,e,t,n,r),a===null){let n=k_(e,t,r);n!==void 0&&Array.isArray(n)&&(n=j_(null,e,t,n[1],r),n=M_(n,t.attrs,r),A_(e,t,r,n))}else a=Pte(e,t,r)}}return a!==void 0&&(r?t.residualClasses=a:t.residualStyles=a),n}function k_(e,t,n){let r=n?t.classBindings:t.styleBindings;if(o_(r)!==0)return e[n_(r)]}function A_(e,t,n,r){let i=n?t.classBindings:t.styleBindings;e[n_(i)]=r}function Pte(e,t,n){let r,i=t.directiveEnd;for(let a=1+t.directiveStylingLast;a0;){let t=e[i],a=Array.isArray(t),c=a?t[1]:t,l=c===null,u=n[i+1];u===Ru&&(u=l?ka:void 0);let d=l?Ta(u,r):c===r?u:void 0;if(a&&!F_(d)&&(d=Ta(t,r)),F_(d)&&(s=d,o))return s;let f=e[i+1];i=o?n_(f):o_(f)}if(t!==null){let e=a?t.residualClasses:t.residualStyles;e!=null&&(s=Ta(e,r))}return s}function F_(e){return e!==void 0}function Rte(e,t){return e==null||e===``||(typeof t==`string`?e=xu(e)+t:typeof e==`object`&&(e=Ci(xu(e)))),e}function I_(e,t){return!!(e.flags&(t?8:16))}function K(e,t=``){let n=qo(),r=Jo(),i=e+27,a=r.firstCreatePass?mp(r,i,1,t,null):r.data[i],o=zte(r,n,a,t);n[i]=o,Ds()&&Rd(r,n,o,a),Zo(a,!1)}var zte=(e,t,n,r)=>(Os(!0),Xee(t[11],r));function L_(e,t,n,r=``){return Pp(e,as(),n)?t+Ji(n)+r:Ru}function Bte(e,t,n,r,i,a=``){let o=Fp(e,is(),n,i);return os(2),o?t+Ji(n)+r+Ji(i)+a:Ru}function Vte(e,t,n,r,i,a,o,s=``){let c=Ip(e,is(),n,i,o);return os(3),c?t+Ji(n)+r+Ji(i)+a+Ji(o)+s:Ru}function Hte(e,t,n,r,i,a,o,s,c,l=``){let u=Lp(e,is(),n,i,o,c);return os(4),u?t+Ji(n)+r+Ji(i)+a+Ji(o)+s+Ji(c)+l:Ru}function q(e){return J(``,e),q}function J(e,t,n){let r=qo(),i=L_(r,e,t,n);return i!==Ru&&B_(r,bs(),i),J}function Y(e,t,n,r,i){let a=qo(),o=Bte(a,e,t,n,r,i);return o!==Ru&&B_(a,bs(),o),Y}function R_(e,t,n,r,i,a,o){let s=qo(),c=Vte(s,e,t,n,r,i,a,o);return c!==Ru&&B_(s,bs(),c),R_}function z_(e,t,n,r,i,a,o,s,c){let l=qo(),u=Hte(l,e,t,n,r,i,a,o,s,c);return u!==Ru&&B_(l,bs(),u),z_}function B_(e,t,n){let r=Co(t,e);Zee(e[11],r,n)}function V_(e,t,n){Oc(t)&&(t=t());let r=qo();return Pp(r,as(),t)&&(Jo(),ff(Ss(),r,e,t,r[11],n)),V_}function H_(e,t){let n=Oc(e);return n&&e.set(t),n}function U_(e,t){let n=qo(),r=Jo(),i=Yo();return qg(r,n,n[11],i,e,t),U_}var W_={};function G_(e){od(`NgLet`);let t=Jo(),n=qo(),r=e+27;return Zo(mp(t,r,128,null,null),!1),Do(t,n,r,W_),G_}function K_(e){return Do(Jo(),qo(),bs(),e),e}function q_(e){let t=Eo(es(),27+e);if(t===W_)throw new vi(314,!1);return t}function J_(e,t,n=``){return L_(qo(),e,t,n)}function Y_(e,t,n){let r=Jo();r.firstCreatePass&&X_(t,r.data,r.blueprint,_o(e),n)}function X_(e,t,n,r,i){if(e=Di(e),Array.isArray(e))for(let a=0;a>20;if(Ua(e)||!e.multi){let r=new tl(l,i,sm,null),p=$_(c,t,i?u:u+f,d);p===-1?(wl(bl(s,o),a,c),Z_(a,e,t.length),t.push(c),s.directiveStart++,s.directiveEnd++,i&&(s.providerIndexes+=1048576),n.push(r),o.push(r)):(n[p]=r,o[p]=r)}else{let p=$_(c,t,u+f,d),m=$_(c,t,u,u+f),h=p>=0&&n[p],g=m>=0&&n[m];if(i&&!g||!i&&!h){wl(bl(s,o),a,c);let u=Gte(i?Wte:Ute,n.length,i,r,l,e);!i&&g&&(n[m].providerFactory=u),Z_(a,e,t.length,0),t.push(c),s.directiveStart++,s.directiveEnd++,i&&(s.providerIndexes+=1048576),n.push(u),o.push(u)}else{let t=Q_(n[i?m:p],l,!i&&r);Z_(a,e,p>-1?p:m,t)}!i&&r&&g&&n[m].componentProviders++}}}function Z_(e,t,n,r){let i=Ua(t),a=Wa(t);if(i||a){let o=(a?Di(t.useClass):t).prototype.ngOnDestroy;if(o){let a=e.destroyHooks||=[];if(!i&&t.multi){let e=a.indexOf(n);e===-1?a.push(n,[r,o]):a[e+1].push(r,o)}else a.push(n,o)}}}function Q_(e,t,n){return n&&e.componentProviders++,e.multi.push(t)-1}function $_(e,t,n,r){for(let i=n;i{n.providersResolver=(t,n)=>Y_(t,n?n(e):e,!1),t&&(n.viewProvidersResolver=(e,n)=>Y_(e,n?n(t):t,!0))}}function nv(e,t){let n=rs()+e,r=qo();return r[n]===Ru?Mp(r,n,t()):Np(r,n)}function rv(e,t,n){return ov(qo(),rs(),e,t,n)}function iv(e,t,n,r){return sv(qo(),rs(),e,t,n,r)}function Kte(e,t,n,r,i){return qte(qo(),rs(),e,t,n,r,i)}function av(e,t){let n=e[t];return n===Ru?void 0:n}function ov(e,t,n,r,i,a){let o=t+n;return Pp(e,o,i)?Mp(e,o+1,a?r.call(a,i):r(i)):av(e,o+1)}function sv(e,t,n,r,i,a,o){let s=t+n;return Fp(e,s,i,a)?Mp(e,s+2,o?r.call(o,i,a):r(i,a)):av(e,s+2)}function qte(e,t,n,r,i,a,o,s){let c=t+n;return Ip(e,c,i,a,o)?Mp(e,c+3,s?r.call(s,i,a,o):r(i,a,o)):av(e,c+3)}function cv(e,t){let n=Jo(),r,i=e+27;n.firstCreatePass?(r=Jte(t,n.pipeRegistry),n.data[i]=r,r.onDestroy&&(n.destroyHooks??=[]).push(i,r.onDestroy)):r=n.data[i];let a=r.factory||(r.factory=ga(r.type,!0)),o=ia(sm);try{let e=ml(!1),t=a();return ml(e),Do(n,qo(),i,t),t}finally{ia(o)}}function Jte(e,t){if(t)for(let n=t.length-1;n>=0;n--){let r=t[n];if(e===r.name)return r}}function lv(e,t,n){let r=e+27,i=qo(),a=Eo(i,r);return dv(i,r)?ov(i,rs(),t,a.transform,n,a):a.transform(n)}function uv(e,t,n,r){let i=e+27,a=qo(),o=Eo(a,i);return dv(a,i)?sv(a,rs(),t,o.transform,n,r,o):o.transform(n,r)}function dv(e,t){return e[1].data[t].pure}function fv(e,t){return pp(e,t)}var Yte=(()=>{class e{applicationErrorHandler=C(ic);appRef=C(rg);taskService=C(Ls);ngZone=C(Gs);zonelessEnabled=C(hc);tracing=C(id,{optional:!0});zoneIsDefined=typeof Zone<`u`&&!!Zone.root.run;schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}];subscriptions=new pr;angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(Us):null;scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(C(gc,{optional:!0})??!1);cancelScheduledCallback=null;useMicrotaskScheduler=!1;runningTick=!1;pendingRenderTaskId=null;constructor(){this.subscriptions.add(this.appRef.afterTick.subscribe(()=>{let e=this.taskService.add();if(!this.runningTick&&(this.cleanup(),!this.zonelessEnabled||this.appRef.includeAllTestViews)){this.taskService.remove(e);return}this.switchToMicrotaskScheduler(),this.taskService.remove(e)})),this.subscriptions.add(this.ngZone.onUnstable.subscribe(()=>{this.runningTick||this.cleanup()}))}switchToMicrotaskScheduler(){this.ngZone.runOutsideAngular(()=>{let e=this.taskService.add();this.useMicrotaskScheduler=!0,queueMicrotask(()=>{this.useMicrotaskScheduler=!1,this.taskService.remove(e)})})}notify(e){if(!this.zonelessEnabled&&e===5)return;switch(e){case 0:case 2:this.appRef.dirtyFlags|=2;break;case 3:case 4:case 5:case 1:this.appRef.dirtyFlags|=4;break;case 6:this.appRef.dirtyFlags|=2;break;case 12:this.appRef.dirtyFlags|=16;break;case 13:this.appRef.dirtyFlags|=2;break;case 11:break;default:this.appRef.dirtyFlags|=8}if(this.appRef.tracingSnapshot=this.tracing?.snapshot(this.appRef.tracingSnapshot)??null,!this.shouldScheduleTick())return;let t=this.useMicrotaskScheduler?Vs:Bs;this.pendingRenderTaskId=this.taskService.add(),this.cancelScheduledCallback=this.scheduleInRootZone?Zone.root.run(()=>t(()=>this.tick())):this.ngZone.runOutsideAngular(()=>t(()=>this.tick()))}shouldScheduleTick(){return!(this.appRef.destroyed||this.pendingRenderTaskId!==null||this.runningTick||this.appRef._runningTick||!this.zonelessEnabled&&this.zoneIsDefined&&Zone.current.get(`isAngularZone_ID`+this.angularZoneId))}tick(){if(this.runningTick||this.appRef.destroyed)return;if(this.appRef.dirtyFlags===0){this.cleanup();return}!this.zonelessEnabled&&this.appRef.dirtyFlags&7&&(this.appRef.dirtyFlags|=1);let e=this.taskService.add();try{this.ngZone.run(()=>{this.runningTick=!0,this.appRef._tick()},void 0,this.schedulerTickApplyArgs)}catch(e){this.applicationErrorHandler(e)}finally{this.taskService.remove(e),this.cleanup()}}ngOnDestroy(){this.subscriptions.unsubscribe(),this.cleanup()}cleanup(){if(this.runningTick=!1,this.cancelScheduledCallback?.(),this.cancelScheduledCallback=null,this.pendingRenderTaskId!==null){let e=this.pendingRenderTaskId;this.pendingRenderTaskId=null,this.taskService.remove(e)}}static ɵfac=function(t){return new(t||e)};static ɵprov=Vl({token:e,factory:e.ɵfac})}return e})();function Xte(){return[{provide:mc,useExisting:Yte},{provide:Gs,useClass:$s},{provide:hc,useValue:!0}]}function Zte(){return typeof $localize<`u`&&$localize.locale||`en-US`}var pv=new Ii(``,{factory:()=>C(pv,{optional:!0,skipSelf:!0})||Zte()}),mv=class{destroyed=!1;listeners=null;errorHandler=C(rc,{optional:!0});isEmitting=!1;hasNullListeners=!1;destroyRef=C(Ns);constructor(){this.destroyRef.onDestroy(()=>{this.destroyed=!0,this.listeners=null})}subscribe(e){if(this.destroyed)throw new vi(953,!1);return(this.listeners??=[]).push(e),{unsubscribe:()=>{let t=this.listeners?this.listeners.indexOf(e):-1;t>-1&&(this.isEmitting?(this.hasNullListeners=!0,this.listeners[t]=null):this.listeners.splice(t,1))}}}emit(e){if(this.destroyed){console.warn(bi(953,!1));return}if(this.listeners===null)return;this.isEmitting=!0;let t=rn(null);try{for(let t of this.listeners)try{t!==null&&t(e)}catch(e){this.errorHandler?.handleError(e)}}finally{this.hasNullListeners&&(this.hasNullListeners=!1,this.listeners&&Qte(this.listeners)),rn(t),this.isEmitting=!1}}};function Qte(e){let t=e.length-1;for(;t>-1;)e[t]===null&&e.splice(t,1),t--}function X(e,t){return Tn(e,t?.equal)}function Z(e){return Qn(e)}(class e extends Error{_brand;constructor(e){super(e)}static IDLE=new e(`IDLE`);static LOADING=new e(`LOADING`)});var $te=e=>e;function Q(e,t){return typeof e==`function`?hv(Jn(e,$te,t?.equal),t?.debugName,t?.set):hv(Jn(e.source,e.computation,e.equal),e.debugName,e.set)}function hv(e,t,n){let r=e[nn],i=e;if(n!==void 0){let t=e=>Yn(r,e);i.set=e=>n(e,t),i.update=r=>n(r(Z(e)),t)}else i.set=e=>Yn(r,e),i.update=e=>Xn(r,e);return i.asReadonly=oc.bind(e),i}var gv=!1;function ene(){return gv}function _v(e){gv=e}function vv(e,t){let n=Object.create(Ac);n.value=e,n.transformFn=t?.transform;function r(){if(sn(n),n.value===kc)throw new vi(-950,null);return n.value}return r[nn]=n,r}function yv(e){return new mv}function bv(e,t){return vv(e,t)}function tne(e){return vv(kc,e)}var $=(bv.required=tne,bv);function xv(e,t){let n=Object.create(Ac),r=new mv;n.value=e;function i(){return sn(n),Sv(n.value),n.value}return i[nn]=n,i.asReadonly=oc.bind(i),i.set=e=>{n.equal(n.value,e)||(Ln(n,e),r.emit(e))},i.update=e=>{Sv(n.value),i.set(e(n.value))},i.subscribe=r.subscribe.bind(r),i.destroyRef=r.destroyRef,i}function Sv(e){if(e===kc)throw new vi(952,!1)}function Cv(e,t){return xv(e,t)}function nne(e){return xv(kc,e)}var wv=(Cv.required=nne,Cv);function Tv(e,t){return _h(t)}function rne(e,t){return vh(t)}var Ev=(Tv.required=rne,Tv),ine=(()=>{class e{static __NG_ELEMENT_ID__=ane}return e})();function ane(e){return one(Yo(),qo(),(e&16)==16)}function one(e,t,n){if(ho(e)&&!n){let n=Oo(e.index,t);return new up(n,n)}if(e.type&175){let e=t[15];return new up(e,t)}return null}var Dv=new Ii(``),sne=new Ii(``);function Ov(e){return!e.moduleRef}function cne(e){let t=Ov(e)?e.r3Injector:e.moduleRef.injector,n=t.get(Gs);return n.run(()=>{Ov(e)?e.r3Injector.resolveInjectorInitializers():e.moduleRef.resolveInjectorInitializers();let r=t.get(ic),i;if(n.runOutsideAngular(()=>{i=n.onError.subscribe({next:r})}),Ov(e)){let n=()=>t.destroy(),r=e.platformInjector.get(Dv);r.add(n),t.onDestroy(()=>{i.unsubscribe(),r.delete(n)})}else{let t=()=>e.moduleRef.destroy(),n=e.platformInjector.get(Dv);n.add(t),e.moduleRef.onDestroy(()=>{ag(e.allPlatformModules,e.moduleRef),i.unsubscribe(),n.delete(t)})}return une(r,n,()=>{let n=t.get(Ls),r=n.add(),i=t.get(Lh);return i.runInitializers(),i.donePromise.then(()=>{if(Kg(t.get(pv,Gg)||`en-US`),!t.get(sne,!0))return Ov(e)?t.get(rg):(e.allPlatformModules.push(e.moduleRef),e.moduleRef);if(Ov(e)){let n=t.get(rg);return e.rootComponent!==void 0&&n.bootstrap(e.rootComponent),n}return lne?.(e.moduleRef,e.allPlatformModules),e.moduleRef}).finally(()=>void n.remove(r))})})}var lne;function une(e,t,n){try{let r=n();return xh(r)?r.catch(n=>{throw t.runOutsideAngular(()=>e(n)),n}):r}catch(n){throw t.runOutsideAngular(()=>e(n)),n}}var kv=null;function dne(e=[],t){return js.create({name:t,providers:[{provide:Ga,useValue:`platform`},{provide:Dv,useValue:new Set([()=>kv=null])},...e]})}function fne(e=[]){if(kv)return kv;let t=dne(e);return kv=t,tg(),pne(t),t}function pne(e){let t=e.get(lc,null);co(e,()=>{t?.forEach(e=>e())})}function mne(e){let{rootComponent:t,appProviders:n,platformProviders:r,platformRef:i}=e;Gc(Mc.BootstrapApplicationStart);try{let e=i?.injector??fne(r);return cne({r3Injector:new wh({providers:[Xte(),ac,...n||[]],parent:e,debugName:``,runEnvironmentInitializers:!1}).injector,platformInjector:e,rootComponent:t})}catch(e){return Promise.reject(e)}finally{Gc(Mc.BootstrapApplicationEnd)}}function Av(e){return typeof e==`boolean`?e:e!=null&&e!==`false`}var jv=Symbol(`NOT_SET`),Mv=new Set,hne={...zn,kind:`afterRenderEffectPhase`,consumerIsAlwaysLive:!0,consumerAllowSignalWrites:!0,value:jv,cleanup:null,consumerMarkedDirty(){if(this.sequence.impl.executing){if(this.sequence.lastPhase===null||this.sequence.lastPhase(sn(r),r.value),r.signal[nn]=r,r.registerCleanupFn=e=>(r.cleanup??=new Set).add(e),this.nodes[e]=r,this.hooks[e]=e=>r.phaseFn(e)}}afterRun(){super.afterRun(),this.lastPhase=null}destroy(){if(this.onDestroyFns!==null)for(let e of this.onDestroyFns)e();super.destroy();for(let e of this.nodes)if(e)try{for(let t of e.cleanup??Mv)t()}finally{yn(e)}}};function Nv(e,t){let n=t?.injector??C(js),r=n.get(mc),i=n.get(sd),a=n.get(id,null,{optional:!0});i.impl??=n.get(ld);let o=e;typeof o==`function`&&(o={mixedReadWrite:e});let s=n.get(fc,null,{optional:!0}),c=new gne(i.impl,[o.earlyRead,o.write,o.mixedReadWrite,o.read],s?.view,r,n,a?.snapshot(null));return i.impl.register(c),c}var Pv=null;function Fv(){return Pv}function _ne(e){Pv??=e}var vne=class{},Iv=(function(e){return e[e.Format=0]=`Format`,e[e.Standalone=1]=`Standalone`,e})(Iv||{}),Lv=(function(e){return e[e.Narrow=0]=`Narrow`,e[e.Abbreviated=1]=`Abbreviated`,e[e.Wide=2]=`Wide`,e[e.Short=3]=`Short`,e})(Lv||{}),Rv=(function(e){return e[e.Short=0]=`Short`,e[e.Medium=1]=`Medium`,e[e.Long=2]=`Long`,e[e.Full=3]=`Full`,e})(Rv||{}),zv={Decimal:0,Group:1,List:2,PercentSign:3,PlusSign:4,MinusSign:5,Exponential:6,SuperscriptingExponent:7,PerMille:8,Infinity:9,NaN:10,TimeSeparator:11,CurrencyDecimal:12,CurrencyGroup:13};function yne(e){return Vg(e)[Ug.LocaleId]}function bne(e,t,n){let r=Vg(e);return Gv(Gv([r[Ug.DayPeriodsFormat],r[Ug.DayPeriodsStandalone]],t),n)}function xne(e,t,n){let r=Vg(e);return Gv(Gv([r[Ug.DaysFormat],r[Ug.DaysStandalone]],t),n)}function Sne(e,t,n){let r=Vg(e);return Gv(Gv([r[Ug.MonthsFormat],r[Ug.MonthsStandalone]],t),n)}function Cne(e,t){let n=Vg(e)[Ug.Eras];return Gv(n,t)}function Bv(e,t){return Gv(Vg(e)[Ug.DateFormat],t)}function Vv(e,t){return Gv(Vg(e)[Ug.TimeFormat],t)}function Hv(e,t){let n=Vg(e)[Ug.DateTimeFormat];return Gv(n,t)}function Uv(e,t){let n=Vg(e),r=n[Ug.NumberSymbols][t];if(r===void 0){if(t===zv.CurrencyDecimal)return n[Ug.NumberSymbols][zv.Decimal];if(t===zv.CurrencyGroup)return n[Ug.NumberSymbols][zv.Group]}return r}function Wv(e){if(!e[Ug.ExtraData])throw new vi(2303,!1)}function wne(e){let t=Vg(e);return Wv(t),(t[Ug.ExtraData][2]||[]).map(e=>typeof e==`string`?Kv(e):[Kv(e[0]),Kv(e[1])])}function Tne(e,t,n){let r=Vg(e);return Wv(r),Gv(Gv([r[Ug.ExtraData][0],r[Ug.ExtraData][1]],t)||[],n)||[]}function Gv(e,t){for(let n=t;n>-1;n--)if(e[n]!==void 0)return e[n];throw new vi(2304,!1)}function Kv(e){let[t,n]=e.split(`:`);return{hours:+t,minutes:+n}}var Ene=/^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,qv=Object.create(null),Dne=/((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/,One=256;function kne(e,t,n,r){let i=uy(e);Ane(t),t=Yv(n,t)||t;let a=[],o;for(;t;)if(o=Dne.exec(t),o){a=a.concat(o.slice(1));let e=a.pop();if(!e)break;t=e}else{a.push(t);break}let s=i.getTimezoneOffset();r&&(s=sy(r,s),i=ly(i,r));let c=``;return a.forEach(e=>{let t=oy(e);c+=t?t(i,n,s):e===`''`?`'`:e.replace(/(^'|'$)/g,``).replace(/''/g,`'`)}),c}function Ane(e){if(e.length>One)throw new vi(2300,!1)}function Jv(e,t,n){let r=new Date(0);return r.setFullYear(e,t,n),r.setHours(0,0,0),r}function Yv(e,t){let n=yne(e);if(qv[n]??=Object.create(null),qv[n][t])return qv[n][t];let r=``;switch(t){case`shortDate`:r=Bv(e,Rv.Short);break;case`mediumDate`:r=Bv(e,Rv.Medium);break;case`longDate`:r=Bv(e,Rv.Long);break;case`fullDate`:r=Bv(e,Rv.Full);break;case`shortTime`:r=Vv(e,Rv.Short);break;case`mediumTime`:r=Vv(e,Rv.Medium);break;case`longTime`:r=Vv(e,Rv.Long);break;case`fullTime`:r=Vv(e,Rv.Full);break;case`short`:let t=Yv(e,`shortTime`),n=Yv(e,`shortDate`);r=Xv(Hv(e,Rv.Short),[t,n]);break;case`medium`:let i=Yv(e,`mediumTime`),a=Yv(e,`mediumDate`);r=Xv(Hv(e,Rv.Medium),[i,a]);break;case`long`:let o=Yv(e,`longTime`),s=Yv(e,`longDate`);r=Xv(Hv(e,Rv.Long),[o,s]);break;case`full`:let c=Yv(e,`fullTime`),l=Yv(e,`fullDate`);r=Xv(Hv(e,Rv.Full),[c,l])}return r&&(qv[n][t]=r),r}function Xv(e,t){return t&&(e=e.replace(/\{([^}]+)}/g,function(e,n){return Object.hasOwn(t,n)?t[n]:e})),e}function Zv(e,t,n=`-`,r,i){let a=``;(e<0||i&&e<=0)&&(i?e=-e+1:(e=-e,a=n));let o=String(e);for(;o.length0||s>-n)&&(s+=n),e===3)s===0&&n===-12&&(s=12);else if(e===6)return jne(s,t);let c=Uv(o,zv.MinusSign);return Zv(s,t,c,r,i)}}function Mne(e,t){switch(e){case 0:return t.getFullYear();case 1:return t.getMonth();case 2:return t.getDate();case 3:return t.getHours();case 4:return t.getMinutes();case 5:return t.getSeconds();case 6:return t.getMilliseconds();case 7:return t.getDay();default:throw new vi(2301,!1)}}function $v(e,t,n=Iv.Format,r=!1){return function(i,a){return Nne(i,a,e,t,n,r)}}function Nne(e,t,n,r,i,a){switch(n){case 2:return Sne(t,i,r)[e.getMonth()];case 1:return xne(t,i,r)[e.getDay()];case 0:let n=e.getHours(),o=e.getMinutes();if(a){let e=wne(t),a=Tne(t,i,r),s=e.findIndex(e=>{if(Array.isArray(e)){let[t,r]=e,i=n>=t.hours&&o>=t.minutes,a=n0?Math.floor(i/60):Math.ceil(i/60);switch(e){case 0:return(i>=0?`+`:``)+Zv(o,2,a)+Zv(Math.abs(i%60),2,a);case 1:return`GMT`+(i>=0?`+`:``)+Zv(o,1,a);case 2:return`GMT`+(i>=0?`+`:``)+Zv(o,2,a)+`:`+Zv(Math.abs(i%60),2,a);case 3:return r===0?`Z`:(i>=0?`+`:``)+Zv(o,2,a)+`:`+Zv(Math.abs(i%60),2,a);default:throw new vi(2310,!1)}}}var Pne=0,ty=4;function Fne(e){let t=Jv(e,Pne,1).getDay();return Jv(e,0,1+(t<=ty?ty:11)-t)}function ny(e){let t=e.getDay(),n=t===0?-3:ty-t;return Jv(e.getFullYear(),e.getMonth(),e.getDate()+n)}function ry(e,t=!1){return function(n,r){let i;if(t){let e=new Date(n.getFullYear(),n.getMonth(),1).getDay()-1,t=n.getDate();i=1+Math.floor((t+e)/7)}else{let e=ny(n),t=Fne(e.getFullYear()),r=e.getTime()-t.getTime();i=1+Math.round(r/6048e5)}return Zv(i,e,Uv(r,zv.MinusSign))}}function iy(e,t=!1){return function(n,r){return Zv(ny(n).getFullYear(),e,Uv(r,zv.MinusSign),t)}}var ay=Object.create(null);function oy(e){if(ay[e])return ay[e];let t;switch(e){case`G`:case`GG`:case`GGG`:t=$v(3,Lv.Abbreviated);break;case`GGGG`:t=$v(3,Lv.Wide);break;case`GGGGG`:t=$v(3,Lv.Narrow);break;case`y`:t=Qv(0,1,0,!1,!0);break;case`yy`:t=Qv(0,2,0,!0,!0);break;case`yyy`:t=Qv(0,3,0,!1,!0);break;case`yyyy`:t=Qv(0,4,0,!1,!0);break;case`Y`:t=iy(1);break;case`YY`:t=iy(2,!0);break;case`YYY`:t=iy(3);break;case`YYYY`:t=iy(4);break;case`M`:case`L`:t=Qv(1,1,1);break;case`MM`:case`LL`:t=Qv(1,2,1);break;case`MMM`:t=$v(2,Lv.Abbreviated);break;case`MMMM`:t=$v(2,Lv.Wide);break;case`MMMMM`:t=$v(2,Lv.Narrow);break;case`LLL`:t=$v(2,Lv.Abbreviated,Iv.Standalone);break;case`LLLL`:t=$v(2,Lv.Wide,Iv.Standalone);break;case`LLLLL`:t=$v(2,Lv.Narrow,Iv.Standalone);break;case`w`:t=ry(1);break;case`ww`:t=ry(2);break;case`W`:t=ry(1,!0);break;case`d`:t=Qv(2,1);break;case`dd`:t=Qv(2,2);break;case`c`:case`cc`:t=Qv(7,1);break;case`ccc`:t=$v(1,Lv.Abbreviated,Iv.Standalone);break;case`cccc`:t=$v(1,Lv.Wide,Iv.Standalone);break;case`ccccc`:t=$v(1,Lv.Narrow,Iv.Standalone);break;case`cccccc`:t=$v(1,Lv.Short,Iv.Standalone);break;case`E`:case`EE`:case`EEE`:t=$v(1,Lv.Abbreviated);break;case`EEEE`:t=$v(1,Lv.Wide);break;case`EEEEE`:t=$v(1,Lv.Narrow);break;case`EEEEEE`:t=$v(1,Lv.Short);break;case`a`:case`aa`:case`aaa`:t=$v(0,Lv.Abbreviated);break;case`aaaa`:t=$v(0,Lv.Wide);break;case`aaaaa`:t=$v(0,Lv.Narrow);break;case`b`:case`bb`:case`bbb`:t=$v(0,Lv.Abbreviated,Iv.Standalone,!0);break;case`bbbb`:t=$v(0,Lv.Wide,Iv.Standalone,!0);break;case`bbbbb`:t=$v(0,Lv.Narrow,Iv.Standalone,!0);break;case`B`:case`BB`:case`BBB`:t=$v(0,Lv.Abbreviated,Iv.Format,!0);break;case`BBBB`:t=$v(0,Lv.Wide,Iv.Format,!0);break;case`BBBBB`:t=$v(0,Lv.Narrow,Iv.Format,!0);break;case`h`:t=Qv(3,1,-12);break;case`hh`:t=Qv(3,2,-12);break;case`H`:t=Qv(3,1);break;case`HH`:t=Qv(3,2);break;case`m`:t=Qv(4,1);break;case`mm`:t=Qv(4,2);break;case`s`:t=Qv(5,1);break;case`ss`:t=Qv(5,2);break;case`S`:t=Qv(6,1);break;case`SS`:t=Qv(6,2);break;case`SSS`:t=Qv(6,3);break;case`Z`:case`ZZ`:case`ZZZ`:t=ey(0);break;case`ZZZZZ`:t=ey(3);break;case`O`:case`OO`:case`OOO`:case`z`:case`zz`:case`zzz`:t=ey(1);break;case`OOOO`:case`ZZZZ`:case`zzzz`:t=ey(2);break;default:return null}return ay[e]=t,t}function sy(e,t){e=e.replace(/:/g,``);let n=Date.parse(`Jan 01, 1970 00:00:00 `+e)/6e4;return isNaN(n)?t:n}function cy(e,t){return e=new Date(e.getTime()),e.setMinutes(e.getMinutes()+t),e}function ly(e,t,n){let r=e.getTimezoneOffset();return cy(e,-1*(sy(t,r)-r))}function uy(e){if(fy(e))return e;if(typeof e==`number`&&!isNaN(e))return new Date(e);if(typeof e==`string`){if(e=e.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(e)){let[t,n=1,r=1]=e.split(`-`).map(e=>+e);return Jv(t,n-1,r)}let t=parseFloat(e);if(!isNaN(e-t))return new Date(t);let n;if(n=e.match(Ene))return dy(n)}let t=new Date(e);if(!fy(t))throw new vi(2311,!1);return t}function dy(e){let t=new Date(0),n=0,r=0,i=e[8]?t.setUTCFullYear:t.setFullYear,a=e[8]?t.setUTCHours:t.setHours;e[9]&&(n=Number(e[9]+e[10]),r=Number(e[9]+e[11])),i.call(t,Number(e[1]),Number(e[2])-1,Number(e[3]));let o=Number(e[4]||0)-n,s=Number(e[5]||0)-r,c=Number(e[6]||0),l=Math.floor(parseFloat(`0.`+(e[7]||0))*1e3);return a.call(t,o,s,c,l),t}function fy(e){return e instanceof Date&&!isNaN(e.valueOf())}var py=(()=>{class e{_viewContainerRef;_viewRef=null;ngTemplateOutletContext=null;ngTemplateOutlet=null;ngTemplateOutletInjector=null;injector=C(js);constructor(e){this._viewContainerRef=e}ngOnChanges(e){if(this._shouldRecreateView(e)){let e=this._viewContainerRef;if(this._viewRef&&e.remove(e.indexOf(this._viewRef)),!this.ngTemplateOutlet){this._viewRef=null;return}let t=this._createContextForwardProxy();this._viewRef=e.createEmbeddedView(this.ngTemplateOutlet,t,{injector:this._getInjector()})}}_getInjector(){return this.ngTemplateOutletInjector===`outlet`?this.injector:this.ngTemplateOutletInjector??void 0}_shouldRecreateView(e){return!!e.ngTemplateOutlet||!!e.ngTemplateOutletInjector}_createContextForwardProxy(){return new Proxy({},{set:(e,t,n)=>this.ngTemplateOutletContext?Reflect.set(this.ngTemplateOutletContext,t,n):!1,get:(e,t,n)=>{if(this.ngTemplateOutletContext)return Reflect.get(this.ngTemplateOutletContext,t,n)}})}static ɵfac=function(t){return new(t||e)(sm(Vm))};static ɵdir=Ah({type:e,selectors:[[``,`ngTemplateOutlet`,``]],inputs:{ngTemplateOutletContext:`ngTemplateOutletContext`,ngTemplateOutlet:`ngTemplateOutlet`,ngTemplateOutletInjector:`ngTemplateOutletInjector`},features:[Ic]})}return e})();function my(e,t){return new vi(2100,!1)}var hy=`mediumDate`,gy=new Ii(``),_y=new Ii(``),vy=(()=>{class e{locale;defaultTimezone;defaultOptions;constructor(e,t,n){this.locale=e,this.defaultTimezone=t,this.defaultOptions=n}transform(t,n,r,i){if(t==null||t===``||t!==t)return null;try{let e=n??this.defaultOptions?.dateFormat??hy,a=r??this.defaultOptions?.timezone??this.defaultTimezone??void 0;return kne(t,e,i||this.locale,a)}catch(t){throw my(e,t.message)}}static ɵfac=function(t){return new(t||e)(sm(pv,16),sm(gy,24),sm(_y,24))};static ɵpipe=jh({name:`date`,type:e,pure:!0})}return e})(),yy=(()=>{class e{transform(e){return JSON.stringify(e,null,2)}static ɵfac=function(t){return new(t||e)};static ɵpipe=jh({name:`json`,type:e,pure:!1})}return e})();function by(e,t){t=encodeURIComponent(t);for(let n of e.split(`;`)){let e=n.indexOf(`=`),[r,i]=e==-1?[n,``]:[n.slice(0,e),n.slice(e+1)];if(r.trim()!==t)continue;let a=i;try{a=decodeURIComponent(i)}catch{}return a.length>1&&a[0]===`"`&&a[a.length-1]===`"`&&(a=a.slice(1,-1)),a}return null}var xy=`browser`,Sy=class{_doc;constructor(e){this._doc=e}manager},Cy=(()=>{class e extends Sy{constructor(e){super(e)}supports(e){return!0}addEventListener(e,t,n,r){return e.addEventListener(t,n,r),()=>this.removeEventListener(e,t,n,r)}removeEventListener(e,t,n,r){return e.removeEventListener(t,n,r)}static ɵfac=function(t){return new(t||e)(da(Ms))};static ɵprov=ki({token:e,factory:e.ɵfac})}return e})(),wy=new Ii(``),Ty=(()=>{class e{_zone;_plugins;_eventNameToPlugin=new Map;constructor(e,t){this._zone=t,e.forEach(e=>{e.manager=this});let n=e.filter(e=>!(e instanceof Cy));this._plugins=n.slice().reverse();let r=e.find(e=>e instanceof Cy);r&&this._plugins.push(r)}addEventListener(e,t,n,r){return this._findPluginFor(t).addEventListener(e,t,n,r)}getZone(){return this._zone}_findPluginFor(e){let t=this._eventNameToPlugin.get(e);if(t)return t;if(t=this._plugins.find(t=>t.supports(e)),!t)throw new vi(-5101,!1);return this._eventNameToPlugin.set(e,t),t}static ɵfac=function(t){return new(t||e)(da(wy),da(Gs))};static ɵprov=ki({token:e,factory:e.ɵfac})}return e})(),Ey=`ng-app-id`;function Dy(e){for(let t of e)t.remove()}function Oy(e,t){let n=t.createElement(`style`);return n.textContent=e,n}function ky(e,t,n,r){let i=e.head?.querySelectorAll(`style[${Ey}="${t}"],link[${Ey}="${t}"]`);if(!i||i.length===0)return!1;for(let e of i)e.removeAttribute(Ey),e instanceof HTMLLinkElement?r.set(e.href.slice(e.href.lastIndexOf(`/`)+1),{usage:0,elements:[e]}):e.textContent&&n.set(e.textContent,{usage:0,elements:[e]});return!0}function Ay(e,t){let n=t.createElement(`link`);return n.setAttribute(`rel`,`stylesheet`),n.setAttribute(`href`,e),n}var jy=(()=>{class e{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;constructor(e,t,n,r={}){this.doc=e,this.appId=t,this.nonce=n,ky(e,t,this.inline,this.external)&&this.hosts.add(e.head)}addStyles(e,t){for(let t of e)this.addUsage(t,this.inline,Oy);t?.forEach(e=>this.addUsage(e,this.external,Ay))}removeStyles(e,t){for(let t of e)this.removeUsage(t,this.inline);t?.forEach(e=>this.removeUsage(e,this.external))}addUsage(e,t,n){let r=t.get(e);r?r.usage++:t.set(e,{usage:1,elements:[...this.hosts].map(t=>this.addElement(t,n(e,this.doc)))})}removeUsage(e,t){let n=t.get(e);n&&(n.usage--,n.usage<=0&&(Dy(n.elements),t.delete(e)))}ngOnDestroy(){for(let[,{elements:e}]of[...this.inline,...this.external])Dy(e);this.hosts.clear()}addHost(e){if(!this.hosts.has(e)){this.hosts.add(e);for(let[t,{elements:n}]of this.inline)n.push(this.addElement(e,Oy(t,this.doc)));for(let[t,{elements:n}]of this.external)n.push(this.addElement(e,Ay(t,this.doc)))}}removeHost(e){this.hosts.delete(e);for(let t of[...this.inline.values(),...this.external.values()]){let n=[];for(let r of t.elements)r.parentNode===e?r.remove():n.push(r);t.elements=n}}addElement(e,t){return this.nonce&&t.setAttribute(`nonce`,this.nonce),e.appendChild(t)}static ɵfac=function(t){return new(t||e)(da(Ms),da(sc),da(dc,8),da(uc))};static ɵprov=ki({token:e,factory:e.ɵfac})}return e})(),My={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`,math:`http://www.w3.org/1998/Math/MathML`},Ny=/%COMP%/g,Py=`%COMP%`,Fy=`_nghost-${Py}`,Iy=`_ngcontent-${Py}`,Ly=!0,Ry=new Ii(``,{factory:()=>Ly}),zy=new Ii(``);function By(e){return Iy.replace(Ny,e)}function Vy(e){return Fy.replace(Ny,e)}function Hy(e,t){return t.map(t=>t.replace(Ny,e))}var Uy=(()=>{class e{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;cssVarNamespace;constructor(e,t,n,r,i,a,o=null,s=null,c=null){this.eventManager=e,this.sharedStylesHost=t,this.appId=n,this.removeStylesOnCompDestroy=r,this.doc=i,this.ngZone=a,this.nonce=o,this.tracingService=s,this.cssVarNamespace=c??``,this.defaultRenderer=new Wy(e,i,a,this.tracingService,this.cssVarNamespace)}createRenderer(e,t){if(!e||!t)return this.defaultRenderer;let n=this.getOrCreateRenderer(e,t);return n instanceof Jy?n.applyToHost(e):n instanceof qy&&n.applyStyles(),n}getOrCreateRenderer(e,t){let n=this.rendererByCompId,r=n.get(t.id);if(!r){let i=this.doc,a=this.ngZone,o=this.eventManager,s=this.sharedStylesHost,c=this.removeStylesOnCompDestroy,l=this.tracingService;switch(t.encapsulation){case yu.Emulated:r=new Jy(o,s,t,this.appId,c,i,a,l,this.cssVarNamespace);break;case yu.ShadowDom:return new Ky(o,e,t,i,a,this.nonce,l,this.cssVarNamespace,s);case yu.ExperimentalIsolatedShadowDom:return new Ky(o,e,t,i,a,this.nonce,l,this.cssVarNamespace);default:r=new qy(o,s,t,c,i,a,l,this.cssVarNamespace)}n.set(t.id,r)}return r}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(e){this.rendererByCompId.delete(e)}static ɵfac=function(t){return new(t||e)(da(Ty),da(am),da(sc),da(Ry),da(Ms),da(Gs),da(dc),da(id,8),da(zy,8))};static ɵprov=ki({token:e,factory:e.ɵfac})}return e})(),Wy=class{eventManager;doc;ngZone;tracingService;cssVarNamespace;data=Object.create(null);throwOnSyntheticProps=!0;constructor(e,t,n,r,i=``){this.eventManager=e,this.doc=t,this.ngZone=n,this.tracingService=r,this.cssVarNamespace=i}destroy(){}destroyNode=null;createElement(e,t){return t?this.doc.createElementNS(My[t]||t,e):this.doc.createElement(e)}createComment(e){return this.doc.createComment(e)}createText(e){return this.doc.createTextNode(e)}appendChild(e,t){(Gy(e)?e.content:e).appendChild(t)}insertBefore(e,t,n){if(e){let r=Gy(e)?e.content:e;if(n!=null&&n.parentNode!==r)throw new vi(-5106,!1);r.insertBefore(t,n)}}removeChild(e,t){t.remove()}selectRootElement(e,t){let n=typeof e==`string`?this.doc.querySelector(e):e;if(!n)throw new vi(-5104,!1);return t||(n.textContent=``),n}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,n,r){if(r){t=r+`:`+t;let i=My[r];i?e.setAttributeNS(i,t,n):e.setAttribute(t,n)}else e.setAttribute(t,n)}removeAttribute(e,t,n){if(n){let r=My[n];r?e.removeAttributeNS(r,t):e.removeAttribute(`${n}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,n,r){let i=t.startsWith(`--`);i&&(t=t.replace(`%NS%`,this.cssVarNamespace)),i||r&(zu.DashCase|zu.Important)?e.style.setProperty(t,n,r&zu.Important?`important`:``):e.style[t]=n}removeStyle(e,t,n){let r=t.startsWith(`--`);r&&(t=t.replace(`%NS%`,this.cssVarNamespace)),r||n&zu.DashCase?e.style.removeProperty(t):e.style[t]=``}setProperty(e,t,n){e!=null&&(e[t]=n)}setValue(e,t){e.nodeValue=t}listen(e,t,n,r){if(typeof e==`string`&&(e=Fv().getGlobalEventTarget(this.doc,e),!e))throw new vi(-5102,!1);let i=this.decoratePreventDefault(n);return this.tracingService?.wrapEventListener&&(i=this.tracingService.wrapEventListener(e,t,i)),this.eventManager.addEventListener(e,t,i,r)}decoratePreventDefault(e){return t=>{if(t===`__ngUnwrap__`)return e;e(t)===!1&&t.preventDefault()}}};function Gy(e){return e.tagName===`TEMPLATE`&&e.content!==void 0}var Ky=class extends Wy{hostEl;sharedStylesHost;shadowRoot;constructor(e,t,n,r,i,a,o,s,c){super(e,r,i,o,s),this.hostEl=t,this.sharedStylesHost=c,this.shadowRoot=t.attachShadow({mode:`open`}),this.sharedStylesHost&&this.sharedStylesHost.addHost(this.shadowRoot);let l=n.styles;l=Hy(n.id,l).map(e=>e.replace(/%NS%/g,s));for(let e of l){let t=document.createElement(`style`);a&&t.setAttribute(`nonce`,a),t.textContent=e,this.shadowRoot.appendChild(t)}let u=n.getExternalStyles?.();if(u)for(let e of u){let t=Ay(e,r);a&&t.setAttribute(`nonce`,a),this.shadowRoot.appendChild(t)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}appendChild(e,t){return super.appendChild(this.nodeOrShadowRoot(e),t)}insertBefore(e,t,n){return super.insertBefore(this.nodeOrShadowRoot(e),t,n)}removeChild(e,t){return super.removeChild(null,t)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}destroy(){this.sharedStylesHost&&this.sharedStylesHost.removeHost(this.shadowRoot)}},qy=class extends Wy{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(e,t,n,r,i,a,o,s,c){super(e,i,a,o,s),this.sharedStylesHost=t,this.removeStylesOnCompDestroy=r;let l=n.styles,u=c?Hy(c,l):l;this.styles=u.map(e=>e.replace(/%NS%/g,s)),this.styleUrls=n.getExternalStyles?.(c)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&Ku.size===0&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},Jy=class extends qy{contentAttr;hostAttr;constructor(e,t,n,r,i,a,o,s,c){let l=r+`-`+n.id;super(e,t,n,i,a,o,s,c,l),this.contentAttr=By(l),this.hostAttr=Vy(l)}applyToHost(e){this.applyStyles(),this.setAttribute(e,this.hostAttr,``)}createElement(e,t){let n=super.createElement(e,t);return super.setAttribute(n,this.contentAttr,``),n}},Yy=class e extends vne{supportsDOMEvents=!0;static makeCurrent(){_ne(new e)}onAndCancel(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.remove()}createElement(e,t){return t||=this.getDefaultDocument(),t.createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument(`fakeTitle`)}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return t===`window`?window:t===`document`?e:t===`body`?e.body:null}getBaseHref(e){let t=Zy();return t==null?null:Qy(t)}resetBaseElement(){Xy=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return by(document.cookie,e)}},Xy=null;function Zy(){return Xy||=document.head.querySelector(`base`),Xy?Xy.getAttribute(`href`):null}function Qy(e){return new URL(e,document.baseURI).pathname}var $y=[`alt`,`control`,`meta`,`shift`],eb={"\b":`Backspace`," ":`Tab`,"":`Delete`,"\x1B":`Escape`,Del:`Delete`,Esc:`Escape`,Left:`ArrowLeft`,Right:`ArrowRight`,Up:`ArrowUp`,Down:`ArrowDown`,Menu:`ContextMenu`,Scroll:`ScrollLock`,Win:`OS`},tb={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey},nb=(()=>{class e extends Sy{constructor(e){super(e)}supports(t){return e.parseEventName(t)!=null}addEventListener(t,n,r,i){let a=e.parseEventName(n),o=e.eventCallback(a.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Fv().onAndCancel(t,a.domEventName,o,i))}static parseEventName(t){let n=t.toLowerCase().split(`.`),r=n.shift();if(n.length===0||r!==`keydown`&&r!==`keyup`)return null;let i=e._normalizeKey(n.pop()),a=``,o=n.indexOf(`code`);if(o>-1&&(n.splice(o,1),a=`code.`),$y.forEach(e=>{let t=n.indexOf(e);t>-1&&(n.splice(t,1),a+=e+`.`)}),a+=i,n.length!=0||i.length===0)return null;let s={};return s.domEventName=r,s.fullKey=a,s}static matchEventFullKeyCode(e,t){let n=eb[e.key]||e.key,r=``;return t.indexOf(`code.`)>-1&&(n=e.code,r=`code.`),n==null||!n?!1:(n=n.toLowerCase(),n===` `?n=`space`:n===`.`&&(n=`dot`),$y.forEach(t=>{if(t!==n){let n=tb[t];n(e)&&(r+=t+`.`)}}),r+=n,r===t)}static eventCallback(t,n,r){return i=>{e.matchEventFullKeyCode(i,t)&&r.runGuarded(()=>n(i))}}static _normalizeKey(e){return e===`esc`?`escape`:e}static ɵfac=function(t){return new(t||e)(da(Ms))};static ɵprov=ki({token:e,factory:e.ɵfac})}return e})();async function rb(e,t,n){return mne({rootComponent:e,...ib(t,n)})}function ib(e,t){return{platformRef:t?.platformRef,appProviders:[...lb,...e?.providers??[]],platformProviders:cb}}function ab(){Yy.makeCurrent()}function ob(){return new rc}function sb(){return su(document),document}var cb=[{provide:uc,useValue:xy},{provide:lc,useValue:ab,multi:!0},{provide:Ms,useFactory:sb}],lb=[{provide:Ga,useValue:`root`},{provide:rc,useFactory:ob},{provide:wy,useClass:Cy,multi:!0},{provide:wy,useClass:nb,multi:!0},Uy,{provide:am,useClass:jy},{provide:jy,useExisting:am},Ty,{provide:Tp,useExisting:Uy},[]];function ub(e,t){let n=`\x1B[${e}m`,r=`\x1B[${t}m`;return((e,...t)=>{if(Array.isArray(e)&&`raw`in e){let i=e,a=``;for(let e=0;e{let r=new mb({code:i,why:fb(a.why,e),fix:fb(a.fix,e),docs:o,cause:e.cause,sources:e.sources,data:fb(a.data,e)},s);for(let e of t)e(r,n);return r};n[i]=s}return n}function _b(e){return t=>{let n=`${e.bold(e.red(`[${t.name}]`))} ${t.message}`,r=[];return t.fix&&r.push(`${e.dim(`fix:`)} ${t.fix}`),t.sources?.length&&r.push(`${e.dim(`sources:`)} ${t.sources.join(`, `)}`),t.docs&&r.push(`${e.dim(`see:`)} ${e.cyan(t.docs)}`),r.length===0?n:[n,...r.map((t,n)=>`${e.dim(n{e=n,t=r}),resolve:e,reject:t}}var Cb=Math.random.bind(Math),wb=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function Tb(e=21){let t=``,n=e;for(;n--;)t+=wb[Cb()*64|0];return t}var Eb=6e4,Db=e=>e,Ob=Db,{clearTimeout:kb,setTimeout:Ab}=globalThis;function jb(e,t){let{post:n,on:r,off:i=()=>{},eventNames:a=[],serialize:o=Db,deserialize:s=Ob,resolver:c,bind:l=`rpc`,timeout:u=Eb,proxify:d=!0}=t,f=!1,p=new Map,m,h;async function g(e,r,i,a){if(f)throw Error(`[birpc] rpc is closed, cannot call "${e}"`);let s={m:e,a:r,t:`q`};a&&(s.o=!0);let c=async e=>n(o(e));if(i){await c(s);return}if(m)try{await m}finally{m=void 0}let{promise:l,resolve:d,reject:g}=Sb(),_=Tb();s.i=_;let ee;async function te(n=s){return u>=0&&(ee=Ab(()=>{try{if(t.onTimeoutError?.call(h,e,r)!==!0)throw Error(`[birpc] timeout on calling "${e}"`)}catch(e){g(e)}p.delete(_)},u),typeof ee==`object`&&(ee=ee.unref?.())),p.set(_,{resolve:d,reject:g,timeoutId:ee,method:e}),await c(n),l}try{t.onRequest?await t.onRequest.call(h,s,te,d):await te()}catch(e){if(t.onGeneralError?.call(h,e)!==!0)throw e;return}finally{kb(ee),p.delete(_)}return l}let _={$call:(e,...t)=>g(e,t,!1),$callOptional:(e,...t)=>g(e,t,!1,!0),$callEvent:(e,...t)=>g(e,t,!0),$callRaw:e=>g(e.method,e.args,e.event,e.optional),$rejectPendingCalls:te,get $closed(){return f},get $meta(){return t.meta},$close:ee,$functions:e};h=d?new Proxy({},{get(t,n){if(Object.hasOwn(_,n))return _[n];if(n===`then`&&!a.includes(`then`)&&!(`then`in e))return;let r=(...e)=>g(n,e,!0);if(a.includes(n))return r.asEvent=r,r;let i=(...e)=>g(n,e,!1);return i.asEvent=r,i}}):_;function ee(e){f=!0,p.forEach(({reject:t,method:n})=>{let r=Error(`[birpc] rpc is closed, cannot call "${n}"`);if(e)return e.cause??=r,t(e);t(r)}),p.clear(),i(ne)}function te(e){let t=Array.from(p.values()).map(({method:t,reject:n})=>e?e({method:t,reject:n}):n(Error(`[birpc]: rejected pending call "${t}".`)));return p.clear(),t}async function ne(r,...i){let a;try{a=s(r)}catch(e){if(t.onGeneralError?.call(h,e)!==!0)throw e;return}if(a.t===`q`){let{m:r,a:s,o:u}=a,d,f,p=await(c?c.call(h,r,e[r]):e[r]);if(u&&(p||=()=>void 0),!p)f=Error(`[birpc] function "${r}" not found`);else try{d=await p.apply(l===`rpc`?h:e,s)}catch(e){f=e}if(a.i){if(f&&t.onFunctionError&&t.onFunctionError.call(h,f,r,s)===!0)return;if(!f)try{await n(o({t:`s`,i:a.i,r:d}),...i);return}catch(e){if(f=e,t.onGeneralError?.call(h,e,r,s)!==!0)throw e}try{await n(o({t:`s`,i:a.i,e:f}),...i)}catch(e){if(t.onGeneralError?.call(h,e,r,s)!==!0)throw e}}}else{let{i:e,r:t,e:n}=a,r=p.get(e);r&&(kb(r.timeoutId),n?r.reject(n):r.resolve(t)),p.delete(e)}}return m=r(ne),h}function Mb(e,t){return t.safety?t.safety:e===`static`||e===`query`||e==null?`read`:`action`}var Nb=Object.freeze({type:`object`,additionalProperties:!0});function Pb(e){let t=e[`~standard`];if(t.jsonSchema)try{return t.jsonSchema.input({target:`draft-2020-12`})}catch{return Nb}return Nb}function Fb(e){if(!e||e.length===0)return{type:`object`,properties:{}};let t={},n=[];for(let r=0;rn[`arg${t}`]);if(`arg0`in n){let e=[];for(;`arg${e.length}`in n;)e.push(n[`arg${e.length}`]);return e}return Object.keys(n).length===0?[]:void 0}function Lb(e,t){return Ib(e,t)??[e]}function Rb(e){return typeof e==`string`?`'${e}'`:new Hb().serialize(e)}var zb=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,Bb=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[zb.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function Vb(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;ia?-1:1)}return e.length===t.length?r:e.lengththis.compare(e[0],t[0])),r=`${e}{`;for(let e=0;ethis.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`,`)}]`};for(let t of[`BigInt64Array`,`BigUint64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`n,`)}${e.length>0?`n`:``}]`};return e})(),Ub=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],Wb=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],Gb=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`,Kb=[],qb=class{_data=new Jb;_hash=new Jb([...Ub]);_nDataBytes=0;_minBufferSize=0;finalize(e){e&&this._append(e);let t=this._nDataBytes*8,n=this._data.sigBytes*8;return this._data.words[n>>>5]|=128<<24-n%32,this._data.words[(n+64>>>9<<4)+14]=Math.floor(t/4294967296),this._data.words[(n+64>>>9<<4)+15]=t,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(e,t){let n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7];for(let n=0;n<64;n++){if(n<16)Kb[n]=e[t+n]|0;else{let e=Kb[n-15],t=(e<<25|e>>>7)^(e<<14|e>>>18)^e>>>3,r=Kb[n-2],i=(r<<15|r>>>17)^(r<<13|r>>>19)^r>>>10;Kb[n]=t+Kb[n-7]+i+Kb[n-16]}let d=s&c^~s&l,f=r&i^r&a^i&a,p=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),m=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),h=u+m+d+Wb[n]+Kb[n],g=p+f;u=l,l=c,c=s,s=o+h|0,o=a,a=i,i=r,r=h+g|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+o|0,n[4]=n[4]+s|0,n[5]=n[5]+c|0,n[6]=n[6]+l|0,n[7]=n[7]+u|0}_append(e){typeof e==`string`&&(e=Jb.fromUtf8(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_process(e){let t,n=this._data.sigBytes/64;n=e?Math.ceil(n):Math.max((n|0)-this._minBufferSize,0);let r=n*16,i=Math.min(r*4,this._data.sigBytes);if(r){for(let e=0;e>>2]|=(n.charCodeAt(e)&255)<<24-e%4*8;return new e(i,r)}toBase64(){let e=[];for(let t=0;t>>2]>>>24-t%4*8&255,r=this.words[t+1>>>2]>>>24-(t+1)%4*8&255,i=this.words[t+2>>>2]>>>24-(t+2)%4*8&255,a=n<<16|r<<8|i;for(let n=0;n<4&&t*8+n*6>>6*(3-n)&63))}return e.join(``)}concat(e){if(this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4),this.sigBytes%4)for(let t=0;t>>2]>>>24-t%4*8&255;this.words[this.sigBytes+t>>>2]|=n<<24-(this.sigBytes+t)%4*8}else for(let t=0;t>>2]=e.words[t>>>2];this.sigBytes+=e.sigBytes}};function Yb(e){return new qb().finalize(e).toBase64()}function Xb(e){return Yb(Rb(e))}function Zb(e){return Xb(e)}function Qb(){let e={};function t(t,...n){let r=e[t]||[];for(let e=0,t=r.length;e{e[t]=e[t]?.filter(e=>n!==e)}}function i(e,t){let n=r(e,((...e)=>(n(),t(...e))));return n}return{_listeners:e,emit:t,emitOnce:n,on:r,once:i}}var $b=/^[\w+.-]{2,}:\/\//;function ex(e){return e.endsWith(`/`)?e:`${e}/`}function tx(e){return(e.endsWith(`/`)?e.slice(0,-1):e)||`/`}function nx(e,...t){let n=e;for(let e of t)e&&e!==`/`&&(n=n?ex(n)+e.replace(/^\.?\//,``):e);return n}function rx(e,t){if(!t||t===`/`||$b.test(e))return e;let n=tx(t);return e.startsWith(n)?e:nx(n,e)}function ix(e,t){let n=e.match($b);return t+(n?e.slice(n[0].length):e)}var ax=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function ox(e=21){let t=``,n=e;for(;n--;)t+=ax[Math.random()*64|0];return t}var sx=Symbol.for(`immer-nothing`),cx=Symbol.for(`immer-draftable`),lx=Symbol.for(`immer-state`),ux=[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},`This object has been frozen and should not be mutated`,function(e){return`Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? `+e},`An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.`,`Immer forbids circular references`,"The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},`Object.defineProperty() cannot be used on an Immer draft`,`Object.setPrototypeOf() cannot be used on an Immer draft`,`Immer only supports deleting array indices`,`Immer only supports setting array indices and the 'length' property`,function(e){return`'original' expects a draft, got: ${e}`}];function dx(e,...t){{let n=ux[e],r=Fx(n)?n.apply(null,t):n;throw Error(`[Immer] ${r}`)}}var fx=Object,px=fx.getPrototypeOf,mx=`constructor`,hx=`prototype`,gx=`configurable`,_x=`enumerable`,vx=`writable`,yx=`value`,bx=e=>!!e&&!!e[lx];function xx(e){return e?wx(e)||jx(e)||!!e[cx]||!!e[mx]?.[cx]||Mx(e)||Nx(e):!1}var Sx=fx[hx][mx].toString(),Cx=new WeakMap;function wx(e){if(!e||!Px(e))return!1;let t=px(e);if(t===null||t===fx[hx])return!0;let n=fx.hasOwnProperty.call(t,mx)&&t[mx];if(n===Object)return!0;if(!Fx(n))return!1;let r=Cx.get(n);return r===void 0&&(r=Function.toString.call(n),Cx.set(n,r)),r===Sx}function Tx(e,t,n=!0){Ex(e)===0?(n?Reflect.ownKeys(e):fx.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Ex(e){let t=e[lx];return t?t.type_:jx(e)?1:Mx(e)?2:Nx(e)?3:0}var Dx=(e,t,n=Ex(e))=>n===2?e.has(t):fx[hx].hasOwnProperty.call(e,t),Ox=(e,t,n=Ex(e))=>n===2?e.get(t):e[t],kx=(e,t,n,r=Ex(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Ax(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var jx=Array.isArray,Mx=e=>e instanceof Map,Nx=e=>e instanceof Set,Px=e=>typeof e==`object`,Fx=e=>typeof e==`function`,Ix=e=>typeof e==`boolean`;function Lx(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var Rx=e=>Px(e)?e?.[lx]:null,zx=e=>e.copy_||e.base_,Bx=e=>e.modified_?e.copy_:e.base_;function Vx(e,t){if(Mx(e))return new Map(e);if(Nx(e))return new Set(e);if(jx(e))return Array[hx].slice.call(e);let n=wx(e);if(t===!0||t===`class_only`&&!n){let t=fx.getOwnPropertyDescriptors(e);delete t[lx];let n=Reflect.ownKeys(t);for(let r=0;r1&&fx.defineProperties(e,{set:Wx,add:Wx,clear:Wx,delete:Wx}),fx.freeze(e),t&&Tx(e,(e,t)=>{Hx(t,!0)},!1),e)}function Ux(){dx(2)}var Wx={[yx]:Ux};function Gx(e){return e===null||!Px(e)||fx.isFrozen(e)}var Kx=`MapSet`,qx=`Patches`,Jx=`ArrayMethods`,Yx={};function Xx(e){let t=Yx[e];return t||dx(0,e),t}var Zx=e=>!!Yx[e];function Qx(e,t){Yx[e]||(Yx[e]=t)}var $x,eS=()=>$x,tS=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Zx(Kx)?Xx(Kx):void 0,arrayMethodsPlugin_:Zx(Jx)?Xx(Jx):void 0});function nS(e,t){t&&(e.patchPlugin_=Xx(qx),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function rS(e){iS(e),e.drafts_.forEach(oS),e.drafts_=null}function iS(e){e===$x&&($x=e.parent_)}var aS=e=>$x=tS($x,e);function oS(e){let t=e[lx];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function sS(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[lx].modified_&&(rS(t),dx(4)),xx(e)&&(e=cS(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[lx].base_,e,t)}else e=cS(t,n);return lS(t,e,!0),rS(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===sx?void 0:e}function cS(e,t){if(Gx(t))return t;let n=t[lx];if(!n)return _S(t,e.handledSet_,e);if(!dS(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);hS(n,e)}return n.copy_}function lS(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Hx(t,n)}function uS(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var dS=(e,t)=>e.scope_===t,fS=[];function pS(e,t,n,r){let i=zx(e),a=e.type_;if(r!==void 0&&Ox(i,r,a)===t){kx(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;Tx(i,(e,n)=>{if(bx(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??fS;for(let e of o)kx(i,e,n,a)}function mS(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!dS(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=Bx(i);pS(e,i.draft_??i,a,n),hS(i,r)})}function hS(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}uS(e)}}function gS(e,t,n){let{scope_:r}=e;if(bx(n)){let i=n[lx];dS(i,r)&&i.callbacks_.push(function(){ES(e),pS(e,n,Bx(i),t)})}else xx(n)&&e.callbacks_.push(function(){let i=zx(e);e.type_===3?i.has(n)&&_S(n,r.handledSet_,r):Ox(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&_S(Ox(e.copy_,t,e.type_),r.handledSet_,r)})}function _S(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||bx(e)||t.has(e)||!xx(e)||Gx(e)?e:(t.add(e),Tx(e,(r,i)=>{if(bx(i)){let t=i[lx];dS(t,n)&&(kx(e,r,Bx(t),e.type_),uS(t))}else xx(i)&&_S(i,t,n)}),e)}function vS(e,t){let n=jx(e),r={type_:+!!n,scope_:t?t.scope_:eS(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=yS;n&&(i=[r],a=bS);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var yS={get(e,t){if(t===lx)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=zx(e);if(!Dx(i,t,e.type_))return CS(e,i,t);let a=i[t];if(e.finalized_||!xx(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Lx(t))return a;if(a===xS(e.base_,t)||SS(e,t,a)){ES(e);let n=e.type_===1?+t:t,r=OS(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in zx(e)},ownKeys(e){return Reflect.ownKeys(zx(e))},set(e,t,n){let r=wS(zx(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=xS(zx(e),t),i=r?.[lx];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.delete(t),!0;if(Ax(n,r)&&(n!==void 0||Dx(e.base_,t,e.type_)))return!0;ES(e),TS(e)}return e.copy_[t]===n&&(n!==void 0||Dx(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),gS(e,t,n),!0)},deleteProperty(e,t){return ES(e),xS(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),TS(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=zx(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[vx]:!0,[gx]:e.type_!==1||t!==`length`,[_x]:r[_x],[yx]:n[t]}},defineProperty(){dx(11)},getPrototypeOf(e){return px(e.base_)},setPrototypeOf(){dx(12)}},bS={};for(let e in yS){let t=yS[e];bS[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}bS.deleteProperty=function(e,t){return isNaN(parseInt(t))&&dx(13),bS.set.call(this,e,t,void 0)},bS.set=function(e,t,n){return t!==`length`&&isNaN(parseInt(t))&&dx(14),yS.set.call(this,e[0],t,n,e[0])};function xS(e,t){let n=e[lx];return(n?zx(n):e)[t]}function SS(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!xx(n)||n[lx]?!1:e.baseRefs_.has(n)}function CS(e,t,n){let r=wS(t,n);return r?yx in r?r[yx]:r.get?.call(e.draft_):void 0}function wS(e,t){if(!(t in e))return;let n=px(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=px(n)}}function TS(e){e.modified_||(e.modified_=!0,e.parent_&&TS(e.parent_))}function ES(e){e.copy_||=(e.assigned_=new Map,Vx(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var DS=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(Fx(e)&&!Fx(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}Fx(t)||dx(6),n!==void 0&&!Fx(n)&&dx(7);let r;if(xx(e)){let i=aS(this),a=OS(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?rS(i):iS(i)}return nS(i,n),sS(r,i)}if(!e||!Px(e)){if(r=t(e),r===void 0&&(r=e),r===sx&&(r=void 0),this.autoFreeze_&&Hx(r,!0),n){let t=[],i=[];Xx(qx).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}dx(1,e)},this.produceWithPatches=(e,t)=>{if(Fx(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},Ix(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Ix(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Ix(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){xx(e)||dx(8),bx(e)&&(e=kS(e));let t=aS(this),n=OS(t,e,void 0);return n[lx].isManual_=!0,iS(t),n}finishDraft(e,t){let n=e&&e[lx];(!n||!n.isManual_)&&dx(9);let{scope_:r}=n;return nS(r,t),sS(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=Xx(qx).applyPatches_;return bx(e)?r(e,t):this.produce(e,e=>r(e,t))}};function OS(e,t,n,r){let[i,a]=Mx(t)?Xx(Kx).proxyMap_(t,n):Nx(t)?Xx(Kx).proxySet_(t,n):vS(t,n);return(n?.scope_??eS()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?mS(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function kS(e){return bx(e)||dx(10,e),AS(e)}function AS(e){if(!xx(e)||Gx(e))return e;let t=e[lx],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Vx(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Vx(e,!0);return Tx(n,(e,t)=>{kx(n,e,AS(t))},r),t&&(t.finalized_=!1),n}function jS(){ux.push(`Sets cannot have "replace" patches.`,function(e){return`Unsupported patch operation: `+e},function(e){return`Cannot apply patch, path doesn't resolve: `+e},`Patching reserved attributes like __proto__, prototype and constructor is not allowed`);function e(n,r=[]){if(n.key_!==void 0){let e=n.parent_.copy_??n.parent_.base_,t=Rx(Ox(e,n.key_)),i=Ox(e,n.key_);if(i===void 0||i!==n.draft_&&i!==n.base_&&i!==n.copy_||t!=null&&t.base_!==n.base_)return null;let a=n.parent_.type_===3,o;if(a){let e=n.parent_;o=Array.from(e.drafts_.keys()).indexOf(n.key_)}else o=n.key_;if(!(a&&e.size>o||Dx(e,o)))return null;r.push(o)}if(n.parent_)return e(n.parent_,r);r.reverse();try{t(n.copy_,r)}catch{return null}return r}function t(e,t){let n=e;for(let e=0;e{let u=Ox(o,e,c),f=Ox(s,e,c),p=l?Dx(o,e)?n:`add`:r;if(u===f&&p===n)return;let m=t.concat(e);i.push(p===r?{op:p,path:m}:{op:p,path:m,value:d(f)}),a.push(p===`add`?{op:r,path:m}:p===r?{op:`add`,path:m,value:d(u)}:{op:n,path:m,value:d(u)})})}function s(e,t,n,i){let{base_:a,copy_:o}=e,s=0;a.forEach(e=>{if(!o.has(e)){let a=t.concat([s]);n.push({op:r,path:a,value:e}),i.unshift({op:`add`,path:a,value:e})}s++}),s=0,o.forEach(e=>{if(!a.has(e)){let a=t.concat([s]);n.push({op:`add`,path:a,value:e}),i.unshift({op:r,path:a,value:e})}s++})}function c(e,t,r){let{patches_:i,inversePatches_:a}=r;i.push({op:n,path:[],value:t===sx?void 0:t}),a.push({op:n,path:[],value:e})}function l(e,t){return t.forEach(t=>{let{path:i,op:a}=t,o=e;for(let e=0;e[e,u(t)]));if(Nx(e))return new Set(Array.from(e).map(u));let t=Object.create(px(e));for(let n in e)t[n]=u(e[n]);return Dx(e,cx)&&(t[cx]=e[cx]),t}function d(e){return bx(e)?u(e):e}Qx(qx,{applyPatches_:l,generatePatches_:i,generateReplacementPatches_:c,getPath:e})}globalThis.Iterator?.from;var MS=new DS,NS=MS.produce,PS=MS.produceWithPatches.bind(MS),FS=MS.applyPatches.bind(MS),IS=1e3;function LS(e,t){if(e.add(t),e.size>IS){let t=e.values().next().value;t!==void 0&&e.delete(t)}}function RS(e){let{enablePatches:t=!1}=e;t&&jS();let n=Qb(),r=e.initialValue,i=new Set;return{on:n.on,value:()=>r,patch:(e,t=ox())=>{i.has(t)||(jS(),r=FS(r,e),LS(i,t),n.emit(`updated`,r,void 0,t))},mutate:(e,a=ox())=>{if(!i.has(a)){if(LS(i,a),t){let[t,i]=PS(r,e);if(t===r)return;r=t,n.emit(`updated`,r,i,a)}else{let t=NS(r,e);if(t===r)return;r=t,n.emit(`updated`,r,void 0,a)}}},syncIds:i}}var zS=typeof self==`object`?self:globalThis,BS=new Set([`Error`,`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`,`AggregateError`]),VS=new Set([`Boolean`,`Number`,`String`,`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float16Array`,`Float32Array`,`Float64Array`,`BigInt64Array`,`BigUint64Array`]);function HS(e,t){let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o,r=BS.has(e)?zS[e]:void 0;return n(new(r??zS.Error)(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}if(typeof a==`string`&&VS.has(a))return n(new zS[a](o),i);throw TypeError(`unable to deserialize unsafe or unknown type: ${String(a)}`)};return r}function US(e){return HS(new Map,e)(0)}var WS=``,{toString:GS}={},{keys:KS}=Object;function qS(e){let t=typeof e;if(t!==`object`||!e)return[0,t];let n=GS.call(e).slice(8,-1);switch(n){case`Array`:return[1,WS];case`Object`:return[2,WS];case`Date`:return[3,WS];case`RegExp`:return[4,WS];case`Map`:return[5,WS];case`Set`:return[6,WS];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]}function JS([e,t]){return e===0&&(t===`function`||t===`symbol`)}function YS(e,t,n,r){let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=qS(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize ${s}`);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of KS(r))(e||!JS(qS(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(JS(qS(n))||JS(qS(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!JS(qS(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a}function XS(e,t={}){let n=[];return YS(!(t.json||t.lossy),!!t.json,new Map,n)(e),n}var{parse:ZS,stringify:QS}=JSON,$S={json:!0,lossy:!0};function eC(e){return US(ZS(e))}function tC(e){return QS(XS(e,$S))}function nC(e){return US(e)}function rC(e){return tC(e)}function iC(e){return eC(e)}var aC=256,oC=class extends Error{name=`StreamClosedError`};function sC(e={}){let t=e.id??ox(),n=Math.max(0,e.replayWindow??0),r=Qb(),i=new AbortController,a=[],o=!1,s=0;function c(e){if(o)throw new oC(`Cannot write to a closed stream "${t}"`);s+=1,n>0&&(a.push({seq:s,chunk:e}),a.length>n&&(a.length-n===1?a.shift():a.splice(0,a.length-n))),r.emit(`chunk`,s,e)}function l(e){if(o)return;o=!0;let t=lC(e);i.abort(e),r.emit(`end`,t)}function u(){o||(o=!0,i.signal.aborted||i.abort(`stream closed`),r.emit(`end`,void 0))}function d(e){o||i.signal.aborted||i.abort(e??`aborted`)}let f=new WritableStream({write(e){c(e)},close(){u()},abort(e){l(e)}});return{id:t,signal:i.signal,get closed(){return o},get lastSeq(){return s},write:c,error:l,close:u,abort:d,writable:f,events:r,buffer:a}}function cC(e={}){let t=e.id??ox(),n=Math.max(1,e.highWaterMark??aC),r=[],i=0,a=!1,o=!1,s,c,l,u;function d(){if(c){if(r.length>0){let e=r.shift(),t=c;c=void 0,t.resolve({value:e,done:!1});return}if(a){let e=c;if(c=void 0,s){let t=Error(s.message);t.name=s.name,e.reject(t)}else e.resolve({value:void 0,done:!0})}}}function f(){if(l){for(;r.length>0;){let e=r.shift();try{l.enqueue(e)}catch{break}}if(a&&l){try{if(s){let e=Error(s.message);e.name=s.name,l.error(e)}else l.close()}catch{}l=void 0}}}function p(t,s){if(!(a||o)&&!(t<=i)){if(i=t,r.push(s),r.length>n){let t=r.length-n;r.splice(0,t),e.onOverflow?.(t)}d(),u&&f()}}function m(e){a||(a=!0,s=e,d(),u&&f())}function h(){o||a||(o=!0,e.onCancel?.(),m(void 0))}function g(){return u||(u=new ReadableStream({start(e){l=e,f()},cancel(){h()}}),u)}return{id:t,get cancelled(){return o},get done(){return a},get lastSeenSeq(){return i},get readable(){return g()},cancel:h,_push:p,_end:m,[Symbol.asyncIterator](){return{next(){if(r.length>0)return Promise.resolve({value:r.shift(),done:!1});if(a){if(s){let e=Error(s.message);return e.name=s.name,Promise.reject(e)}return Promise.resolve({value:void 0,done:!0})}return new Promise((e,t)=>{c={resolve:e,reject:t}})},return(){return h(),Promise.resolve({value:void 0,done:!0})}}}}}function lC(e){if(e instanceof Error)return{name:e.name||`Error`,message:e.message};if(typeof e==`string`)return{name:`Error`,message:e};try{return{name:`Error`,message:JSON.stringify(e)}}catch{return{name:`Error`,message:String(e)}}}var uC=128;function dC(e){return e.replace(/[^\w-]+/g,`_`).slice(0,uC)}var fC=`modulepreload`,pC=function(e,t){return new URL(e,t).href},mC={},hC=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=pC(t,n),t=s(t),t in mC)return;mC[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:fC,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},gC=`__connection.json`,_C=`__DEVFRAME_CONNECTION__`,vC=`x-birpc-session`,yC=`__rpc-dump/index.json`,bC=`devframe:services`,xC=`devframe_otp`,SC=`devframe_auth_token`;vb.postMessage.remoteAssetsError;var CC=class{cacheMap=new Map;options;keySerializer;constructor(e){this.options=e,this.keySerializer=e.keySerializer||(e=>Zb(e))}updateOptions(e){this.options={...this.options,...e}}cached(e,t){let n=this.cacheMap.get(e);if(n)return n.get(this.keySerializer(t))}has(e,t){return this.cacheMap.get(e)?.has(this.keySerializer(t))??!1}apply(e,t){let n=this.cacheMap.get(e.m)||new Map;n.set(this.keySerializer(e.a),t),this.cacheMap.set(e.m,n)}validate(e){return this.options.functions.includes(e)}clear(e){e?this.cacheMap.delete(e):this.cacheMap.clear()}},wC=xb({docsBase:`https://devfra.me/errors`,codes:{DF0019:{why:e=>`RPC function "${e.name}" has \`agent\` set but \`jsonSerializable\` is \`false\`; MCP requires JSON-serializable data.`,fix:"Remove `jsonSerializable: false`, or remove `agent` to keep it RPC-only."},DF0020:{why:e=>`RPC function "${e.name}" declares \`jsonSerializable: true\` but the value at "${e.path}" is a ${e.type}.`,fix:"Either drop `jsonSerializable: true` (falls back to structured-clone) or change the value to a JSON-safe shape."},DF0021:{why:e=>`RPC function "${e.name}" is already registered`,fix:"Use the `force` parameter to overwrite an existing registration."},DF0022:{why:e=>`RPC function "${e.name}" is not registered. Use register() to add new functions.`},DF0023:{why:e=>`RPC function "${e.name}" is not registered`},DF0024:{why:e=>`Either handler or setup function must be provided for RPC function "${e.name}"`},DF0025:{why:e=>`Function "${e.name}" not found in dump store`},DF0026:{why:e=>`No dump match for "${e.name}" with args: ${e.args}`},DF0027:{why:e=>`Function "${e.name}" with type "${e.type}" cannot have dump configuration. Only "static" and "query" types support dumps.`},DF0028:{why:e=>`Function "${e.name}" with type "${e.type}" cannot use \`snapshot: true\`. Only "query" functions support this sugar; "static" functions have equivalent default behavior already.`,fix:"Remove `snapshot: true`, or change the function type to `query`."},DF0043:{why:e=>`RPC function "${e.name}" received an invalid argument at position ${e.index}: ${e.issues}`,fix:"Pass a value that satisfies the `args` schema declared for this function."},DF0044:{why:e=>`RPC function "${e.name}" returned a value that failed its \`returns\` schema: ${e.issues}`,fix:"Make the handler return a value that satisfies the `returns` schema, or relax the schema."}}});function TC(e){if(e.agent&&e.jsonSerializable===!1)throw wC.DF0019({name:e.name});e.agent&&!e.jsonSerializable&&(e.jsonSerializable=!0)}async function EC(e,t){let n=e[`~standard`].validate(t);return n instanceof Promise?await n:n}function DC(e){return e.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `)}async function OC(e,t,n){let r=n.slice();if(!t||t.length===0)return r;for(let r=0;r{n.get(t)===r&&n.delete(t)}),n.set(t,r)),await r}if(!e.__promise){let n=Promise.resolve(e.setup(t));n.catch(()=>{e.__promise===n&&(e.__promise=void 0)}),e.__promise=n}return await e.__promise}async function jC(e,t){let n=e.handler;if(!n){let r=await AC(e,t);if(!r.handler)throw wC.DF0024({name:e.name});n=r.handler}let r=e.args,i=e.returns;if(!r&&!i)return n;let a=n;return async(...t)=>{let n=await OC(e.name,r,t),o=await a(...n);return await kC(e.name,i,o)}}var MC=class{context;definitions=new Map;functions;_onChanged=[];constructor(e){this.context=e;let t=this.definitions,n=this;this.functions=new Proxy({},{get(e,r){let i=t.get(r);if(i)return jC(i,n.context)},has(e,n){return t.has(n)},getOwnPropertyDescriptor(e,n){return{value:t.get(n)?.handler,configurable:!0,enumerable:!0}},ownKeys(){return Array.from(t.keys())}})}register(e,t=!1){if(this.definitions.has(e.name)&&!t)throw wC.DF0021({name:e.name});TC(e),this.definitions.set(e.name,e),this._onChanged.forEach(t=>t(e.name))}update(e,t=!1){if(!this.definitions.has(e.name)&&!t)throw wC.DF0022({name:e.name});TC(e),this.definitions.set(e.name,e),this._onChanged.forEach(t=>t(e.name))}onChanged(e){return this._onChanged.push(e),()=>{let t=this._onChanged.indexOf(e);t!==-1&&this._onChanged.splice(t,1)}}async getHandler(e){return await jC(this.definitions.get(e),this.context)}getSchema(e){let t=this.definitions.get(e);if(!t)throw wC.DF0023({name:String(e)});return{args:t.args,returns:t.returns}}has(e){return this.definitions.has(e)}get(e){return this.definitions.get(e)}list(){return Array.from(this.definitions.keys())}};function NC(e,t=``){return JSON.stringify(e,function(e,n){let r=this,i=r==null?n:r[e];if(i===void 0){if(Array.isArray(r))throw FC(t,`undefined`,r,e);return n}return i!==null&&PC(i,r,e,t),n})}function PC(e,t,n,r){if(typeof e==`bigint`)throw FC(r,`BigInt`,t,n);if(typeof e!=`object`)return;if(e instanceof Map)throw FC(r,`Map`,t,n);if(e instanceof Set)throw FC(r,`Set`,t,n);if(e instanceof Date)throw FC(r,`Date`,t,n);if(Array.isArray(e))return;let i=Object.getPrototypeOf(e);if(i!==null&&i!==Object.prototype)throw FC(r,e.constructor?.name??`class instance`,t,n)}function FC(e,t,n,r){let i=IC(n,r);return wC.DF0020({name:e||``,type:t,path:i})}function IC(e,t){return Array.isArray(e)?`[${t}]`:t===``?``:t}var LC=`__DEVFRAME_CONNECTION_META__`,RC=`__DEVFRAME_CONNECTION_AUTH_TOKEN__`;function zC(e){let t=[()=>window?.[e],()=>globalThis?.[e],()=>parent.window?.[e]];for(let e of t)try{let t=e();if(t)return t}catch{}}function BC(){return zC(_C)}function VC(){return zC(LC)}function HC(e){if(e)return e;try{let e=localStorage.getItem(RC);if(e)return e}catch{}return zC(RC)}function UC(e){globalThis[_C]=e,globalThis[LC]={...e.connectionMeta,baseUrl:e.metaBaseUrl},e.authToken&&WC(e.authToken)}function WC(e){try{localStorage.setItem(RC,e)}catch{}globalThis[RC]=e;let t=BC();t&&(globalThis[_C]={...t,authToken:e})}function GC(e){let t=rx(gC,e);try{return new URL(t,globalThis.location?.href).href}catch{return t}}function KC(e,t){return t&&t!==e.authToken?{...e,authToken:t}:e}function qC(){let e=BC();if(e)return KC(e,HC()??e.authToken??e.connectionMeta.authToken);let t=VC();if(t)return{connectionMeta:t,metaBaseUrl:t.baseUrl??GC(`./`),authToken:HC(t.authToken)}}async function JC(e={}){if(e.connection){let t=KC(e.connection,HC(e.authToken??e.connection.authToken??e.connection.connectionMeta.authToken));return UC(t),t}let t=Array.isArray(e.baseURL)?e.baseURL:[e.baseURL??`./`];if(e.connectionMeta){let n={connectionMeta:e.connectionMeta,metaBaseUrl:GC(t[0]??`./`),authToken:HC(e.authToken??e.connectionMeta.authToken)};return UC(n),n}let n=qC();if(n){let t=KC(n,HC(e.authToken??n.authToken??n.connectionMeta.authToken));return UC(t),t}let r=[];for(let n of t){let t=rx(gC,n),i=GC(n);try{let n=await fetch(t);if(!n.ok)throw Error(`Failed to fetch connection meta from ${i}: ${n.status}`);let r=await n.json(),a=n.url||i,o={connectionMeta:r,metaBaseUrl:r.baseUrl?new URL(r.baseUrl,a).href:a,authToken:HC(e.authToken??r.authToken)};return UC(o),o}catch(e){r.push(e)}}throw Error(`Failed to get connection meta from ${t.join(`, `)}`,{cause:r})}var YC=class extends Error{name=`DevframeConnectionError`;kind;constructor(e,t,n){super(t,n),this.kind=e}};function XC(e=xC){try{let t=globalThis.location?.hash?.replace(/^#/,``)??``;return new URLSearchParams(t).get(e)||void 0}catch{return}}function ZC(e){try{let t=new URL(globalThis.location.href),n=new URLSearchParams(t.hash.replace(/^#/,``));if(!n.has(e))return;n.delete(e),t.hash=n.toString(),globalThis.history?.replaceState(globalThis.history.state,``,t.href)}catch{}}function QC(e=xC){let t=XC(e);return t&&ZC(e),t}async function $C(e,t={}){let n=QC(t.param??`devframe_otp`);return n?e.isTrusted?!0:e.requestTrustWithCode(n):!1}function ew(e){let t={},n=new WeakMap,r,i=()=>(r??=e.sharedState.get(bC,{initialValue:{}}).then(e=>(t=e.value(),e.on(`updated`,e=>{t=e}),e)),r);return i(),{state:i,has:e=>e in t,keys:()=>Object.keys(t),get:r=>{let i=t[r];if(!i)return;let a=n.get(i);return a||(a={...i,rpc:e.scope(i.scope).rpc},n.set(i,a)),a}}}function tw(e){let t=new Map,n=new Map,r=new Map,i=new Set,a=e.connectionMeta.backend===`static`;function o(e,t){let n=r.get(e);return n&&typeof n==`object`&&!Array.isArray(n)&&typeof t==`object`&&!Array.isArray(t)?{...n,...t}:t}e.client.register({name:vb.broadcast.clientStateUpdated,type:`event`,handler:(e,n,r)=>{let i=t.get(e);i&&!i.syncIds.has(r)&&i.mutate(()=>o(e,n),r)}}),e.client.register({name:vb.broadcast.clientStatePatch,type:`event`,handler:(e,n,r)=>{let i=t.get(e);i&&!i.syncIds.has(r)&&i.patch(n,r)}});function s(t,n){let r=[];return r.push(n.on(`updated`,(n,r,i)=>{a||(r?e.callEvent(`devframe:rpc:server-state:patch`,t,r,i):e.callEvent(`devframe:rpc:server-state:set`,t,n,i))})),()=>{for(let e of r)e()}}return{keys:()=>Array.from(t.keys()),onKeyAdded(e){return i.add(e),()=>{i.delete(e)}},delete(e){let i=n.get(e);n.delete(e);let a=t.delete(e);return r.delete(e),i?.(),a},get:async(c,l)=>{if(l?.initialValue!==void 0&&r.set(c,l.initialValue),t.has(c))return t.get(c);let u=RS({initialValue:l?.initialValue,enablePatches:!1});async function d(){if(a||e.callEvent(`devframe:rpc:server-state:subscribe`,c),l?.initialValue!==void 0){t.set(c,u);for(let e of i)e(c);return e.call(`devframe:rpc:server-state:get`,c).then(e=>{e!==void 0&&u.mutate(()=>o(c,e))}).catch(e=>{console.error(`Error getting server state`,e)}),n.set(c,s(c,u)),u}{let r=await e.call(`devframe:rpc:server-state:get`,c);u.mutate(()=>o(c,r)),t.set(c,u);for(let e of i)e(c);return n.set(c,s(c,u)),u}}return new Promise((t,n)=>{if(e.isTrusted)d().then(t,n);else{t(u);let n=!1;e.events.on(vb.client.isTrustedUpdated,e=>{e&&!n&&(n=!0,d())})}})}}}var nw=new Map;function rw(e=nw){let t=new Map;return{serialize:n=>{let r;return n.t===`q`?r=n.m:(r=t.get(n.i),t.delete(n.i)),!(n.t===`s`&&`e`in n)&&r&&e.get(r)?.jsonSerializable===!0?NC(n,r??``):`s:${rC(n)}`},deserialize:e=>{let n=e.startsWith(`s:`)?iC(e.slice(2)):JSON.parse(e);return n.t===`q`&&n.i&&n.m&&t.set(n.i,n.m),n}}}function iw(){}function aw(e){let t=e.search(/\n\n|\r\n\r\n/);if(!(t<0))return{frame:e.slice(0,t),rest:e.slice(t+(e[t]===`\r`?4:2))}}function ow(e){let t=`message`,n=[];for(let r of e.split(/\r?\n/))r.startsWith(`:`)||(r.startsWith(`event:`)?t=r.slice(6).trimStart():r.startsWith(`data:`)&&n.push(r.slice(5).replace(/^ /,``)));return{event:t,data:n}}function sw(e){let{onConnected:t=iw,onError:n=iw,onDisconnected:r=iw,definitions:i,fetch:a=globalThis.fetch.bind(globalThis)}=e,o=e.url;e.authToken&&(o=`${o}${o.includes(`?`)?`&`:`?`}${SC}=${encodeURIComponent(e.authToken)}`);let s=rw(i),c=new AbortController,l=!1,u,d,f,p,m=new Promise((e,t)=>{f=e,p=t});m.catch(()=>{});function h(e){l||(l=!0,p(e),n(e),r())}function g(){l||(l=!0,p(Error(`Devframe SSE stream closed`)),r())}function _(e,n){if(e===`session`){f(n),t();return}u?.(n)}async function ee(e){let t=e.getReader();d=t;let n=new TextDecoder,r=``;for(;;){let{done:e,value:i}=await t.read();if(e)break;for(r+=n.decode(i,{stream:!0});;){let e=aw(r);if(!e)break;r=e.rest;let{event:t,data:n}=ow(e.frame);n.length>0&&_(t,n.join(` +`))}}g()}return(async()=>{try{let e=await a(o,{headers:{accept:`text/event-stream`},signal:c.signal});if(!e.ok||!e.body)throw Error(`Devframe SSE stream request failed: ${e.status}`);await ee(e.body)}catch(e){if(c.signal.aborted){g();return}h(e instanceof Error?e:Error(String(e)))}})(),{close:()=>{l=!0,c.abort(),d?.cancel().catch(()=>{})},on:e=>{u=e},post:async e=>{let t;try{t=await m}catch{return}if(l){n(Error(`Devframe SSE channel is closed; message dropped`));return}try{let n=await a(o,{method:`POST`,headers:{"content-type":`text/plain; charset=utf-8`,[vC]:t},body:e});if(n.status===200){let e=await n.text();e&&u?.(e);return}if(!n.ok)throw Error(`Devframe SSE POST failed: ${n.status}`)}catch(e){n(e instanceof Error?e:Error(String(e)))}},serialize:s.serialize,deserialize:s.deserialize}}function cw(e,t){let{channel:n,rpcOptions:r={}}=t;return jb(e,{...n,timeout:-1,...r,proxify:!1})}function lw(e){let{transport:t,authToken:n,connectionMeta:r,events:i,clientRpc:a,rpcOptions:o={},callTimeout:s=0}=e,c=!1,l=`connecting`,u=null,d=Promise.withResolvers();function f(e,t=null){if(t?u=t:e===`connected`&&(u=null),e===l)return;let n=l;l=e,i.emit(vb.client.connectionStatus,e,n)}let p=new Set;function m(e){for(let t of[...p])t.reject(e)}function h(){return l===`disconnected`||l===`error`?new YC(`connection`,`[devframe] Not connected to the devframe server`,{cause:u??void 0}):l===`unauthorized`?new YC(`auth`,`[devframe] Not authorized by the devframe server`,{cause:u??void 0}):null}function g(e,t){return new Promise((n,r)=>{let a=!1,o,c={reject(e){a||(l(),i.emit(vb.client.error,e,t),r(e))}};function l(){a=!0,p.delete(c),o&&clearTimeout(o)}p.add(c),s>0&&(o=setTimeout(()=>{c.reject(new YC(`timeout`,`[devframe] RPC call "${t}" timed out after ${s}ms`))},s)),e.then(e=>{a||(l(),n(e))},e=>{if(a)return;l();let n=e instanceof Error?e:Error(String(e));i.emit(vb.client.error,n,t),r(n)})})}let _=new Map;for(let e of r.jsonSerializableMethods??[])_.set(e,{jsonSerializable:!0});let ee=e.createChannel({definitions:_,onError(e){f(`error`,e),i.emit(vb.client.connectionError,e),m(new YC(`connection`,`[devframe] Connection to the devframe server failed`,{cause:e}))},onDisconnected(){l!==`error`&&f(`disconnected`),m(new YC(`connection`,`[devframe] Disconnected from the devframe server`,{cause:u??void 0}))}}),te=cw(a.functions,{channel:ee,rpcOptions:o});a.register({name:vb.broadcast.authRevoked,type:`event`,handler:()=>{c=!1;let e=new YC(`auth`,`[devframe] The devframe server revoked this client's trust`);f(`unauthorized`,e),i.emit(vb.client.connectionError,e),m(e),i.emit(vb.client.isTrustedUpdated,!1)}});let ne=n;async function re(e){ne=e;let t=await te.$call(`anonymous:devframe:auth`,{authToken:e,ua:navigator.userAgent,origin:location.origin});if(c=t.isTrusted,c)d.resolve(!0),f(`connected`);else{let e=new YC(`auth`,`[devframe] The devframe server refused this client's credentials`);f(`unauthorized`,e),i.emit(vb.client.connectionError,e)}return i.emit(vb.client.isTrustedUpdated,c),t.isTrusted}async function ie(e){let t=(await te.$call(`anonymous:devframe:auth:exchange`,{code:e,ua:navigator.userAgent,origin:location.origin}))?.authToken??null;return t&&(ne=t,c=!0,d.resolve(!0),f(`connected`),i.emit(vb.client.isTrustedUpdated,!0)),t}async function ae(e={}){await te.$call(`anonymous:devframe:auth:request-code`,{ua:navigator.userAgent,origin:location.origin,...e.reissue?{reissue:!0}:{}})}async function oe(){return c?!0:re(ne??``)}async function se(e=6e4){if(c&&d.resolve(!0),e<=0)return d.promise;let t;try{return await Promise.race([d.promise,new Promise((n,r)=>{t=setTimeout(()=>{r(Error(`[devframe] Timeout waiting for rpc to be trusted`))},e)})]),c}finally{clearTimeout(t)}}return{transport:t,get isTrusted(){return c},get status(){return l},get connectionError(){return u},requestTrust:oe,requestTrustWithToken:re,requestTrustWithCode:ie,requestAuthCode:ae,ensureTrusted:se,call:(...e)=>{let t=String(e[0]),n=h();return n?(i.emit(vb.client.error,n,t),Promise.reject(n)):g(te.$call(...e),t)},callEvent:(...e)=>{let t=h();if(t){i.emit(vb.client.error,t,String(e[0]));return}return te.$callEvent(...e)},callOptional:(...e)=>{let t=String(e[0]),n=h();return n?(i.emit(vb.client.error,n,t),Promise.reject(n)):g(te.$callOptional(...e),t)},close:()=>{ee.close()}}}function uw(e,t,n){let r=(()=>{try{return new URL(t,n.href)}catch{return new URL(n.href)}})();if(e&&typeof e==`object`){if(e.host!=null||e.port!=null){let t=e.host??`${r.hostname}:${e.port}`;return new URL(e.path??`/`,`${r.protocol}//${t}`).href}return new URL(e.path??``,r).href}let i=e??``;return/^https?:\/\//i.test(i)?i:new URL(i,r).href}function dw(e){let{authToken:t,connectionMeta:n,metaBaseUrl:r,events:i,clientRpc:a,rpcOptions:o={},sseOptions:s={},callTimeout:c=0}=e,l=uw(n.sse,r??`./`,location);return lw({transport:`sse`,authToken:t,connectionMeta:n,events:i,clientRpc:a,rpcOptions:o,callTimeout:c,createChannel:e=>sw({url:l,authToken:t,definitions:e.definitions,...s,onConnected(){s.onConnected?.()},onError(t){e.onError(t),s.onError?.(t)},onDisconnected(){e.onDisconnected(),s.onDisconnected?.()}})})}function fw(e){let{name:t,message:n,cause:r,...i}=e,a=r instanceof Error?r:pw(r)?fw(r):r,o=a===void 0?Error(n):Error(n,{cause:a});return o.name=t,Object.assign(o,i),o}function pw(e){return typeof e==`object`&&!!e&&typeof e.message==`string`&&typeof e.name==`string`}function mw(e){return typeof e==`object`&&!!e&&e.type===`static`&&typeof e.path==`string`}function hw(e){return typeof e==`object`&&!!e&&e.type===`query`&&typeof e.records==`object`&&e.records!==null}function gw(e){return typeof e==`object`&&!!e&&(`output`in e||`error`in e)}function _w(e){if(e.error)throw fw(e.error);return e.output}function vw(e){return e.some(e=>e!=null)}function yw(e){return typeof e==`object`&&e&&`serialization`in e&&`data`in e?e.data:e}function bw(e,t){let n=new Map,r=new Map;function i(e,t){return t===`structured-clone`&&Array.isArray(e)?nC(e):e}function a(e,t){return i(yw(e),t)}async function o(e){n.has(e.path)||n.set(e.path,t(e.path).then(t=>a(t,e.serialization)));let r=await n.get(e.path);return gw(r)?_w(r):r}async function s(e,n){return r.has(e)||r.set(e,t(e).then(e=>a(e,n))),await r.get(e)}async function c(t,n){if(!(t in e))throw Error(`[devframe-rpc] Function "${t}" not found in dump store`);let r=e[t];if(mw(r)){if(vw(n))throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`);return await o(r)}if(hw(r)){let e=Zb(n),i=r.records[e];if(i)return _w(await s(i,r.serialization));if(r.fallback)return _w(await s(r.fallback,r.serialization));throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}if(!vw(n))return r;throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}return{call:async(e,t)=>await c(e,t),callOptional:async(t,n)=>{if(t in e)return await c(t,n)},callEvent:async(e,t)=>{}}}async function xw(e){let t=bw(await e.fetchJsonFromBases(yC),e.fetchJsonFromBases);return{transport:`static`,isTrusted:!0,status:`connected`,connectionError:null,requestTrust:async()=>!0,requestTrustWithToken:async()=>!0,requestTrustWithCode:async()=>null,requestAuthCode:async()=>{},ensureTrusted:async()=>!0,call:(...e)=>t.call(e[0],e.slice(1)),callEvent:(...e)=>t.callEvent(e[0],e.slice(1)),callOptional:(...e)=>t.callOptional(e[0],e.slice(1)),close:()=>{}}}var Sw=``;function Cw(e,t){return`${e}${Sw}${t}`}function ww(e){let t=new Map,n=new Map;e.client.register({name:vb.broadcast.streamingChunk,type:`event`,handler(e,n,r,i){t.get(Cw(e,n))?._push(r,i)}}),e.client.register({name:vb.broadcast.streamingEnd,type:`event`,handler(e,n,r){let i=Cw(e,n),a=t.get(i);a&&(a._end(r),t.delete(i))}}),e.client.register({name:vb.broadcast.streamingUploadCancel,type:`event`,handler(e,t){let r=Cw(e,t),i=n.get(r);i&&(i.abort(`server cancelled upload`),n.delete(r))}}),e.events.on(vb.client.isTrustedUpdated,n=>{if(n)for(let[n,r]of t){if(r.cancelled||r.done)continue;let t=n.indexOf(Sw);if(t<0)continue;let i=n.slice(0,t),a=n.slice(t+1);e.callEvent(`devframe:streaming:subscribe`,i,a,{afterSeq:r.lastSeenSeq})}});function r(n,r,i={}){let a=Cw(n,r),o=t.get(a);if(o)return o;let s=cC({id:r,highWaterMark:i.highWaterMark,onOverflow(e){console.warn(`[devframe] DF0029: Stream "${n}#${r}" dropped ${e} chunk(s) after exceeding the client high-water mark.`)},onCancel(){e.callEvent(`devframe:streaming:cancel`,n,r),t.delete(a)}});if(t.set(a,s),e.isTrusted)e.callEvent(`devframe:streaming:subscribe`,n,r,{afterSeq:0});else{let i=e.events.on(vb.client.isTrustedUpdated,o=>{o&&(i(),t.has(a)&&!s.cancelled&&!s.done&&e.callEvent(`devframe:streaming:subscribe`,n,r,{afterSeq:s.lastSeenSeq}))})}return s}function i(t,r){let i=Cw(t,r),a=n.get(i);if(a)return a;let o=sC({id:r});return o.events.on(`chunk`,(n,i)=>{e.callEvent(`devframe:streaming:upload-chunk`,t,r,n,i)}),o.events.on(`end`,a=>{e.callEvent(`devframe:streaming:upload-end`,t,r,a),n.delete(i)}),n.set(i,o),o}return{subscribe:r,upload:i}}function Tw(){}var Ew=new Map;function Dw(e){let t=e.url;e.authToken&&(t=`${t}?${SC}=${encodeURIComponent(e.authToken)}`);let n=new WebSocket(t),{onConnected:r=Tw,onError:i=Tw,onDisconnected:a=Tw,definitions:o=Ew}=e;n.addEventListener(`open`,e=>{r(e)}),n.addEventListener(`error`,e=>{let t=e instanceof Error?e:Error(e.type);i(t)}),n.addEventListener(`close`,e=>{a(e)});let s=rw(o);return{close:()=>{n.close()},on:e=>{n.addEventListener(`message`,t=>{e(t.data)})},post:e=>{if(n.readyState===WebSocket.OPEN){n.send(e);return}if(n.readyState===WebSocket.CONNECTING){let t=()=>{i(),n.readyState===WebSocket.OPEN&&n.send(e)},r=()=>i();function i(){n.removeEventListener(`open`,t),n.removeEventListener(`close`,r)}n.addEventListener(`open`,t),n.addEventListener(`close`,r);return}i(Error(`Devframe WebSocket is not open; message dropped`))},serialize:s.serialize,deserialize:s.deserialize}}function Ow(e,t,n){let r=(()=>{try{return new URL(t,n.href)}catch{return new URL(n.href)}})(),i=r.protocol===`https:`?`wss:`:`ws:`;if(e&&typeof e==`object`){if(e.host!=null||e.port!=null){let t=e.host??`${r.hostname}:${e.port}`,n=new URL(e.path??`/`,`${i}//${t}`);return n.protocol=i,n.href}let t=new URL(e.path??``,r);return t.protocol=i,t.href}if(typeof e==`number`)return`${i}//${r.hostname}:${e}`;let a=e??``;if(/^wss?:\/\//i.test(a))return a;if(/^https?:\/\//i.test(a))return ix(a,/^https/i.test(a)?`wss://`:`ws://`);let o=new URL(a,r);return o.protocol=i,o.href}function kw(e){let{authToken:t,connectionMeta:n,metaBaseUrl:r,events:i,clientRpc:a,rpcOptions:o={},wsOptions:s={},callTimeout:c=0}=e,l=Ow(n.websocket,r??`./`,location);return lw({transport:`websocket`,authToken:t,connectionMeta:n,events:i,clientRpc:a,rpcOptions:o,callTimeout:c,createChannel:e=>Dw({url:l,authToken:t,definitions:e.definitions,...s,onConnected(e){s.onConnected?.(e)},onError(t){e.onError(t),s.onError?.(t)},onDisconnected(t){e.onDisconnected(),s.onDisconnected?.(t)}})})}function Aw(e){return e.includes(`:`)}function jw(e,t){return Aw(t)?t:`${e}:${t}`}function Mw(e){return{async get(t){return(await e()).value()?.[t]},async set(t,n){(await e()).mutate(e=>{if(e===void 0)return{[t]:n};e[t]=n})},async delete(t){(await e()).mutate(e=>{e!==void 0&&delete e[t]})},async all(){return(await e()).value()??{}},async onChange(t){return(await e()).on(`updated`,e=>t(e??{}))}}}function Nw(e,t,n){let r=`devframe:settings:${n}:${t}`,i;function a(){return i||=(async()=>(await e.ensureTrusted(),e.sharedState.get(r)))().catch(e=>{throw i=void 0,e}),i}return Mw(a)}function Pw(e,t){return{global:Nw(e,t,`global`),project:Nw(e,t,`project`)}}function Fw(e,t){return{namespace:t,base:e,rpc:{namespace:t,register(n){if(Aw(n.name))throw Error(`[devframe] Scoped client RPC registration for namespace "${t}" received an already-namespaced function name "${n.name}". Pass a bare name without a ":" separator.`);e.client.register({...n,name:`${t}:${n.name}`})},call:((n,...r)=>e.call(jw(t,n),...r)),callEvent:((n,...r)=>e.callEvent(jw(t,n),...r)),callOptional:((n,...r)=>e.callOptional(jw(t,n),...r)),sharedState:((n,r)=>e.sharedState.get(jw(t,n),r)),streaming:{subscribe:(n,r,i)=>e.streaming.subscribe(jw(t,n),r,i),upload:(n,r)=>e.streaming.upload(jw(t,n),r)}},settings:Pw(e,t),scope:e.scope}}function Iw(){if(typeof document<`u`){let e=document.modelContext;if(e)return e}if(typeof navigator<`u`){let e=navigator.modelContext;if(e)return e}}function Lw(e,t={}){let n=t.modelContext??Iw();if(!n)return()=>{};let r=n,i=new Map,a=new Map;function o(t,n){let o=dC(t.name),s=a.get(o);if(s&&s!==t.name){console.warn(`[devframe] WebMCP tool name "${o}" (from "${t.name}") collides with "${s}"; keeping the first registration.`);return}let c=new AbortController,l=Mb(t.type,n),u=r.registerTool({name:o,description:n.description,inputSchema:Fb(t.args),annotations:{title:n.title??t.name,readOnlyHint:l===`read`,destructiveHint:l===`destructive`},execute:n=>Rw(t,e.context,n)},{signal:c.signal});u&&`then`in u&&u.then(()=>{},()=>{}),a.set(o,t.name),i.set(t.name,()=>{c.abort(),u&&`unregister`in u&&typeof u.unregister==`function`&&u.unregister(),a.delete(o)})}function s(t){let n=t?[t]:[...e.definitions.keys()];for(let t of n){i.get(t)?.(),i.delete(t);let n=e.definitions.get(t),r=n?.agent;n&&r&&o(n,r)}}s();let c=e.onChanged(e=>s(e));return()=>{c();for(let e of i.values())e();i.clear()}}async function Rw(e,t,n){try{let r=Lb(n,e.args?.length);return{content:[{type:`text`,text:zw(await(await jC(e,t))(...r))}]}}catch(e){return{isError:!0,content:[{type:`text`,text:Bw(e)}]}}}function zw(e){return e===void 0?`undefined`:typeof e==`string`?e:JSON.stringify(e,null,2)}function Bw(e){if(!(e instanceof Error))return String(e);let t=e.cause instanceof Error?` (cause: ${e.cause.message})`:``;return`${e.name}: ${e.message}${t}`}function Vw(e,t){if(t.backend===`static`)return`static`;let n=t.websocket!==void 0,r=t.sse!==void 0;if(e===`websocket`){if(!n)throw Error(`[devframe] transport: 'websocket' was requested, but this server does not advertise a WebSocket endpoint`);return`websocket`}if(e===`sse`){if(!r)throw Error(`[devframe] transport: 'sse' was requested, but this server does not advertise an SSE endpoint`);return`sse`}if(t.backend===`sse`&&r)return`sse`;if(n)return`websocket`;if(r)return`sse`;throw Error(`[devframe] This server advertises no RPC transport (backend "none"), so there is nothing to connect to. Enable the WebSocket or SSE endpoint on the server, or use its static/MCP surfaces instead.`)}async function Hw(e={}){let{baseURL:t=`./`,rpcOptions:n={},cacheOptions:r=!1}=e,i=Qb(),a=Array.isArray(t)?t:[t],o=await JC(e),{connectionMeta:s,metaBaseUrl:c,authToken:l}=o,u=a[0]??`./`;try{u=new URL(`.`,c).href}catch{}let d=new CC({functions:[],...typeof e.cacheOptions==`object`?e.cacheOptions:{}}),f={rpc:void 0},p=new MC(f),m=e.webmcp===!1?void 0:Lw(p),h,g=!1,_=0,ee;function te(){_++,ee=void 0,d.clear(),r===!0&&d.updateOptions({functions:[]})}r&&(p.register({name:vb.broadcast.cacheInvalidate,type:`event`,handler:te}),i.on(vb.client.connectionStatus,te),i.on(vb.client.isTrustedUpdated,te));async function ne(e){let t=[u,...a.filter(e=>e!==u)].filter(e=>e!=null),n=[];for(let r of t)try{return await fetch(rx(e,r)).then(t=>{if(!t.ok)throw Error(`Failed to fetch ${e} from ${r}: ${t.status}`);return t.json()})}catch(e){n.push(e)}throw Error(`Failed to load ${e} from ${t.join(`, `)}`,{cause:n})}let re=e.callTimeout??0,ie=re>0?re:1/0,ae,oe={authToken:l,connectionMeta:s,metaBaseUrl:c,events:i,clientRpc:p,callTimeout:e.callTimeout,rpcOptions:{...n,async onRequest(e,t,i){let a=performance.now()+ie;if(await n.onRequest?.call(this,e,t,i),r===!0&&e.i&&ae.isTrusted&&!e.m.startsWith(`anonymous:`)&&e.m!==`devframe:rpc:cacheable-functions`){function t(){if(performance.now()>=a)throw new YC(`timeout`,`[devframe] RPC call "${e.m}" timed out after ${re}ms`)}for(;!ee&&(t(),!(g||ae.status!==`connected`));){let e=_;ee=ae.callOptional(`devframe:rpc:cacheable-functions`).then(t=>{e===_&&d.updateOptions({functions:t??[]})}).catch(t=>{throw e===_&&(ee=void 0),t}),await ee}await ee,t()}let o=_;if(r&&e.i&&!g&&ae.isTrusted&&d.validate(e.m)){if(d.has(e.m,e.a))return i(d.cached(e.m,e.a));let n=await t(e);o===_&&!g&&d.apply(e,n)}else await t(e)}}},se=Vw(e.transport??`auto`,s);ae=se===`static`?await xw({fetchJsonFromBases:ne}):se===`sse`?dw({...oe,sseOptions:e.sseOptions}):kw({...oe,wsOptions:e.wsOptions});let ce;try{ce=new BroadcastChannel(`devframe-auth`)}catch{}let le,ue=!1;function de(e){return((...t)=>ue||!le?e(...t):le.then(()=>e(...t)))}function fe(){g=!0,te();try{h?.(),m?.()}finally{try{ce?.close()}finally{ae.close?.()}}}let pe={events:i,get isTrusted(){return ae.isTrusted},get status(){return ae.status},get connectionError(){return ae.connectionError},get transport(){return ae.transport??se},get connection(){return o},connectionMeta:s,ensureTrusted:ae.ensureTrusted,requestTrust:ae.requestTrust,requestTrustWithToken:async e=>(WC(e),o={...o,authToken:e},ae.requestTrustWithToken(e)),requestTrustWithCode:async e=>{let t=await ae.requestTrustWithCode(e);if(!t)return!1;WC(t),o={...o,authToken:t};try{ce?.postMessage({type:`auth-update`,authToken:t})}catch{}return!0},requestAuthCode:e=>ae.requestAuthCode(e),call:de(ae.call),callEvent:de(ae.callEvent),callOptional:de(ae.callOptional),client:p,sharedState:void 0,services:void 0,streaming:void 0,cacheManager:d,scope:void 0,close:fe};pe.sharedState=tw(pe),pe.streaming=ww(pe),pe.services=ew(pe);let me=new Map;pe.scope=(e=>{if(!e)return pe;let t=me.get(e);return t||(t=Fw(pe,e),me.set(e,t)),t}),f.rpc=pe;function he(){try{return typeof window<`u`&&window.self===window.top}catch{return!1}}async function ge(){if(e.simpleAuth!==!1&&he()&&typeof globalThis.prompt==`function`)for(await pe.requestAuthCode().catch(()=>{});!pe.isTrusted;){let e=globalThis.prompt(`devframe: enter the authentication code shown in your terminal`);if(e==null)return;let t=e.trim();if(t&&await pe.requestTrustWithCode(t))return}}async function _e(){let t=await ae.requestTrust(),n=e.otpParam??`devframe_otp`,r=n?await $C(pe,{param:n}):!1;t||r||pe.isTrusted||await ge()}return le=_e().then(()=>{ue=!0},()=>{ue=!0}),s.mcp&&hC(async()=>{let{setupBrowserAgentRpcBridge:e}=await import(`./browser-agent-rpc-BXhoSh1z-57G_sncs.js`);return{setupBrowserAgentRpcBridge:e}},[],import.meta.url).then(({setupBrowserAgentRpcBridge:e})=>{g||(h=e(pe))}).catch(()=>{}),ce&&(ce.onmessage=e=>{e.data?.type===`auth-update`&&e.data.authToken&&pe.requestTrustWithToken(e.data.authToken)}),pe}var Uw=Hw,Ww=[`components`,`injectors`,`signals`,`ngrx`,`tanstackQuery`,`forms`,`router`,`pipes`,`http`,`analog`,`capacitor`,`errors`,`plugins`],Gw=[`angular`,`ngrx`,`analog`,`angular-native`,`nativescript`,`capacitor`];function Kw(e){return`pangular:${e}`}var qw=[`forms`,`router`,`ngrx`,`http`,`analog`,`components`,`tanstackQuery`,`plugins`],Jw={refreshMs:{default:3e3,min:500,max:8e3},navigations:{default:50,min:5,max:500},formTimeline:{default:200,min:10,max:2e3},httpCalls:{default:200,min:10,max:2e3},changeLog:{default:200,min:10,max:2e3},cdCycles:{default:200,min:10,max:2e3},capacitorCalls:{default:200,min:10,max:2e3},idleAfterMs:{default:6e4,min:0,max:6e5}},Yw={"opted-out":`the request sets transferCache: false`,post:`POST requests are left out unless includePostRequests is set`,method:`only GET, HEAD and POST requests are cached`,"auth-headers":`it sends an Authorization, Proxy-Authorization or Cookie header`,credentials:`it sends credentials (withCredentials or credentials: include/same-origin)`,"no-cache-request":`the request asks for no-store, no-cache or private`,"no-cache-response":`the response has Cache-Control no-store, no-cache or private`,"set-cookie":`the response sets a cookie`,error:`failed responses are not stored`,mocked:`a fault rule answered before the transfer cache ran`,"cache-off-or-filter":`the transfer cache is off, or its filter (or another withHttpTransferCacheOptions setting) left it out`},Xw=[[200,`OK`],[201,`Created`],[202,`Accepted`],[203,`Non-Authoritative Information`],[204,`No Content`],[205,`Reset Content`],[206,`Partial Content`],[207,`Multi-Status`],[208,`Already Reported`],[226,`IM Used`],[300,`Multiple Choices`],[301,`Moved Permanently`],[302,`Found`],[303,`See Other`],[304,`Not Modified`],[307,`Temporary Redirect`],[308,`Permanent Redirect`],[400,`Bad Request`],[401,`Unauthorized`],[402,`Payment Required`],[403,`Forbidden`],[404,`Not Found`],[405,`Method Not Allowed`],[406,`Not Acceptable`],[407,`Proxy Authentication Required`],[408,`Request Timeout`],[409,`Conflict`],[410,`Gone`],[411,`Length Required`],[412,`Precondition Failed`],[413,`Content Too Large`],[414,`URI Too Long`],[415,`Unsupported Media Type`],[416,`Range Not Satisfiable`],[417,`Expectation Failed`],[418,`I'm a Teapot`],[421,`Misdirected Request`],[422,`Unprocessable Content`],[423,`Locked`],[424,`Failed Dependency`],[425,`Too Early`],[426,`Upgrade Required`],[428,`Precondition Required`],[429,`Too Many Requests`],[431,`Request Header Fields Too Large`],[451,`Unavailable For Legal Reasons`],[499,`Client Closed Request`],[500,`Internal Server Error`],[501,`Not Implemented`],[502,`Bad Gateway`],[503,`Service Unavailable`],[504,`Gateway Timeout`],[505,`HTTP Version Not Supported`],[506,`Variant Also Negotiates`],[507,`Insufficient Storage`],[508,`Loop Detected`],[510,`Not Extended`],[511,`Network Authentication Required`],[520,`Web Server Returned an Unknown Error`],[521,`Web Server Is Down`],[522,`Connection Timed Out`],[523,`Origin Is Unreachable`],[524,`A Timeout Occurred`]];function Zw(e){return Xw.some(([t])=>t===e)}var Qw=/^[a-z][a-z0-9-]{0,39}$/;function $w(e,t){let n=t.plugins?.[e],r=t.inspectors.plugins&&Qw.test(e)&&(n?.enabled??!0);return{enabled:r,tools:r&&t.agent.tools.plugins&&(n?.tools??!0),actions:r&&t.actions.plugins&&(n?.actions??!0)}}var eT=`pangular`,tT={mod:`Mod`,ctrl:`Ctrl`,control:`Ctrl`,meta:`Meta`,cmd:`Meta`,command:`Meta`,alt:`Alt`,option:`Alt`,opt:`Alt`,shift:`Shift`},nT=[`Mod`,`Ctrl`,`Meta`,`Alt`,`Shift`];function rT(e){if(typeof e!=`string`||e.length>40)return;let t=e.split(`+`).map(e=>e.trim());if(t.some(e=>!e))return;let n=new Set,r;for(let e of t){let t=tT[e.toLowerCase()];if(t){if(n.has(t))return;n.add(t);continue}if(r!==void 0)return;if(/^[a-z0-9]$/i.test(e))r=e.toUpperCase();else if(/^f([1-9]|1[0-2])$/i.test(e))r=e.toUpperCase();else return}if(r&&[...n].some(e=>e!==`Shift`)&&!(n.has(`Mod`)&&(n.has(`Ctrl`)||n.has(`Meta`))))return[...nT.filter(e=>n.has(e)),r].join(`+`)}function iT(e,t,n){let r=t.split(`+`),i=r.pop(),a=new Set(r),o=a.has(`Ctrl`)||a.has(`Mod`)&&!n,s=a.has(`Meta`)||a.has(`Mod`)&&n;if(e.ctrlKey!==o||e.metaKey!==s||e.altKey!==a.has(`Alt`)||e.shiftKey!==a.has(`Shift`))return!1;if(/^F\d+$/.test(i))return e.key.toUpperCase()===i;let c=/^\d$/.test(i)?`Digit${i}`:`Key${i}`;return e.code?e.code===c:e.key.toUpperCase()===i}function aT(e,t){if(!t)return e.replace(/^Mod\b/,`Ctrl`);let n={Mod:`⌘`,Meta:`⌘`,Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`};return e.split(`+`).map(e=>n[e]??e).join(``)}var oT=[{id:`dashboard`,label:`Dashboard`},{id:`timeline`,label:`Timeline`},{id:`audit`,label:`Audit`},{id:`analog`,label:`Analog`,inspector:`analog`},{id:`components`,label:`Components`,inspector:`components`},{id:`routes`,label:`Routes`,inspector:`router`},{id:`signals`,label:`Signals`,inspector:`signals`},{id:`injectors`,label:`Injectors`,inspector:`injectors`},{id:`store`,label:`Store`,inspector:`ngrx`},{id:`queries`,label:`Queries`,inspector:`tanstackQuery`},{id:`forms`,label:`Forms`,inspector:`forms`},{id:`pipes`,label:`Pipes`,inspector:`pipes`},{id:`network`,label:`SSR & HTTP`,inspector:`http`},{id:`errors`,label:`Errors`,inspector:`errors`},{id:`capacitor`,label:`Capacitor`,inspector:`capacitor`},{id:`plugins`,label:`Plugins`,inspector:`plugins`}],sT=1e4;function cT(e){return oT.filter(t=>!(`inspector`in t)||e.inspectors[t.inspector])}var lT={components:`a component instance, by its id in the component tree`,injectors:`a component's element injector, by the component's id`,forms:`a form, by its id`},uT=200;function dT(e){let t=new URLSearchParams({tab:e.tab});return e.id&&t.set(`id`,e.id),e.page&&t.set(`page`,e.page),`#${t.toString()}`}function fT(e){let t=new URLSearchParams(e.replace(/^#/,``)),n=e=>{let n=t.get(e)?.trim();return n&&n.length<=uT?n:void 0},r=n(`tab`);if(!r)return null;let i=n(`id`),a=n(`page`);return{tab:r,...i?{id:i}:{},...a?{page:a}:{}}}var pT=[{id:`settings`,title:`Open settings`,group:`Go to`,keywords:`preferences tabs`},{id:`pick-component`,title:`Pick component on page`,group:`Actions`,keywords:`select inspect element`,inspector:`components`},{id:`cd-record-start`,title:`Start recording change detection`,group:`Actions`,keywords:`profiler cycles`,inspector:`components`},{id:`cd-record-stop`,title:`Stop recording change detection`,group:`Actions`,keywords:`profiler cycles`,inspector:`components`},{id:`cd-clear`,title:`Clear change detection recording`,group:`Actions`,keywords:`reset recordings cycles`,inspector:`components`},{id:`theme:system`,title:`Theme: follow the system`,group:`Theme`,keywords:`auto`},{id:`theme:light`,title:`Theme: light`,group:`Theme`},{id:`theme:dark`,title:`Theme: dark`,group:`Theme`},{id:`dock:float`,title:`Popup: float`,group:`Popup`,keywords:`dock`,popupOnly:!0},{id:`dock:bottom`,title:`Popup: dock to the bottom`,group:`Popup`,keywords:`dock`,popupOnly:!0},{id:`dock:right`,title:`Popup: dock to the right`,group:`Popup`,keywords:`dock`,popupOnly:!0},{id:`dock:reset-size`,title:`Popup: reset the docked size`,group:`Popup`,keywords:`splitter resize height width`,popupOnly:!0},{id:`popout`,title:`Popup: open in its own window`,group:`Popup`,keywords:`pop out detach new window`,popupOnly:!0},{id:`popout:return`,title:`Popup: back into the page`,group:`Popup`,keywords:`pop in attach dock window`,popupOnly:!0}];function mT(e){let t=cT(e).map(e=>({id:`tab:${e.id}`,title:`Go to ${e.label}`,group:`Go to`,keywords:`tab open`})),n=pT.filter(t=>!t.inspector||e.inspectors[t.inspector]).map(({inspector:e,...t})=>t);return[...t,...n]}function hT(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function gT(e,t){return typeof e==`boolean`?e:t}var _T=100,vT=100;function yT(e){if(!Array.isArray(e))return[];let t=e.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(e=>e&&e.length<=vT);return[...new Set(t)].slice(0,_T)}function bT(e,t){let{default:n,min:r,max:i}=Jw[t];return typeof e!=`number`||!Number.isFinite(e)?n:Math.min(i,Math.max(r,Math.round(e)))}function xT(e,t){return Object.fromEntries(e.map(e=>[e,t(e)]))}function ST(e){let t=hT(e),n=hT(t.agent),r=hT(t.inspectors),i=hT(n.tools),a=hT(t.actions),o=gT(t.actions,!0),s=hT(t.redaction),c=hT(t.limits),l=xT(Ww,e=>gT(r[e],!0));return{inspectors:l,agent:{readOnly:gT(n.readOnly,!1),tools:xT(Ww,e=>l[e]&&gT(i[e],!0)),browserTools:gT(n.browserTools,!1)},actions:xT(qw,e=>l[e]&&gT(a[e],o)),redaction:{secretNames:yT(s.secretNames),unmask:yT(s.unmask)},limits:Object.fromEntries(Object.keys(Jw).map(e=>[e,bT(c[e],e)])),popup:{hotkey:TT(hT(t.popup).hotkey)},plugins:wT(t.plugins)}}var CT=100;function wT(e){let t={};for(let[n,r]of Object.entries(hT(e)).slice(0,CT)){if(!Qw.test(n))continue;if(typeof r==`boolean`){t[n]={enabled:r,tools:!0,actions:!0};continue}let e=hT(r);r!==void 0&&Object.keys(e).length&&(t[n]={enabled:gT(e.enabled,!0),tools:gT(e.tools,!0),actions:gT(e.actions,!0)})}return t}function TT(e){return e===!1?!1:rT(e)??`Alt+Shift+P`}function ET(e){let t=e?.configs;return ST(t?.[eT])}function DT(e){return`${{forms:`Writing to forms`,router:`Navigating and clearing navigations`,ngrx:`Restoring NgRx state and dispatching actions`,http:`Changing HTTP mock rules and SSR overrides, and clearing HTTP calls`,analog:`Calling API routes and clearing server calls`,components:`Editing component properties and signals`,tanstackQuery:`Invalidating and refetching TanStack queries`,plugins:`Running plugin actions`}[e]} is turned off in the devtools config (actions.${e}).`}var OT=[`pangular:build-meta`],kT={components:`Components`,injectors:`Injectors`,signals:`Signals`,ngrx:`NgRx`,tanstackQuery:`TanStack Query`,forms:`Forms`,router:`Router`,pipes:`Pipes`,http:`HTTP`,analog:`Analog`,capacitor:`Capacitor`,errors:`Errors`,plugins:`Plugins`},AT={forms:`Form writes`,router:`Navigation`,ngrx:`NgRx restore and dispatch`,http:`HTTP mocking`,analog:`Analog API calls`,components:`Component edits`,tanstackQuery:`TanStack Query invalidate and refetch`,plugins:`Plugin actions`},jT={refreshMs:e=>`poll every ${e} ms`,navigations:e=>`${e} navigations`,formTimeline:e=>`${e} form events`,httpCalls:e=>`${e} HTTP calls`,changeLog:e=>`${e} NgRx changes`,cdCycles:e=>`${e} change detection cycles`,capacitorCalls:e=>`${e} Capacitor plugin calls`,idleAfterMs:e=>e?`idle ${e/1e3} s after the last agent call`:`never idle`};function MT(e){let t=[],n=(e,n)=>{n.length&&t.push({label:e,value:n.join(`, `)})},r=Ww.filter(t=>e.inspectors[t]);n(`Inspectors off`,Ww.filter(t=>!e.inspectors[t]).map(e=>kT[e])),n(`Agent`,e.agent.readOnly?[`Read-only`]:[]),n(`Hidden from the agent`,r.filter(t=>!e.agent.tools[t]).map(e=>kT[e])),n(`Blocked actions`,qw.filter(t=>e.inspectors[t]&&!e.actions[t]).map(e=>AT[e])),n(`Extra secret names`,e.redaction.secretNames),n(`Unmasked names`,e.redaction.unmask),n(`Limits`,Object.keys(Jw).filter(t=>e.limits[t]!==Jw[t].default).map(t=>jT[t](e.limits[t]))),e.popup.hotkey!==`Alt+Shift+P`&&n(`Popup shortcut`,[e.popup.hotkey===!1?`Off`:e.popup.hotkey]);let i=Object.entries(e.plugins??{});return n(`Plugins off`,i.filter(([,e])=>!e.enabled).map(([e])=>e)),n(`Plugin tools or actions off`,i.filter(([,e])=>e.enabled&&(!e.tools||!e.actions)).map(([e,t])=>`${e} (${[!t.tools&&`tools`,!t.actions&&`actions`].filter(Boolean).join(`, `)})`)),t}function NT(e){let t={tags:[],directives:[],text:``},n=e.toLowerCase();return n=n.replace(/<\s*([^<>\s]+)\s*>/g,(e,n)=>(t.tags.push({value:n,exact:!0}),` `)),n=n.replace(/\[\s*([^[\]\s]+)\s*\]/g,(e,n)=>(t.directives.push({value:n,exact:!0}),` `)),n=n.replace(/(^|\s)([<[])([^<>[\]\s]*)$/,(e,n,r,i)=>(i&&(r===`<`?t.tags:t.directives).push({value:i,exact:!1}),n)),t.text=n.replace(/\s+/g,` `).trim(),t}function PT(e){return!e.tags.length&&!e.directives.length&&!e.text}function FT(e,t){let n=e.tag.toLowerCase(),r=(e.directives??[]).map(e=>e.toLowerCase()),i=(e.attributes??[]).map(e=>e.toLowerCase()),a=[...r,...r.map(e=>e.replace(/directive$/,``)),...i];for(let{value:e,exact:r}of t.tags)if(r?n!==e:!n.startsWith(e))return!1;for(let{value:e,exact:n}of t.directives)if(!a.some(t=>n?t===e:t.includes(e)))return!1;if(t.text){let a=t.text;if(!(e.name.toLowerCase().includes(a)||n.includes(a)||r.some(e=>e.includes(a))||i.some(e=>e.includes(a))))return!1}return!0}var IT={debugApi:{subject:`Live data`,since:`12.0`},injectorProviders:{subject:`Reading providers and environment injectors`,since:`16.2`},injectorMetadata:{subject:`The full injector tree`,since:`17.0`},isSignal:{subject:`Telling signals apart in component values`,since:`17.1`},signalGraph:{subject:`The live signal graph`,since:`20.1`},deferBlocks:{subject:`Listing @defer blocks`,since:`19.1`},forBlocks:{subject:`Listing @for blocks`,since:`22.0`},profiler:{subject:`Recording change detection`,since:`20.0`},angularProfiling:{subject:`Angular profiling`,since:`20.0`},routerInstance:{subject:`The router debug util`,since:`20.3`}};function LT(e){let t=/^(\d+)\.(\d+)/.exec(e.trim());return t?`${t[1]}.${t[2]}`:e.trim()}function RT(e){let t=/^(\d+)(?:\.(\d+))?/.exec(e.trim());return t?[Number(t[1]),Number(t[2]??0)]:null}function zT(e,t){let n=RT(e),r=RT(t);return!n||!r?!1:n[0]===r[0]?n[1]>=r[1]:n[0]>r[0]}function BT(e,t){return e?.capabilities?.[t]===!1}function VT(e,t){let n=IT[e],r=`${n.subject} needs Angular ${n.since} or later`;if(!t)return`${r}; this page's Angular version is unknown.`;let i=LT(t);return zT(t,n.since)?`${r} in a development build; this page runs Angular ${i} without it, which usually means a production build.`:`${r}; this page runs Angular ${i}.`}var HT=`pangular-page-id`,UT=null;function WT(e){UT=e}function GT(){if(UT)return UT;try{return new URLSearchParams(location.search).get(`pageId`)||(window.top===window?null:sessionStorage.getItem(HT)||null)}catch{return null}}function KT(e,t){if(t.chosen&&e[t.chosen])return t.chosen;if(t.host)return t.host;if(t.previous&&e[t.previous])return t.previous;let n=null;for(let t of Object.values(e))(!n||t.reportedAt>n.reportedAt)&&(n=t);return n?.pageId??null}function qT(e,t){return e?t?e.pages?.[t]??null:e:null}function JT(e,t){return e?t?e.pages?.[t]??null:e.graph??null:null}function YT(){return{functions:[...OT]}}function XT(e,t,n){return e?e.scope(`pangular`).rpc.call(t,...n===void 0?[]:[n]):Promise.resolve(null)}function ZT(e,t,n){return XT(e,t,n).then(e=>e,()=>null)}function QT(e){return e?.connectionMeta.backend===`static`}function $T(e){let t=()=>{let t=e()?.scope(`pangular`).rpc;t&&(t.callEvent(`request-page-highlight`,null),t.callEvent(`request-form-highlight`,null))};return addEventListener(`pagehide`,t),()=>{removeEventListener(`pagehide`,t),t()}}function eE(e=globalThis){delete e.__DEVFRAME_CONNECTION__,delete e.__DEVFRAME_CONNECTION_META__}function tE(e){return e.split(`@`)[1]??``}var nE={signal:`Signal Forms`,reactive:`Reactive`,template:`Template-driven`},rE={own:`validator`,directive:`template attribute`,tree:`cross-field rule`,async:`async`,parse:`parse`,submission:`server`,schema:`schema`,manual:`setErrors`},iE=ZT,aE={key:`name looks secret`,"input-type":`password input`,autocomplete:`autocomplete is a secret kind`,marker:`marked as mask`,parent:`inside a secret group`,config:`listed in mask`};function oE(e){return aE[e]??e}var sE=`https://pangular-inspector.dev/security/#opt-fields-in-or-out`;async function cE(e,t){return await iE(e,`request-form-action`,t)??{ok:!1,error:`The devtools server did not answer.`}}function lE(e){return`${e.ok?e.message??`Done.`:e.error??`Failed.`}${e.skipped?.length?` Skipped: ${e.skipped.map(e=>`${e.path} (${e.reason})`).join(`, `)}.`:``}${e.status?` Status: ${e.status}.`:``}`}var uE=/"(?:[^"\\\n]|\\.)*"|`([^`\n]*)`|\*\*/g;function dE(e){return(e??``).replace(/^_Labels, paths.*_\n\n/,``).replace(uE,(e,t)=>t??(e===`**`?``:e))}function fE(e){return ET(e?.connectionMeta)}function pE(e,t){return fE(e).actions[t]}var mE={components:`components`,routes:`router`,signals:`signals`,injectors:`injectors`,store:`ngrx`,queries:`tanstackQuery`,forms:`forms`,pipes:`pipes`,network:`http`,analog:`analog`,capacitor:`capacitor`,errors:`errors`,plugins:`plugins`};function hE(e){return mE[e]}var gE=`https://pangular-inspector.dev/getting-started/configuration/#inspectors-and-agent-tools`;function _E(e,t){let n=mE[e];return!n||t.inspectors[n]}function vE(e,t){e&1&&(E(),Ag(0,`rect`,5)(1,`rect`,6)(2,`rect`,7)(3,`rect`,8))}function yE(e,t){e&1&&(E(),Ag(0,`path`,9)(1,`circle`,10)(2,`circle`,11)(3,`path`,12))}function bE(e,t){e&1&&(E(),Ag(0,`path`,13)(1,`path`,14))}function xE(e,t){e&1&&(E(),Ag(0,`path`,15)(1,`path`,16)(2,`path`,17))}function SE(e,t){e&1&&(E(),Ag(0,`circle`,18)(1,`path`,19)(2,`circle`,20))}function CE(e,t){e&1&&(E(),Ag(0,`path`,1))}function wE(e,t){e&1&&(E(),Ag(0,`path`,21)(1,`path`,22)(2,`path`,23)(3,`path`,24))}function TE(e,t){e&1&&(E(),Ag(0,`ellipse`,25)(1,`path`,26)(2,`path`,27))}function EE(e,t){e&1&&(E(),Ag(0,`rect`,28)(1,`path`,29)(2,`path`,30)(3,`path`,31))}function DE(e,t){e&1&&(E(),Ag(0,`circle`,32)(1,`path`,9)(2,`path`,33))}function OE(e,t){e&1&&(E(),Ag(0,`path`,34)(1,`path`,35)(2,`path`,36)(3,`path`,37)(4,`circle`,38))}function kE(e,t){e&1&&(E(),Ag(0,`circle`,39)(1,`path`,40))}function AE(e,t){e&1&&(E(),Ag(0,`ellipse`,41)(1,`path`,42)(2,`path`,43)(3,`path`,44)(4,`path`,45))}function jE(e,t){e&1&&(E(),Ag(0,`circle`,32)(1,`path`,46)(2,`path`,47))}function ME(e,t){e&1&&(E(),Ag(0,`path`,2))}function NE(e,t){e&1&&(E(),Ag(0,`path`,3))}function PE(e,t){e&1&&(E(),Ag(0,`path`,4))}var FE=class e{name=$.required();static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-tab-icon`]],inputs:{name:[1,`name`]},decls:18,vars:1,consts:[[`viewBox`,`0 0 24 24`,`width`,`16`,`height`,`16`,`fill`,`none`,`stroke`,`currentColor`,`stroke-width`,`1.8`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,`aria-hidden`,`true`],[`d`,`M22 12h-4l-3 9L9 3l-3 9H2`],[`d`,`M10 3h4v3a2 2 0 1 0 4 0V5h1a2 2 0 0 1 2 2v4h-2a2 2 0 1 0 0 4h2v4a2 2 0 0 1-2 2h-4v-2a2 2 0 1 0-4 0v2H7a2 2 0 0 1-2-2v-4H4a2 2 0 1 1 0-4h1V7a2 2 0 0 1 2-2h3Z`],[`d`,`m8 3 4 8 5-5 5 15H2L8 3z`],[`fill`,`currentColor`,`stroke`,`none`,`transform`,`translate(1.8 1.8) scale(0.85)`,`d`,`M24 3.7l-5.766 5.766 5.725 5.736-3.713 3.712L5.073 3.742 8.786.03l5.736 5.726L20.284 0 24 3.7zM.029 8.785l3.713-3.713 15.173 15.173-3.713 3.714-5.732-5.726L3.7 24 0 20.285l5.754-5.764L.029 8.785z`],[`x`,`3`,`y`,`3`,`width`,`7`,`height`,`9`,`rx`,`1.5`],[`x`,`14`,`y`,`3`,`width`,`7`,`height`,`5`,`rx`,`1.5`],[`x`,`14`,`y`,`12`,`width`,`7`,`height`,`9`,`rx`,`1.5`],[`x`,`3`,`y`,`16`,`width`,`7`,`height`,`5`,`rx`,`1.5`],[`d`,`M3 12h18`],[`cx`,`7`,`cy`,`12`,`r`,`2`],[`cx`,`14`,`cy`,`12`,`r`,`2`],[`d`,`M18 7v10`],[`d`,`M9 11l2 2 4-4`],[`d`,`M12 3 4 6v6c0 4.5 3.4 8.3 8 9 4.6-.7 8-4.5 8-9V6l-8-3Z`],[`d`,`M12 2 3 7l9 5 9-5-9-5Z`],[`d`,`m3 12 9 5 9-5`],[`d`,`m3 17 9 5 9-5`],[`cx`,`6`,`cy`,`19`,`r`,`3`],[`d`,`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`],[`cx`,`18`,`cy`,`5`,`r`,`3`],[`d`,`M12 22v-5`],[`d`,`M9 8V2`],[`d`,`M15 8V2`],[`d`,`M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z`],[`cx`,`12`,`cy`,`5`,`rx`,`9`,`ry`,`3`],[`d`,`M3 5v14a9 3 0 0 0 18 0V5`],[`d`,`M3 12a9 3 0 0 0 18 0`],[`x`,`3`,`y`,`4`,`width`,`18`,`height`,`16`,`rx`,`2`],[`d`,`M7 9h10`],[`d`,`M7 13h6`],[`d`,`M7 17h8`],[`cx`,`12`,`cy`,`12`,`r`,`9`],[`d`,`M12 3a14 14 0 0 1 0 18a14 14 0 0 1 0-18Z`],[`d`,`M4 7h10`],[`d`,`M4 17h6`],[`d`,`m14 13 4 4-4 4`],[`d`,`M10 17h8`],[`cx`,`18`,`cy`,`7`,`r`,`3`],[`cx`,`12`,`cy`,`12`,`r`,`3`],[`d`,`M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1Z`],[`cx`,`11`,`cy`,`5`,`rx`,`8`,`ry`,`3`],[`d`,`M3 5v6c0 1.66 3.58 3 8 3`],[`d`,`M3 11v6c0 1.66 3.58 3 8 3`],[`d`,`M21 14a4 4 0 1 1-1.2-2.85L21 12.3`],[`d`,`M21 9v3.3h-3.3`],[`d`,`M12 7v6`],[`d`,`M12 16.5v.01`]],template:function(e,t){if(e&1&&(E(),z(0,`svg`,0),j(1,vE,4,0)(2,yE,4,0)(3,bE,2,0)(4,xE,3,0)(5,SE,3,0)(6,CE,1,0,`:svg:path`,1)(7,wE,4,0)(8,TE,3,0)(9,EE,4,0)(10,DE,3,0)(11,OE,5,0)(12,kE,2,0)(13,AE,5,0)(14,jE,3,0)(15,ME,1,0,`:svg:path`,2)(16,NE,1,0,`:svg:path`,3)(17,PE,1,0,`:svg:path`,4),B()),e&2){let e;O(),M((e=t.name())===`dashboard`?1:e===`timeline`?2:e===`audit`?3:e===`components`?4:e===`routes`?5:e===`signals`?6:e===`injectors`?7:e===`store`?8:e===`forms`?9:e===`network`?10:e===`pipes`?11:e===`settings`?12:e===`queries`?13:e===`errors`?14:e===`plugins`?15:e===`analog`?16:e===`capacitor`?17:-1)}},styles:[`[_nghost-%COMP%] { display: inline-flex; flex-shrink: 0; -}`]})},LE=(e,t)=>t.tab,RE=(e,t)=>t.label;function zE(e,t){e&1&&K(0),e&2&&J(` `,W().meta()?.projectName,` `)}function BE(e,t){e&1&&K(0,` Project details unavailable `)}function VE(e,t){e&1&&K(0,` Loading… `)}function HE(e,t){e&1&&(K(0,` Run `),I(1,`code`),K(2,`pangular build`),L(),K(3,` again to rebuild the report. `))}function UE(e,t){e&1&&K(0,` Check that the dev server is running. `)}function WE(e,t){if(e&1){let e=V();I(0,`button`,12),H(`click`,function(){return w(e),T(W(2).loadMeta())}),K(1,`Try again`),L()}}function GE(e,t){if(e&1&&(I(0,`p`,10),j(1,HE,4,0)(2,UE,1,0),L(),j(3,WE,2,0,`button`,11)),e&2){let e=W();O(),M(e.staticReport()?1:2),O(2),M(e.staticReport()?-1:3)}}function KE(e,t){e&1&&(I(0,`li`,5)(1,`span`),K(2,`Analog`),L(),K(3),L()),e&2&&(O(3),q(t))}function qE(e,t){e&1&&(I(0,`li`)(1,`span`),K(2,`Change detection`),L(),K(3),L()),e&2&&(O(3),q(t))}function JE(e,t){if(e&1&&(I(0,`span`,19),K(1),L(),I(2,`span`,20),K(3),L()),e&2){let e=W().$implicit,t=W();O(),q(t.cards()[e.tab]?.value),O(2),q(t.cards()[e.tab]?.sub)}}function YE(e,t){e&1&&(I(0,`span`,21),K(1,`–`),L(),I(2,`span`,20),K(3,`Count unavailable`),L())}function XE(e,t){e&1&&(R(0,`span`,22),I(1,`span`,20),K(2,`Counting…`),L())}function ZE(e,t){if(e&1){let e=V();I(0,`button`,13),H(`click`,function(){let t=w(e).$implicit;return T(W().navigate.emit(t.tab))}),I(1,`span`,14)(2,`span`,15),R(3,`app-tab-icon`,16),L(),I(4,`span`,17),K(5,`→`),L()(),I(6,`span`,18),K(7),L(),j(8,JE,4,2)(9,YE,4,0)(10,XE,3,0),L()}if(e&2){let e,n=t.$implicit,r=t.$index,i=W().stateOf(n.tab);S_(`animation-delay`,60*r,`ms`),A(`aria-busy`,i===`loading`),O(3),F(`name`,n.tab),O(4),q(n.label),O(),M((e=i)===`ready`?8:e===`error`?9:10)}}function QE(e,t){e&1&&(I(0,`p`),K(1,`Loading…`),L())}function $E(e,t){if(e&1&&(I(0,`div`)(1,`dt`),K(2),L(),I(3,`dd`),K(4),L()()),e&2){let e=t.$implicit;O(2),q(e.label),O(2),q(e.value)}}function eD(e,t){if(e&1&&(I(0,`dl`),N(1,$E,5,2,`div`,null,RE),L()),e&2){let e=W();O(),P(e.configItems())}}function tD(e,t){e&1&&(I(0,`p`),K(1,`Defaults`),L())}var nD=[{tab:`components`,label:`Components`},{tab:`routes`,label:`Routes`},{tab:`signals`,label:`Signals`},{tab:`injectors`,label:`Injectors`},{tab:`store`,label:`NgRx declarations`},{tab:`pipes`,label:`Pipes`},{tab:`forms`,label:`Forms`},{tab:`network`,label:`SSR & HTTP`}];function rD(e){return nD.filter(t=>vE(t.tab,e))}var iD={zoneless:`Zoneless`,zone:`zone.js`,"zone-unused":`Zoneless, zone.js loaded`};function aD(e){return e&&Object.hasOwn(iD,e)?iD[e]:null}var oD=new Set([`signal`,`computed`,`linkedSignal`,`effect`]),sD={action:[`action`,`actions`],reducer:[`reducer`,`reducers`],effect:[`effect`,`effects`],selector:[`selector`,`selectors`],feature:[`feature`,`features`],"store-setup":[`setup call`,`setup calls`],"signal-store":[`signal store`,`signal stores`],"signal-state":[`signal state`,`signal states`],"signal-method":[`signal method`,`signal methods`]};function cD(e,t,n){return`${e} ${e===1?t:n}`}function lD(e,t){for(let n of e??[])t(n),lD(n.children,t)}function uD(e){if(!e.some(e=>e.kind))return{value:e.length,sub:`discovered in source`};let t=e.filter(e=>e.kind===`directive`).length;return{value:e.length-t,sub:`components · ${cD(t,`directive`,`directives`)}`}}function dD(e){if(!e.some(e=>e.kind))return{value:e.length,sub:`route entries in source`};let t=e.filter(e=>e.kind===`redirect`).length;return{value:new Set(e.filter(e=>e.kind===`page`).map(e=>e.fullPath??e.path??``)).size,sub:`navigable paths · ${cD(t,`redirect`,`redirects`)}`}}function fD(e){let t=new Map;for(let n of e)n.kind&&t.set(n.kind,(t.get(n.kind)??0)+1);if(!t.size)return{value:e.length,sub:`declarations in source`};let n=[...t].sort((e,t)=>t[1]-e[1]).map(([e,t])=>{let[n,r]=sD[e]??[e,e];return cD(t,n,r)});return{value:e.length,sub:n.join(` · `)}}function pD(e,t){let n=e?.forms??[],r=t?n.filter(e=>nE(e.id)===t):n;if(!r.length)return{value:0,sub:`no forms on the page yet`};let i=r.filter(e=>e.root?.status===`INVALID`).length;return{value:r.length,sub:`${r.length===1?`form`:`forms`} · ${i} invalid`}}function mD(e){return e.cancelled||e.status===void 0?!1:e.status===0||e.status>=400}function hD(e,t){let n=e?.pages??[],r=t?n.find(e=>e.pageId===t)??null:n.reduce((e,t)=>!e||t.reportedAt>e.reportedAt?t:e,null),i=t&&!r?[]:e?.serverCalls??[],a=r?.initialUrl,o=[...a?i.filter(e=>!e.pageUrl||e.pageUrl===a):i,...r?.calls??[]];if(!o.length)return{value:0,sub:`no calls recorded yet`};let s=o.filter(mD).length;return{value:o.length,sub:`${o.length===1?`call`:`calls`} · ${s} failed`}}var gD=class e{rpc=$(null);navigate=bv();staticReport=X(()=>$T(this.rpc()));meta=D(null);config=X(()=>pE(this.rpc()));stats=X(()=>this.rpc()?rD(this.config()):[]);configItems=X(()=>NT(this.config()));metaState=D(`loading`);states=D({});rows=D({});injectorTree=D(null);signalGraph=D(null);formsState=D(null);httpState=D(null);pageId=KT();destroyRef=C(Ns);stopLive=[];zone=X(()=>aD(JT(this.injectorTree(),this.pageId)?.zone));liveInjectors=X(()=>{let e=JT(this.injectorTree(),this.pageId);if(!e?.roots?.length)return null;let t=0,n=0,r=e=>{t++,n+=e.providers?.length??0};return lD(e.roots,r),lD(e.environment,r),{injectors:t,providers:n}});liveSignals=X(()=>{let e=YT(this.signalGraph(),this.pageId);return e?.nodes?.length?e.nodes.filter(e=>oD.has(e.kind??``)).length:null});cards=X(()=>{let e=this.rows(),t={};if(e.components&&(t.components=uD(e.components)),e.routes&&(t.routes=dD(e.routes)),e.store&&(t.store=fD(e.store)),e.pipes){let n=e.pipes.filter(e=>e.builtin).length;t.pipes={value:e.pipes.length-n,sub:n?`custom pipes · ${n} built-in in use`:`custom pipes in source`}}let n=this.liveSignals();n===null?e.signals&&(t.signals={value:e.signals.length,sub:`signal declarations in source`}):t.signals={value:n,sub:e.signals?`live on the page · ${e.signals.length} declared in source`:`live on the page`};let r=this.liveInjectors();r?t.injectors={value:r.injectors,sub:`live injectors · ${cD(r.providers,`provider`,`providers`)}`}:e.injectors&&(t.injectors={value:e.injectors.filter(e=>e.type!==`injection`).length,sub:`provider declarations in source`});let i=this.formsState();i&&(t.forms=pD(i,this.pageId));let a=this.httpState();return a&&(t.network=hD(a,this.pageId)),t});loadMeta(e=this.rpc()){e&&(this.metaState.set(`loading`),e.scope(`pangular`).rpc.call(`build-meta`).then(t=>{this.rpc()===e&&(this.meta.set(t),this.metaState.set(`ready`))}).catch(()=>{this.rpc()===e&&this.metaState.set(`error`)}))}constructor(){bc(()=>{let e=this.rpc();if(!e)return;let t=e.scope(`pangular`);this.states.set({}),this.rows.set({}),this.formsState.set(null),this.httpState.set(null),this.loadMeta(e);let n=pE(e),r=e=>vE(e,n);r(`components`)&&this.load(t.rpc.call(`get-components`),`components`),r(`routes`)&&this.load(t.rpc.call(`get-routes`),`routes`),r(`signals`)&&this.load(t.rpc.call(`get-signals`),`signals`),r(`injectors`)&&this.load(t.rpc.call(`get-providers`),`injectors`),r(`store`)&&this.load(t.rpc.call(`get-ngrx-store`),`store`),r(`pipes`)&&this.load(t.rpc.call(`get-pipes`),`pipes`),this.watchLive(e,n)}),this.destroyRef.onDestroy(()=>this.unwatch())}stateOf(e){return(e===`signals`?this.liveSignals():e===`injectors`?this.liveInjectors():null)===null?this.states()[e]??`loading`:`ready`}load(e,t){let n=e=>this.states.update(n=>({...n,[t]:e}));e.then(e=>{this.rows.update(n=>({...n,[t]:Array.isArray(e)?e:[]})),n(`ready`)}).catch(()=>n(`error`))}async watchLive(e,t){this.unwatch();let n=e.scope(`pangular`).rpc,r=async(t,r,i)=>{let a=e=>i&&this.states.update(t=>({...t,[i]:e}));try{let i=await n.sharedState(t);if(this.destroyRef.destroyed||this.rpc()!==e)return;r(i.value()),a(`ready`),this.stopLive.push(i.on(`updated`,e=>r(e)))}catch{if(this.destroyRef.destroyed||this.rpc()!==e)return;r(null),a(`error`)}};await Promise.all([t.inspectors.injectors&&r(`injector-tree`,e=>this.injectorTree.set(e)),t.inspectors.signals&&r(`signal-graph`,e=>this.signalGraph.set(e)),vE(`forms`,t)&&r(`forms`,e=>this.formsState.set(e??{}),`forms`),vE(`network`,t)&&r(`http`,e=>this.httpState.set(e??{}),`network`)])}unwatch(){for(let e of this.stopLive.splice(0))e()}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-dashboard`]],inputs:{rpc:[1,`rpc`]},outputs:{navigate:`navigate`},decls:33,vars:14,consts:[[`aria-labelledby`,`project-title`,1,`project`],[1,`project-head`],[1,`eyebrow`],[`id`,`project-title`],[1,`chips`],[1,`analog`],[1,`grid`],[`type`,`button`,1,`stat`,3,`animation-delay`],[`aria-labelledby`,`config-title`,1,`config`],[`id`,`config-title`],[1,`hint`],[`type`,`button`,1,`retry`],[`type`,`button`,1,`retry`,3,`click`],[`type`,`button`,1,`stat`,3,`click`],[1,`top`],[1,`icon`],[3,`name`],[`aria-hidden`,`true`,1,`go`],[1,`label`],[1,`big`],[1,`sub`],[1,`big`,`muted`],[`aria-hidden`,`true`,1,`big`,`skeleton`]],template:function(e,t){if(e&1&&(I(0,`section`,0)(1,`div`,1)(2,`p`,2),K(3,`Project`),L(),I(4,`h2`,3),j(5,zE,1,1)(6,BE,1,0)(7,VE,1,0),L(),j(8,GE,4,2),L(),I(9,`ul`,4)(10,`li`)(11,`span`),K(12,`Angular`),L(),K(13),L(),I(14,`li`)(15,`span`),K(16,`TypeScript`),L(),K(17),L(),I(18,`li`)(19,`span`),K(20,`SSR`),L(),K(21),L(),j(22,KE,4,1,`li`,5),j(23,qE,4,1,`li`),L()(),I(24,`div`,6),N(25,ZE,11,6,`button`,7,LE),L(),I(27,`section`,8)(28,`h2`,9),K(29,`Configuration`),L(),j(30,QE,2,0,`p`)(31,eD,3,0,`dl`)(32,tD,2,0,`p`),L()),e&2){let e,n,r;A(`aria-busy`,t.metaState()===`loading`),O(4),G(`muted`,t.metaState()!==`ready`),O(),M((e=t.metaState())===`ready`?5:e===`error`?6:7),O(3),M(t.metaState()===`error`?8:-1),O(),G(`pending`,t.metaState()===`loading`),O(4),q(t.meta()?.angularVersion??`…`),O(4),q(t.meta()?.typescript??`…`),O(4),q(t.meta()?t.meta()?.ssr?`On`:`Off`:`…`),O(),M((n=t.meta()?.analog)?22:-1,n),O(),M((r=t.zone())?23:-1,r),O(2),P(t.stats()),O(2),A(`aria-busy`,!t.rpc()),O(3),M(t.rpc()?t.configItems().length?31:32:30)}},dependencies:[IE],styles:[`[_nghost-%COMP%] { +}`]})},IE=(e,t)=>t.tab,LE=(e,t)=>t.label;function RE(e,t){e&1&&K(0),e&2&&J(` `,W().meta()?.projectName,` `)}function zE(e,t){e&1&&K(0,` Project details unavailable `)}function BE(e,t){e&1&&K(0,` Loading… `)}function VE(e,t){e&1&&(K(0,` Run `),I(1,`code`),K(2,`pangular build`),L(),K(3,` again to rebuild the report. `))}function HE(e,t){e&1&&K(0,` Check that the dev server is running. `)}function UE(e,t){if(e&1){let e=V();I(0,`button`,12),H(`click`,function(){return w(e),T(W(2).loadMeta())}),K(1,`Try again`),L()}}function WE(e,t){if(e&1&&(I(0,`p`,10),j(1,VE,4,0)(2,HE,1,0),L(),j(3,UE,2,0,`button`,11)),e&2){let e=W();O(),M(e.staticReport()?1:2),O(2),M(e.staticReport()?-1:3)}}function GE(e,t){e&1&&(I(0,`li`,5)(1,`span`),K(2,`Analog`),L(),K(3),L()),e&2&&(O(3),q(t))}function KE(e,t){e&1&&(I(0,`li`)(1,`span`),K(2,`Change detection`),L(),K(3),L()),e&2&&(O(3),q(t))}function qE(e,t){if(e&1&&(I(0,`span`,19),K(1),L(),I(2,`span`,20),K(3),L()),e&2){let e=W().$implicit,t=W();O(),q(t.cards()[e.tab]?.value),O(2),q(t.cards()[e.tab]?.sub)}}function JE(e,t){e&1&&(I(0,`span`,21),K(1,`–`),L(),I(2,`span`,20),K(3,`Count unavailable`),L())}function YE(e,t){e&1&&(R(0,`span`,22),I(1,`span`,20),K(2,`Counting…`),L())}function XE(e,t){if(e&1){let e=V();I(0,`button`,13),H(`click`,function(){let t=w(e).$implicit;return T(W().navigate.emit(t.tab))}),I(1,`span`,14)(2,`span`,15),R(3,`app-tab-icon`,16),L(),I(4,`span`,17),K(5,`→`),L()(),I(6,`span`,18),K(7),L(),j(8,qE,4,2)(9,JE,4,0)(10,YE,3,0),L()}if(e&2){let e,n=t.$implicit,r=t.$index,i=W().stateOf(n.tab);x_(`animation-delay`,60*r,`ms`),A(`aria-busy`,i===`loading`),O(3),F(`name`,n.tab),O(4),q(n.label),O(),M((e=i)===`ready`?8:e===`error`?9:10)}}function ZE(e,t){e&1&&(I(0,`p`),K(1,`Loading…`),L())}function QE(e,t){if(e&1&&(I(0,`div`)(1,`dt`),K(2),L(),I(3,`dd`),K(4),L()()),e&2){let e=t.$implicit;O(2),q(e.label),O(2),q(e.value)}}function $E(e,t){if(e&1&&(I(0,`dl`),N(1,QE,5,2,`div`,null,LE),L()),e&2){let e=W();O(),P(e.configItems())}}function eD(e,t){e&1&&(I(0,`p`),K(1,`Defaults`),L())}var tD=[{tab:`components`,label:`Components`},{tab:`routes`,label:`Routes`},{tab:`signals`,label:`Signals`},{tab:`injectors`,label:`Injectors`},{tab:`store`,label:`NgRx declarations`},{tab:`pipes`,label:`Pipes`},{tab:`forms`,label:`Forms`},{tab:`network`,label:`SSR & HTTP`}];function nD(e){return tD.filter(t=>_E(t.tab,e))}var rD={zoneless:`Zoneless`,zone:`zone.js`,"zone-unused":`Zoneless, zone.js loaded`};function iD(e){return e&&Object.hasOwn(rD,e)?rD[e]:null}var aD=new Set([`signal`,`computed`,`linkedSignal`,`effect`]),oD={action:[`action`,`actions`],reducer:[`reducer`,`reducers`],effect:[`effect`,`effects`],selector:[`selector`,`selectors`],feature:[`feature`,`features`],"store-setup":[`setup call`,`setup calls`],"signal-store":[`signal store`,`signal stores`],"signal-state":[`signal state`,`signal states`],"signal-method":[`signal method`,`signal methods`]};function sD(e,t,n){return`${e} ${e===1?t:n}`}function cD(e,t){for(let n of e??[])t(n),cD(n.children,t)}function lD(e){if(!e.some(e=>e.kind))return{value:e.length,sub:`discovered in source`};let t=e.filter(e=>e.kind===`directive`).length;return{value:e.length-t,sub:`components · ${sD(t,`directive`,`directives`)}`}}function uD(e){if(!e.some(e=>e.kind))return{value:e.length,sub:`route entries in source`};let t=e.filter(e=>e.kind===`redirect`).length;return{value:new Set(e.filter(e=>e.kind===`page`).map(e=>e.fullPath??e.path??``)).size,sub:`navigable paths · ${sD(t,`redirect`,`redirects`)}`}}function dD(e){let t=new Map;for(let n of e)n.kind&&t.set(n.kind,(t.get(n.kind)??0)+1);if(!t.size)return{value:e.length,sub:`declarations in source`};let n=[...t].sort((e,t)=>t[1]-e[1]).map(([e,t])=>{let[n,r]=oD[e]??[e,e];return sD(t,n,r)});return{value:e.length,sub:n.join(` · `)}}function fD(e,t){let n=e?.forms??[],r=t?n.filter(e=>tE(e.id)===t):n;if(!r.length)return{value:0,sub:`no forms on the page yet`};let i=r.filter(e=>e.root?.status===`INVALID`).length;return{value:r.length,sub:`${r.length===1?`form`:`forms`} · ${i} invalid`}}function pD(e){return e.cancelled||e.status===void 0?!1:e.status===0||e.status>=400}function mD(e,t){let n=e?.pages??[],r=t?n.find(e=>e.pageId===t)??null:n.reduce((e,t)=>!e||t.reportedAt>e.reportedAt?t:e,null),i=t&&!r?[]:e?.serverCalls??[],a=r?.initialUrl,o=[...a?i.filter(e=>!e.pageUrl||e.pageUrl===a):i,...r?.calls??[]];if(!o.length)return{value:0,sub:`no calls recorded yet`};let s=o.filter(pD).length;return{value:o.length,sub:`${o.length===1?`call`:`calls`} · ${s} failed`}}var hD=class e{rpc=$(null);navigate=yv();staticReport=X(()=>QT(this.rpc()));meta=D(null);config=X(()=>fE(this.rpc()));stats=X(()=>this.rpc()?nD(this.config()):[]);configItems=X(()=>MT(this.config()));metaState=D(`loading`);states=D({});rows=D({});injectorTree=D(null);signalGraph=D(null);formsState=D(null);httpState=D(null);pageId=GT();destroyRef=C(Ns);stopLive=[];zone=X(()=>iD(qT(this.injectorTree(),this.pageId)?.zone));liveInjectors=X(()=>{let e=qT(this.injectorTree(),this.pageId);if(!e?.roots?.length)return null;let t=0,n=0,r=e=>{t++,n+=e.providers?.length??0};return cD(e.roots,r),cD(e.environment,r),{injectors:t,providers:n}});liveSignals=X(()=>{let e=JT(this.signalGraph(),this.pageId);return e?.nodes?.length?e.nodes.filter(e=>aD.has(e.kind??``)).length:null});cards=X(()=>{let e=this.rows(),t={};if(e.components&&(t.components=lD(e.components)),e.routes&&(t.routes=uD(e.routes)),e.store&&(t.store=dD(e.store)),e.pipes){let n=e.pipes.filter(e=>e.builtin).length;t.pipes={value:e.pipes.length-n,sub:n?`custom pipes · ${n} built-in in use`:`custom pipes in source`}}let n=this.liveSignals();n===null?e.signals&&(t.signals={value:e.signals.length,sub:`signal declarations in source`}):t.signals={value:n,sub:e.signals?`live on the page · ${e.signals.length} declared in source`:`live on the page`};let r=this.liveInjectors();r?t.injectors={value:r.injectors,sub:`live injectors · ${sD(r.providers,`provider`,`providers`)}`}:e.injectors&&(t.injectors={value:e.injectors.filter(e=>e.type!==`injection`).length,sub:`provider declarations in source`});let i=this.formsState();i&&(t.forms=fD(i,this.pageId));let a=this.httpState();return a&&(t.network=mD(a,this.pageId)),t});loadMeta(e=this.rpc()){e&&(this.metaState.set(`loading`),e.scope(`pangular`).rpc.call(`build-meta`).then(t=>{this.rpc()===e&&(this.meta.set(t),this.metaState.set(`ready`))}).catch(()=>{this.rpc()===e&&this.metaState.set(`error`)}))}constructor(){bc(()=>{let e=this.rpc();if(!e)return;let t=e.scope(`pangular`);this.states.set({}),this.rows.set({}),this.formsState.set(null),this.httpState.set(null),this.loadMeta(e);let n=fE(e),r=e=>_E(e,n);r(`components`)&&this.load(t.rpc.call(`get-components`),`components`),r(`routes`)&&this.load(t.rpc.call(`get-routes`),`routes`),r(`signals`)&&this.load(t.rpc.call(`get-signals`),`signals`),r(`injectors`)&&this.load(t.rpc.call(`get-providers`),`injectors`),r(`store`)&&this.load(t.rpc.call(`get-ngrx-store`),`store`),r(`pipes`)&&this.load(t.rpc.call(`get-pipes`),`pipes`),this.watchLive(e,n)}),this.destroyRef.onDestroy(()=>this.unwatch())}stateOf(e){return(e===`signals`?this.liveSignals():e===`injectors`?this.liveInjectors():null)===null?this.states()[e]??`loading`:`ready`}load(e,t){let n=e=>this.states.update(n=>({...n,[t]:e}));e.then(e=>{this.rows.update(n=>({...n,[t]:Array.isArray(e)?e:[]})),n(`ready`)}).catch(()=>n(`error`))}async watchLive(e,t){this.unwatch();let n=e.scope(`pangular`).rpc,r=async(t,r,i)=>{let a=e=>i&&this.states.update(t=>({...t,[i]:e}));try{let i=await n.sharedState(t);if(this.destroyRef.destroyed||this.rpc()!==e)return;r(i.value()),a(`ready`),this.stopLive.push(i.on(`updated`,e=>r(e)))}catch{if(this.destroyRef.destroyed||this.rpc()!==e)return;r(null),a(`error`)}};await Promise.all([t.inspectors.injectors&&r(`injector-tree`,e=>this.injectorTree.set(e)),t.inspectors.signals&&r(`signal-graph`,e=>this.signalGraph.set(e)),_E(`forms`,t)&&r(`forms`,e=>this.formsState.set(e??{}),`forms`),_E(`network`,t)&&r(`http`,e=>this.httpState.set(e??{}),`network`)])}unwatch(){for(let e of this.stopLive.splice(0))e()}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-dashboard`]],inputs:{rpc:[1,`rpc`]},outputs:{navigate:`navigate`},decls:33,vars:14,consts:[[`aria-labelledby`,`project-title`,1,`project`],[1,`project-head`],[1,`eyebrow`],[`id`,`project-title`],[1,`chips`],[1,`analog`],[1,`grid`],[`type`,`button`,1,`stat`,3,`animation-delay`],[`aria-labelledby`,`config-title`,1,`config`],[`id`,`config-title`],[1,`hint`],[`type`,`button`,1,`retry`],[`type`,`button`,1,`retry`,3,`click`],[`type`,`button`,1,`stat`,3,`click`],[1,`top`],[1,`icon`],[3,`name`],[`aria-hidden`,`true`,1,`go`],[1,`label`],[1,`big`],[1,`sub`],[1,`big`,`muted`],[`aria-hidden`,`true`,1,`big`,`skeleton`]],template:function(e,t){if(e&1&&(I(0,`section`,0)(1,`div`,1)(2,`p`,2),K(3,`Project`),L(),I(4,`h2`,3),j(5,RE,1,1)(6,zE,1,0)(7,BE,1,0),L(),j(8,WE,4,2),L(),I(9,`ul`,4)(10,`li`)(11,`span`),K(12,`Angular`),L(),K(13),L(),I(14,`li`)(15,`span`),K(16,`TypeScript`),L(),K(17),L(),I(18,`li`)(19,`span`),K(20,`SSR`),L(),K(21),L(),j(22,GE,4,1,`li`,5),j(23,KE,4,1,`li`),L()(),I(24,`div`,6),N(25,XE,11,6,`button`,7,IE),L(),I(27,`section`,8)(28,`h2`,9),K(29,`Configuration`),L(),j(30,ZE,2,0,`p`)(31,$E,3,0,`dl`)(32,eD,2,0,`p`),L()),e&2){let e,n,r;A(`aria-busy`,t.metaState()===`loading`),O(4),G(`muted`,t.metaState()!==`ready`),O(),M((e=t.metaState())===`ready`?5:e===`error`?6:7),O(3),M(t.metaState()===`error`?8:-1),O(),G(`pending`,t.metaState()===`loading`),O(4),q(t.meta()?.angularVersion??`…`),O(4),q(t.meta()?.typescript??`…`),O(4),q(t.meta()?t.meta()?.ssr?`On`:`Off`:`…`),O(),M((n=t.meta()?.analog)?22:-1,n),O(),M((r=t.zone())?23:-1,r),O(2),P(t.stats()),O(2),A(`aria-busy`,!t.rpc()),O(3),M(t.rpc()?t.configItems().length?31:32:30)}},dependencies:[FE],styles:[`[_nghost-%COMP%] { display: block; max-width: 1200px; } @@ -325,7 +325,7 @@ h2.muted[_ngcontent-%COMP%] { .skeleton[_ngcontent-%COMP%] { animation: none; } -}`]})},_D=`pangular:panel-action-result`,vD=6e3,yD=0;function bD(e=window){return e.location.protocol===`chrome-extension:`&&e.parent!==e}function xD(e,t=window){let n=`pa-${Date.now().toString(36)}-${++yD}`;return new Promise(r=>{let i=e=>{t.clearTimeout(o),t.removeEventListener(`message`,a),r(e)},a=({source:e,origin:r,data:a})=>{if(e!==t.parent||r!==t.location.origin)return;let o=a;if(o?.type!==_D||o.requestId!==n)return;let{opened:s,error:c}=a;i({ok:o.ok===!0,...s===`file`||s===`class`?{opened:s}:{},...typeof c==`string`?{error:c}:{}})},o=t.setTimeout(()=>i({ok:!1,error:`timeout`}),vD);t.addEventListener(`message`,a),t.parent.postMessage({...e,requestId:n},t.location.origin)})}var SD=class e{available=bD();reveal(e,t){return xD({type:`pangular:reveal-element`,pageId:e,id:t})}openSource(e,t,n){return xD({type:`pangular:open-source`,pageId:e,id:t,...n?{file:n.file,line:n.line}:{}})}static ɵfac=function(t){return new(t||e)};static ɵprov=Vl({token:e,factory:e.ɵfac})};function CD(e){let t=e?.pages;return t&&typeof t==`object`?t:{}}function wD(e){let t=C(Ns),n=D({}),r=null,i=null,a=async e=>{i?.(),i=null,r=e;try{let a=await e.scope(`pangular`).rpc.sharedState(`page-angular`);if(t.destroyed||r!==e)return;let o=e=>n.set(CD(e));o(a.value()),i=a.on(`updated`,o)}catch{r===e&&n.set({})}};return bc(()=>{let t=e();t&&t!==r&&Z(()=>void a(t))}),t.onDestroy(()=>i?.()),n.asReadonly()}function TD(e,t){if(t)return e[t]??null;let n=null;for(let t of Object.values(e))(!n||t.reportedAt>n.reportedAt)&&(n=t);return n}var ED=[`*`];function DD(e,t){if(e&1&&(z(0,`div`,1)(1,`p`,2),K(2),B(),z(3,`p`,3),K(4),Zg(5),z(6,`a`,4),K(7,`Supported versions`),B()()()),e&2){let e=W();G(`compact`,e.compact()),O(2),q(e.title()),O(2),J(` `,t,` `),O(2),Lg(`href`,e.docsUrl,Au)}}var OD=`https://pangular-inspector.dev/getting-started/installation/#supported-angular-versions`,kD=class e{page=$(null);capability=$.required();missing=$(!1,{transform:jv});compact=$(!1,{transform:jv});docsUrl=OD;text=X(()=>{let e=this.page();return!this.missing()&&!VT(e,this.capability())?null:HT(this.capability(),e?.version)});title=X(()=>{let e=this.page()?.version;return e?`Not available on Angular ${RT(e)}`:`Not available on this page`});static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-angular-unavailable`]],inputs:{page:[1,`page`],capability:[1,`capability`],missing:[1,`missing`],compact:[1,`compact`]},ngContentSelectors:ED,decls:1,vars:1,consts:[[`role`,`status`,1,`unavailable`,3,`compact`],[`role`,`status`,1,`unavailable`],[1,`title`],[1,`hint`],[`target`,`_blank`,`rel`,`noopener noreferrer`,3,`href`]],template:function(e,t){if(e&1&&(Xg(),j(0,DD,8,5,`div`,0)),e&2){let e;M((e=t.text())?0:-1,e)}},styles:[`[_nghost-%COMP%] { +}`]})},gD=`pangular:panel-action-result`,_D=6e3,vD=0;function yD(e=window){return e.location.protocol===`chrome-extension:`&&e.parent!==e}function bD(e,t=window){let n=`pa-${Date.now().toString(36)}-${++vD}`;return new Promise(r=>{let i=e=>{t.clearTimeout(o),t.removeEventListener(`message`,a),r(e)},a=({source:e,origin:r,data:a})=>{if(e!==t.parent||r!==t.location.origin)return;let o=a;if(o?.type!==gD||o.requestId!==n)return;let{opened:s,error:c}=a;i({ok:o.ok===!0,...s===`file`||s===`class`?{opened:s}:{},...typeof c==`string`?{error:c}:{}})},o=t.setTimeout(()=>i({ok:!1,error:`timeout`}),_D);t.addEventListener(`message`,a),t.parent.postMessage({...e,requestId:n},t.location.origin)})}var xD=class e{available=yD();reveal(e,t){return bD({type:`pangular:reveal-element`,pageId:e,id:t})}openSource(e,t,n){return bD({type:`pangular:open-source`,pageId:e,id:t,...n?{file:n.file,line:n.line}:{}})}static ɵfac=function(t){return new(t||e)};static ɵprov=Vl({token:e,factory:e.ɵfac})};function SD(e){let t=e?.pages;return t&&typeof t==`object`?t:{}}function CD(e){let t=C(Ns),n=D({}),r=null,i=null,a=async e=>{i?.(),i=null,r=e;try{let a=await e.scope(`pangular`).rpc.sharedState(`page-angular`);if(t.destroyed||r!==e)return;let o=e=>n.set(SD(e));o(a.value()),i=a.on(`updated`,o)}catch{r===e&&n.set({})}};return bc(()=>{let t=e();t&&t!==r&&Z(()=>void a(t))}),t.onDestroy(()=>i?.()),n.asReadonly()}function wD(e,t){if(t)return e[t]??null;let n=null;for(let t of Object.values(e))(!n||t.reportedAt>n.reportedAt)&&(n=t);return n}var TD=[`*`];function ED(e,t){if(e&1&&(z(0,`div`,1)(1,`p`,2),K(2),B(),z(3,`p`,3),K(4),Xg(5),z(6,`a`,4),K(7,`Supported versions`),B()()()),e&2){let e=W();G(`compact`,e.compact()),O(2),q(e.title()),O(2),J(` `,t,` `),O(2),Ig(`href`,e.docsUrl,Au)}}var DD=`https://pangular-inspector.dev/getting-started/installation/#supported-angular-versions`,OD=class e{page=$(null);capability=$.required();missing=$(!1,{transform:Av});compact=$(!1,{transform:Av});docsUrl=DD;text=X(()=>{let e=this.page();return!this.missing()&&!BT(e,this.capability())?null:VT(this.capability(),e?.version)});title=X(()=>{let e=this.page()?.version;return e?`Not available on Angular ${LT(e)}`:`Not available on this page`});static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-angular-unavailable`]],inputs:{page:[1,`page`],capability:[1,`capability`],missing:[1,`missing`],compact:[1,`compact`]},ngContentSelectors:TD,decls:1,vars:1,consts:[[`role`,`status`,1,`unavailable`,3,`compact`],[`role`,`status`,1,`unavailable`],[1,`title`],[1,`hint`],[`target`,`_blank`,`rel`,`noopener noreferrer`,3,`href`]],template:function(e,t){if(e&1&&(Yg(),j(0,ED,8,5,`div`,0)),e&2){let e;M((e=t.text())?0:-1,e)}},styles:[`[_nghost-%COMP%] { display: block; } @@ -372,7 +372,7 @@ a[_ngcontent-%COMP%] { a[_ngcontent-%COMP%]:focus-visible { outline: 2px solid var(--%NS%accent); outline-offset: 2px; -}`]})};function AD(e){return e?.platform===`angular-native`}function jD(e){return AD(e)||e?.platform===`nativescript`}function MD(e,t){let n=Object.values(e??{}).filter(AD);if(t&&n.some(e=>e.pageId===t))return t;let r=null;for(let e of n)(!r||e.reportedAt>r.reportedAt)&&(r=e);return r?.pageId??null}var ND=[`trigger`],PD=[`list`],FD=(e,t)=>t.value;function ID(e,t){if(e&1&&(z(0,`span`,4),K(1),B()),e&2){let e=W();O(),q(e.current().hint)}}function LD(e,t){if(e&1&&(z(0,`span`,15),K(1),B()),e&2){let e=W().$implicit;O(),q(e.hint)}}function RD(e,t){if(e&1){let e=V();z(0,`li`,11),U(`pointerenter`,function(){let t=w(e).$index;return T(W(2).active.set(t))})(`pointerdown`,function(e){return e.preventDefault()})(`click`,function(){let t=w(e).$index;return T(W(2).choose(t))}),E(),z(1,`svg`,12),jg(2,`path`,13),B(),Cs(),z(3,`span`,14),K(4),B(),j(5,LD,2,1,`span`,15),B()}if(e&2){let e=t.$implicit,n=t.$index,r=W(2);G(`active`,n===r.active())(`selected`,e.value===r.value()),A(`id`,r.uid+`-opt-`+n)(`aria-selected`,e.value===r.value())(`aria-disabled`,e.disabled||null),O(4),q(e.label),O(),M(e.hint?5:-1)}}function zD(e,t){if(e&1&&(z(0,`li`,10),K(1),B()),e&2){let e=W(2);O(),q(e.emptyText())}}function BD(e,t){if(e&1&&(z(0,`ul`,8,1),sg(`list-in`),U(`pointerdown`,function(e){return e.preventDefault()}),N(2,RD,6,9,`li`,9,FD,!1,zD,2,1,`li`,10),B()),e&2){let e=W();G(`up`,e.dropUp()),A(`id`,e.uid+`-list`)(`aria-labelledby`,e.labelledBy()||e.uid+`-trigger`),O(2),P(e.options())}}var VD=0,HD=class e{options=$.required();value=Tv(null);placeholder=$(`Select…`);ariaLabel=$(``);labelledBy=$(``);describedBy=$(``);disabled=$(!1);emptyText=$(`Nothing to choose`);uid=`app-select-${++VD}`;open=D(!1);active=D(-1);dropUp=D(!1);current=X(()=>this.options().find(e=>e.value===this.value())??null);host=C(Wl);injector=C(js);trigger=Dv.required(`trigger`);list=Dv(`list`);typed=``;typedAt=0;toggle(){this.open()?this.close():this.show()}choose(e){let t=this.options()[e];t&&!t.disabled&&(this.value.set(t.value),this.close(),this.trigger().nativeElement.focus())}onKey(e){let t=this.options(),n=this.open();switch(e.key){case`ArrowDown`:case`ArrowUp`:if(e.preventDefault(),!n){this.show();return}this.move(e.key===`ArrowDown`?1:-1);return;case`Home`:case`End`:if(!n)return;e.preventDefault(),this.setActive(e.key===`Home`?this.firstEnabled(0,1):this.firstEnabled(t.length-1,-1));return;case`Enter`:case` `:e.preventDefault(),n&&this.active()>=0?this.choose(this.active()):this.show();return;case`Escape`:if(!n)return;e.preventDefault(),e.stopPropagation(),this.close();return;case`Tab`:n&&this.close();return;default:e.key.length===1&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&this.typeAhead(e.key)}}onBlur(e){let t=e.relatedTarget;t&&this.host.nativeElement.contains(t)||this.close()}onOutside(e){this.open()&&!this.host.nativeElement.contains(e.target)&&this.close()}show(){if(this.disabled())return;let e=this.host.nativeElement.getBoundingClientRect(),t=window.innerHeight-e.bottom;this.dropUp.set(t<220&&e.top>t);let n=this.options().findIndex(e=>e.value===this.value());this.open.set(!0),this.setActive(n>=0?n:this.firstEnabled(0,1))}close(){this.open.set(!1),this.active.set(-1)}move(e){let t=this.firstEnabled(this.active()+e,e);t>=0&&this.setActive(t)}firstEnabled(e,t){let n=this.options();for(let r=e;r>=0&&r{(this.list()?.nativeElement.querySelector(`#${this.uid}-opt-${e}`))?.scrollIntoView({block:`nearest`})},{injector:this.injector})}typeAhead(e){let t=performance.now();this.typed=t-this.typedAt>600?e.toLowerCase():this.typed+e.toLowerCase(),this.typedAt=t;let n=this.options().findIndex(e=>!e.disabled&&e.label.toLowerCase().startsWith(this.typed));n<0||(this.open()?this.setActive(n):this.value.set(this.options()[n].value))}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-select`]],viewQuery:function(e,t){e&1&&$g(t.trigger,ND,5)(t.list,PD,5),e&2&&e_(2)},hostAttrs:[1,`app-select`],hostVars:2,hostBindings:function(e,t){e&1&&H(`pointerdown`,function(e){return t.onOutside(e)},Mu),e&2&&G(`open`,t.open())},inputs:{options:[1,`options`],value:[1,`value`],placeholder:[1,`placeholder`],ariaLabel:[1,`ariaLabel`],labelledBy:[1,`labelledBy`],describedBy:[1,`describedBy`],disabled:[1,`disabled`],emptyText:[1,`emptyText`]},outputs:{value:`valueChange`},decls:8,vars:13,consts:[[`trigger`,``],[`list`,``],[`type`,`button`,`role`,`combobox`,`aria-haspopup`,`listbox`,1,`trigger`,3,`click`,`keydown`,`blur`,`disabled`],[1,`value`],[1,`value-hint`],[`viewBox`,`0 0 24 24`,`aria-hidden`,`true`,1,`chevron`],[`d`,`m6 9 6 6 6-6`],[`role`,`listbox`,`tabindex`,`-1`,1,`list`,3,`up`],[`role`,`listbox`,`tabindex`,`-1`,1,`list`,3,`pointerdown`],[`role`,`option`,3,`active`,`selected`],[`role`,`option`,`aria-disabled`,`true`,1,`empty`],[`role`,`option`,3,`pointerenter`,`pointerdown`,`click`],[`viewBox`,`0 0 24 24`,`aria-hidden`,`true`,1,`check`],[`d`,`m5 12 5 5 9-10`],[1,`label`],[1,`hint`]],template:function(e,t){e&1&&(z(0,`button`,2,0),U(`click`,function(){return t.toggle()})(`keydown`,function(e){return t.onKey(e)})(`blur`,function(e){return t.onBlur(e)}),z(2,`span`,3),K(3),B(),j(4,ID,2,1,`span`,4),E(),z(5,`svg`,5),jg(6,`path`,6),B()(),j(7,BD,5,5,`ul`,7)),e&2&&(Lg(`disabled`,t.disabled()),A(`id`,t.uid+`-trigger`)(`aria-controls`,t.uid+`-list`)(`aria-expanded`,t.open())(`aria-label`,t.ariaLabel()||null)(`aria-labelledby`,t.labelledBy()||null)(`aria-describedby`,t.describedBy()||null)(`aria-activedescendant`,t.open()&&t.active()>=0?t.uid+`-opt-`+t.active():null),O(2),G(`placeholder`,!t.current()),O(),J(` `,t.current()?.label??t.placeholder(),` `),O(),M(t.current()?.hint?4:-1),O(3),M(t.open()?7:-1))},styles:[`[_nghost-%COMP%] { +}`]})};function kD(e){return e?.platform===`angular-native`}function AD(e){return kD(e)||e?.platform===`nativescript`}function jD(e,t){let n=Object.values(e??{}).filter(kD);if(t&&n.some(e=>e.pageId===t))return t;let r=null;for(let e of n)(!r||e.reportedAt>r.reportedAt)&&(r=e);return r?.pageId??null}var MD=[`trigger`],ND=[`list`],PD=(e,t)=>t.value;function FD(e,t){if(e&1&&(z(0,`span`,4),K(1),B()),e&2){let e=W();O(),q(e.current().hint)}}function ID(e,t){if(e&1&&(z(0,`span`,15),K(1),B()),e&2){let e=W().$implicit;O(),q(e.hint)}}function LD(e,t){if(e&1){let e=V();z(0,`li`,11),U(`pointerenter`,function(){let t=w(e).$index;return T(W(2).active.set(t))})(`pointerdown`,function(e){return e.preventDefault()})(`click`,function(){let t=w(e).$index;return T(W(2).choose(t))}),E(),z(1,`svg`,12),Ag(2,`path`,13),B(),Cs(),z(3,`span`,14),K(4),B(),j(5,ID,2,1,`span`,15),B()}if(e&2){let e=t.$implicit,n=t.$index,r=W(2);G(`active`,n===r.active())(`selected`,e.value===r.value()),A(`id`,r.uid+`-opt-`+n)(`aria-selected`,e.value===r.value())(`aria-disabled`,e.disabled||null),O(4),q(e.label),O(),M(e.hint?5:-1)}}function RD(e,t){if(e&1&&(z(0,`li`,10),K(1),B()),e&2){let e=W(2);O(),q(e.emptyText())}}function zD(e,t){if(e&1&&(z(0,`ul`,8,1),og(`list-in`),U(`pointerdown`,function(e){return e.preventDefault()}),N(2,LD,6,9,`li`,9,PD,!1,RD,2,1,`li`,10),B()),e&2){let e=W();G(`up`,e.dropUp()),A(`id`,e.uid+`-list`)(`aria-labelledby`,e.labelledBy()||e.uid+`-trigger`),O(2),P(e.options())}}var BD=0,VD=class e{options=$.required();value=wv(null);placeholder=$(`Select…`);ariaLabel=$(``);labelledBy=$(``);describedBy=$(``);disabled=$(!1);emptyText=$(`Nothing to choose`);uid=`app-select-${++BD}`;open=D(!1);active=D(-1);dropUp=D(!1);current=X(()=>this.options().find(e=>e.value===this.value())??null);host=C(Wl);injector=C(js);trigger=Ev.required(`trigger`);list=Ev(`list`);typed=``;typedAt=0;toggle(){this.open()?this.close():this.show()}choose(e){let t=this.options()[e];t&&!t.disabled&&(this.value.set(t.value),this.close(),this.trigger().nativeElement.focus())}onKey(e){let t=this.options(),n=this.open();switch(e.key){case`ArrowDown`:case`ArrowUp`:if(e.preventDefault(),!n){this.show();return}this.move(e.key===`ArrowDown`?1:-1);return;case`Home`:case`End`:if(!n)return;e.preventDefault(),this.setActive(e.key===`Home`?this.firstEnabled(0,1):this.firstEnabled(t.length-1,-1));return;case`Enter`:case` `:e.preventDefault(),n&&this.active()>=0?this.choose(this.active()):this.show();return;case`Escape`:if(!n)return;e.preventDefault(),e.stopPropagation(),this.close();return;case`Tab`:n&&this.close();return;default:e.key.length===1&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&this.typeAhead(e.key)}}onBlur(e){let t=e.relatedTarget;t&&this.host.nativeElement.contains(t)||this.close()}onOutside(e){this.open()&&!this.host.nativeElement.contains(e.target)&&this.close()}show(){if(this.disabled())return;let e=this.host.nativeElement.getBoundingClientRect(),t=window.innerHeight-e.bottom;this.dropUp.set(t<220&&e.top>t);let n=this.options().findIndex(e=>e.value===this.value());this.open.set(!0),this.setActive(n>=0?n:this.firstEnabled(0,1))}close(){this.open.set(!1),this.active.set(-1)}move(e){let t=this.firstEnabled(this.active()+e,e);t>=0&&this.setActive(t)}firstEnabled(e,t){let n=this.options();for(let r=e;r>=0&&r{(this.list()?.nativeElement.querySelector(`#${this.uid}-opt-${e}`))?.scrollIntoView({block:`nearest`})},{injector:this.injector})}typeAhead(e){let t=performance.now();this.typed=t-this.typedAt>600?e.toLowerCase():this.typed+e.toLowerCase(),this.typedAt=t;let n=this.options().findIndex(e=>!e.disabled&&e.label.toLowerCase().startsWith(this.typed));n<0||(this.open()?this.setActive(n):this.value.set(this.options()[n].value))}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-select`]],viewQuery:function(e,t){e&1&&Qg(t.trigger,MD,5)(t.list,ND,5),e&2&&$g(2)},hostAttrs:[1,`app-select`],hostVars:2,hostBindings:function(e,t){e&1&&H(`pointerdown`,function(e){return t.onOutside(e)},Mu),e&2&&G(`open`,t.open())},inputs:{options:[1,`options`],value:[1,`value`],placeholder:[1,`placeholder`],ariaLabel:[1,`ariaLabel`],labelledBy:[1,`labelledBy`],describedBy:[1,`describedBy`],disabled:[1,`disabled`],emptyText:[1,`emptyText`]},outputs:{value:`valueChange`},decls:8,vars:13,consts:[[`trigger`,``],[`list`,``],[`type`,`button`,`role`,`combobox`,`aria-haspopup`,`listbox`,1,`trigger`,3,`click`,`keydown`,`blur`,`disabled`],[1,`value`],[1,`value-hint`],[`viewBox`,`0 0 24 24`,`aria-hidden`,`true`,1,`chevron`],[`d`,`m6 9 6 6 6-6`],[`role`,`listbox`,`tabindex`,`-1`,1,`list`,3,`up`],[`role`,`listbox`,`tabindex`,`-1`,1,`list`,3,`pointerdown`],[`role`,`option`,3,`active`,`selected`],[`role`,`option`,`aria-disabled`,`true`,1,`empty`],[`role`,`option`,3,`pointerenter`,`pointerdown`,`click`],[`viewBox`,`0 0 24 24`,`aria-hidden`,`true`,1,`check`],[`d`,`m5 12 5 5 9-10`],[1,`label`],[1,`hint`]],template:function(e,t){e&1&&(z(0,`button`,2,0),U(`click`,function(){return t.toggle()})(`keydown`,function(e){return t.onKey(e)})(`blur`,function(e){return t.onBlur(e)}),z(2,`span`,3),K(3),B(),j(4,FD,2,1,`span`,4),E(),z(5,`svg`,5),Ag(6,`path`,6),B()(),j(7,zD,5,5,`ul`,7)),e&2&&(Ig(`disabled`,t.disabled()),A(`id`,t.uid+`-trigger`)(`aria-controls`,t.uid+`-list`)(`aria-expanded`,t.open())(`aria-label`,t.ariaLabel()||null)(`aria-labelledby`,t.labelledBy()||null)(`aria-describedby`,t.describedBy()||null)(`aria-activedescendant`,t.open()&&t.active()>=0?t.uid+`-opt-`+t.active():null),O(2),G(`placeholder`,!t.current()),O(),J(` `,t.current()?.label??t.placeholder(),` `),O(),M(t.current()?.hint?4:-1),O(3),M(t.open()?7:-1))},styles:[`[_nghost-%COMP%] { position: relative; display: inline-flex; min-width: 0; @@ -567,7 +567,7 @@ li.selected[_ngcontent-%COMP%] .check[_ngcontent-%COMP%] { .chevron[_ngcontent-%COMP%] { transition: none; } -}`]})};function UD(e,t){let n=PT(t);if(FT(n))return{nodes:e,matches:0};let r=0,i=e=>e.flatMap(e=>{let t=IT(e,n);t&&r++;let a=i(e.children);return t||a.length?[{...e,children:a}]:[]});return{nodes:i(e),matches:r}}function WD(e){return e.flatMap(e=>e.kind===`directive`?WD(e.children):[{...e,children:WD(e.children)}])}function GD(e){return(e.attributes?.length?e.attributes:e.directives??[e.name]).map(e=>`[${e}]`).join(` `)}var KD={hydrated:`Hydrated`,skipped:`Skipped`,mismatched:`Mismatch`,client:`Client`};function qD(e){return KD[e]}function JD(e,t,n,r=!1,i=0){let a=r?`${e}+`:`${e}`;if(n)return`${t} of ${r?`${e+i}+`:e+i}`;let o=i?` · ${i} directive ${i===1?`host`:`hosts`}`:``;return`${a} ${e===1&&!r?`instance`:`instances`}${o}`}function YD(e,t,n,r=!1,i=0){if(!n.trim())return``;if(!t)return`No components match.`;let a=e+i,o=r?`${a}+`:`${a}`,s=!r&&a===1;return`${t} of ${o} ${i?s?`row`:`rows`:s?`instance`:`instances`} match.`}function XD(e){let t=e?.components,n=e?.depth;return t&&n?`Showing the first ${t} component instances, and none nested more than ${n} elements deep. Others are not listed or searchable.`:t?`Showing the first ${t} component instances. Others are not listed or searchable.`:n?`Components nested more than ${n} elements deep are not listed or searchable.`:`The page has more components than the tree shows.`}function ZD(e,t){let n=t?.detail?.id??null,r=t?.pageId??null;if(r!==e.pageId)return{pageId:r,selectedId:n,detailId:n,destroyed:null};let i=e.selectedId;return n&&n!==e.detailId&&n!==i&&(i=n),i&&t&&!t.truncated&&!QD(t.roots,i)?{pageId:r,selectedId:null,detailId:n,destroyed:i}:{pageId:r,selectedId:i,detailId:n,destroyed:null}}function QD(e,t){return e.some(e=>e.id===t||QD(e.children,t))}function $D(e,t,n){let r=e.indexOf(n);if(r<0)return null;for(let n=r+1;n=0;n--)if(t.has(e[n]))return e[n];return null}var eO=(e,t)=>t.key,tO=(e,t)=>t.id;function nO(e,t){e&1&&(z(0,`p`,2),K(1,` The HTML came from the server, but no component was hydrated, so the app rendered again on the client. Add `),z(2,`code`),K(3,`provideClientHydration()`),B(),K(4,` and use a development build to see each component's status. `),B())}function rO(e,t){if(e&1&&(z(0,`li`)(1,`span`,9),K(2),B(),K(3),B()),e&2){let e=t.$implicit;C_(`count count-`+e.key),O(2),q(e.value),O(),J(` `,e.label,` `)}}function iO(e,t){if(e&1&&(z(0,`span`,15),K(1,`Expected `),z(2,`code`),K(3),B()()),e&2){let e=W().$implicit;O(3),q(e.expected)}}function aO(e,t){if(e&1&&(z(0,`span`,15),K(1,`Found `),z(2,`code`),K(3),B()()),e&2){let e=W().$implicit;O(3),q(e.actual)}}function oO(e,t){if(e&1){let e=V();z(0,`li`)(1,`button`,12),U(`click`,function(){let t=w(e).$implicit;return T(W(4).showNode.emit(t.id))})(`focus`,function(){let t=w(e).$implicit;return T(W(4).highlight.emit(t.id))})(`blur`,function(){return w(e),T(W(4).highlight.emit(null))})(`mouseenter`,function(){let t=w(e).$implicit;return T(W(4).highlight.emit(t.id))})(`mouseleave`,function(){return w(e),T(W(4).highlight.emit(null))}),z(2,`span`,13),K(3),B(),z(4,`span`,14),K(5),B(),j(6,iO,4,1,`span`,15),j(7,aO,4,1,`span`,15),B()()}if(e&2){let e=t.$implicit;O(3),q(e.name),O(2),J(`<`,e.tag,`>`),O(),M(e.expected?6:-1),O(),M(e.actual?7:-1)}}function sO(e,t){if(e&1&&(z(0,`h3`,10),K(1,`Mismatches`),B(),z(2,`ul`,11),N(3,oO,8,4,`li`,null,tO),B()),e&2){let e=W(2);O(3),P(e.mismatches)}}function cO(e,t){if(e&1){let e=V();z(0,`div`,3)(1,`ul`,4),N(2,rO,4,4,`li`,5,eO),B(),z(4,`button`,6),U(`click`,function(){return w(e),T(W(2).toggleOverlay())}),E(),z(5,`svg`,7),jg(6,`rect`,8),B(),K(7,` Outline on page `),B()(),j(8,sO,5,0)}if(e&2){let e=W(),t=W();O(2),P(t.counts()),O(2),A(`aria-pressed`,t.overlayOn()),O(4),M(e.mismatches.length?8:-1)}}function lO(e,t){e&1&&j(0,nO,5,0,`p`,2)(1,cO,9,2),e&2&&M(+!!t.hydrated)}function uO(e,t){e&1&&(z(0,`p`,2),K(1,` This page was not rendered on the server, so there is nothing to hydrate. With server-side rendering and `),z(2,`code`),K(3,`provideClientHydration()`),B(),K(4,`, each component shows whether it was hydrated, skipped or mismatched. `),B())}var dO=class e{report=$(void 0);overlay=bv();showNode=bv();highlight=bv();overlayOn=Q(()=>this.report()?.overlay===!0);counts=X(()=>{let e=this.report()?.counts;return e?[{key:`hydrated`,label:`hydrated`,value:e.hydrated},{key:`skipped`,label:`skipped`,value:e.skipped},{key:`mismatched`,label:`mismatched`,value:e.mismatched},{key:`client`,label:`created on the client`,value:e.client},{key:`dehydratedBlocks`,label:e.dehydratedBlocks===1?`dehydrated @defer block`:`dehydrated @defer blocks`,value:e.dehydratedBlocks}]:[]});toggleOverlay(){let e=!this.overlayOn();this.overlayOn.set(e),this.overlay.emit(e)}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-hydration-section`]],inputs:{report:[1,`report`]},outputs:{overlay:`overlay`,showNode:`showNode`,highlight:`highlight`},decls:5,vars:1,consts:[[`aria-labelledby`,`ct-hydration-title`,1,`hydration`],[`id`,`ct-hydration-title`,1,`title`],[1,`empty`],[1,`summary`],[`aria-label`,`Hydration summary`,1,`counts`],[3,`class`],[`type`,`button`,1,`outline`,3,`click`],[`viewBox`,`0 0 24 24`,`aria-hidden`,`true`],[`x`,`3`,`y`,`3`,`width`,`18`,`height`,`18`,`rx`,`2`,`stroke-dasharray`,`4 3`],[1,`num`],[1,`label`],[1,`mismatches`],[`type`,`button`,1,`mismatch`,3,`click`,`focus`,`blur`,`mouseenter`,`mouseleave`],[1,`name`,`mono`],[1,`mono`,`muted`],[1,`detail-line`]],template:function(e,t){if(e&1&&(z(0,`section`,0)(1,`h2`,1),K(2,`Hydration`),B(),j(3,lO,2,1)(4,uO,5,0,`p`,2),B()),e&2){let e;O(3),M((e=t.report())?3:4,e)}},styles:[`.hydration[_ngcontent-%COMP%] { +}`]})};function HD(e,t){let n=NT(t);if(PT(n))return{nodes:e,matches:0};let r=0,i=e=>e.flatMap(e=>{let t=FT(e,n);t&&r++;let a=i(e.children);return t||a.length?[{...e,children:a}]:[]});return{nodes:i(e),matches:r}}function UD(e){return e.flatMap(e=>e.kind===`directive`?UD(e.children):[{...e,children:UD(e.children)}])}function WD(e){return(e.attributes?.length?e.attributes:e.directives??[e.name]).map(e=>`[${e}]`).join(` `)}var GD={hydrated:`Hydrated`,skipped:`Skipped`,mismatched:`Mismatch`,client:`Client`};function KD(e){return GD[e]}function qD(e,t,n,r=!1,i=0){let a=r?`${e}+`:`${e}`;if(n)return`${t} of ${r?`${e+i}+`:e+i}`;let o=i?` · ${i} directive ${i===1?`host`:`hosts`}`:``;return`${a} ${e===1&&!r?`instance`:`instances`}${o}`}function JD(e,t,n,r=!1,i=0){if(!n.trim())return``;if(!t)return`No components match.`;let a=e+i,o=r?`${a}+`:`${a}`,s=!r&&a===1;return`${t} of ${o} ${i?s?`row`:`rows`:s?`instance`:`instances`} match.`}function YD(e){let t=e?.components,n=e?.depth;return t&&n?`Showing the first ${t} component instances, and none nested more than ${n} elements deep. Others are not listed or searchable.`:t?`Showing the first ${t} component instances. Others are not listed or searchable.`:n?`Components nested more than ${n} elements deep are not listed or searchable.`:`The page has more components than the tree shows.`}function XD(e,t){let n=t?.detail?.id??null,r=t?.pageId??null;if(r!==e.pageId)return{pageId:r,selectedId:n,detailId:n,destroyed:null};let i=e.selectedId;return n&&n!==e.detailId&&n!==i&&(i=n),i&&t&&!t.truncated&&!ZD(t.roots,i)?{pageId:r,selectedId:null,detailId:n,destroyed:i}:{pageId:r,selectedId:i,detailId:n,destroyed:null}}function ZD(e,t){return e.some(e=>e.id===t||ZD(e.children,t))}function QD(e,t,n){let r=e.indexOf(n);if(r<0)return null;for(let n=r+1;n=0;n--)if(t.has(e[n]))return e[n];return null}var $D=(e,t)=>t.key,eO=(e,t)=>t.id;function tO(e,t){e&1&&(z(0,`p`,2),K(1,` The HTML came from the server, but no component was hydrated, so the app rendered again on the client. Add `),z(2,`code`),K(3,`provideClientHydration()`),B(),K(4,` and use a development build to see each component's status. `),B())}function nO(e,t){if(e&1&&(z(0,`li`)(1,`span`,9),K(2),B(),K(3),B()),e&2){let e=t.$implicit;S_(`count count-`+e.key),O(2),q(e.value),O(),J(` `,e.label,` `)}}function rO(e,t){if(e&1&&(z(0,`span`,15),K(1,`Expected `),z(2,`code`),K(3),B()()),e&2){let e=W().$implicit;O(3),q(e.expected)}}function iO(e,t){if(e&1&&(z(0,`span`,15),K(1,`Found `),z(2,`code`),K(3),B()()),e&2){let e=W().$implicit;O(3),q(e.actual)}}function aO(e,t){if(e&1){let e=V();z(0,`li`)(1,`button`,12),U(`click`,function(){let t=w(e).$implicit;return T(W(4).showNode.emit(t.id))})(`focus`,function(){let t=w(e).$implicit;return T(W(4).highlight.emit(t.id))})(`blur`,function(){return w(e),T(W(4).highlight.emit(null))})(`mouseenter`,function(){let t=w(e).$implicit;return T(W(4).highlight.emit(t.id))})(`mouseleave`,function(){return w(e),T(W(4).highlight.emit(null))}),z(2,`span`,13),K(3),B(),z(4,`span`,14),K(5),B(),j(6,rO,4,1,`span`,15),j(7,iO,4,1,`span`,15),B()()}if(e&2){let e=t.$implicit;O(3),q(e.name),O(2),J(`<`,e.tag,`>`),O(),M(e.expected?6:-1),O(),M(e.actual?7:-1)}}function oO(e,t){if(e&1&&(z(0,`h3`,10),K(1,`Mismatches`),B(),z(2,`ul`,11),N(3,aO,8,4,`li`,null,eO),B()),e&2){let e=W(2);O(3),P(e.mismatches)}}function sO(e,t){if(e&1){let e=V();z(0,`div`,3)(1,`ul`,4),N(2,nO,4,4,`li`,5,$D),B(),z(4,`button`,6),U(`click`,function(){return w(e),T(W(2).toggleOverlay())}),E(),z(5,`svg`,7),Ag(6,`rect`,8),B(),K(7,` Outline on page `),B()(),j(8,oO,5,0)}if(e&2){let e=W(),t=W();O(2),P(t.counts()),O(2),A(`aria-pressed`,t.overlayOn()),O(4),M(e.mismatches.length?8:-1)}}function cO(e,t){e&1&&j(0,tO,5,0,`p`,2)(1,sO,9,2),e&2&&M(+!!t.hydrated)}function lO(e,t){e&1&&(z(0,`p`,2),K(1,` This page was not rendered on the server, so there is nothing to hydrate. With server-side rendering and `),z(2,`code`),K(3,`provideClientHydration()`),B(),K(4,`, each component shows whether it was hydrated, skipped or mismatched. `),B())}var uO=class e{report=$(void 0);overlay=yv();showNode=yv();highlight=yv();overlayOn=Q(()=>this.report()?.overlay===!0);counts=X(()=>{let e=this.report()?.counts;return e?[{key:`hydrated`,label:`hydrated`,value:e.hydrated},{key:`skipped`,label:`skipped`,value:e.skipped},{key:`mismatched`,label:`mismatched`,value:e.mismatched},{key:`client`,label:`created on the client`,value:e.client},{key:`dehydratedBlocks`,label:e.dehydratedBlocks===1?`dehydrated @defer block`:`dehydrated @defer blocks`,value:e.dehydratedBlocks}]:[]});toggleOverlay(){let e=!this.overlayOn();this.overlayOn.set(e),this.overlay.emit(e)}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-hydration-section`]],inputs:{report:[1,`report`]},outputs:{overlay:`overlay`,showNode:`showNode`,highlight:`highlight`},decls:5,vars:1,consts:[[`aria-labelledby`,`ct-hydration-title`,1,`hydration`],[`id`,`ct-hydration-title`,1,`title`],[1,`empty`],[1,`summary`],[`aria-label`,`Hydration summary`,1,`counts`],[3,`class`],[`type`,`button`,1,`outline`,3,`click`],[`viewBox`,`0 0 24 24`,`aria-hidden`,`true`],[`x`,`3`,`y`,`3`,`width`,`18`,`height`,`18`,`rx`,`2`,`stroke-dasharray`,`4 3`],[1,`num`],[1,`label`],[1,`mismatches`],[`type`,`button`,1,`mismatch`,3,`click`,`focus`,`blur`,`mouseenter`,`mouseleave`],[1,`name`,`mono`],[1,`mono`,`muted`],[1,`detail-line`]],template:function(e,t){if(e&1&&(z(0,`section`,0)(1,`h2`,1),K(2,`Hydration`),B(),j(3,cO,2,1)(4,lO,5,0,`p`,2),B()),e&2){let e;O(3),M((e=t.report())?3:4,e)}},styles:[`.hydration[_ngcontent-%COMP%] { margin-top: 16px; } @@ -738,7 +738,7 @@ svg[_ngcontent-%COMP%] { button[_ngcontent-%COMP%] { transition: none; } -}`]})};function fO(e){return new Date(e).toLocaleTimeString()}var pO=/[ \t\n\r]/;function mO(e){let t=e.trim(),n;try{n=JSON.parse(t)}catch{return null}if(typeof n!=`object`||!n)return null;let r=``,i=0,a=()=>`\n${` `.repeat(i)}`;for(let e=0;e0?0:-1)},styles:[`[_nghost-%COMP%] { +}`]})};function dO(e){return new Date(e).toLocaleTimeString()}var fO=/[ \t\n\r]/;function pO(e){let t=e.trim(),n;try{n=JSON.parse(t)}catch{return null}if(typeof n!=`object`||!n)return null;let r=``,i=0,a=()=>`\n${` `.repeat(i)}`;for(let e=0;e0?0:-1)},styles:[`[_nghost-%COMP%] { display: block; } @@ -765,7 +765,7 @@ a[_ngcontent-%COMP%] { a[_ngcontent-%COMP%]:focus-visible { outline: 2px solid var(--%NS%accent); outline-offset: 2px; -}`]})},yO=864e13,bO=200,xO=300,SO=100,CO=10,wO=100,TO=2e3,EO=2e3,DO=4e3,OO=1e3,kO=100,AO=3,jO=50,MO={component:`c`,hook:`h`,afterRender:`r`,output:`o`},NO=Object.values(MO),PO=e=>!!e&&typeof e==`object`&&!Array.isArray(e),FO=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0?e:0,IO=(e,t)=>typeof e==`string`?e.slice(0,t):``,LO=e=>FO(e)>0?FO(e):void 0,RO=(e,t)=>Array.isArray(e)?e.slice(0,t):[];function zO(e){if(!PO(e))return null;let t=IO(e.name,bO);return t?{name:t,checks:FO(e.checks),ms:FO(e.ms)}:null}function BO(e,t){if(!Array.isArray(e)||e.length!==5)return null;let[n,r,i,a,o]=e;return typeof n!=`number`||!Number.isInteger(n)||n<0||n>=t||typeof r!=`number`||!Number.isFinite(r)||Math.abs(r)>1e7||typeof a!=`number`||!Number.isInteger(a)||a<0||a>OO||typeof o!=`string`||!NO.includes(o)?null:[n,r,FO(i),a,o]}function VO(e,t){if(!PO(e)||typeof e.id!=`number`)return null;let n=RO(e.components,CO).map(zO).filter(e=>!!e),r=IO(e.trigger,xO),i=RO(e.spans,40).map(e=>BO(e,t)).filter(e=>!!e),a=Array.isArray(e.spans)?e.spans.length-40:0,o=Math.floor(FO(e.droppedSpans))+Math.max(0,a),s={t:typeof e.t==`number`?FO(e.t):void 0,hookMs:LO(e.hookMs),afterRenderMs:LO(e.afterRenderMs),outputMs:LO(e.outputMs)},c=GO(e.cause),l=LO(e.refreshed),u=LO(e.unchanged);return{id:FO(e.id),at:FO(e.at),ms:FO(e.ms),passes:FO(e.passes),...r?{trigger:r}:{},checks:FO(e.checks),components:n,...Object.fromEntries(Object.entries(s).filter(([,e])=>e!==void 0)),...i.length?{spans:i}:{},...o?{droppedSpans:o}:{},...c?{cause:c}:{},...l?{refreshed:l}:{},...u?{unchanged:u}:{}}}var HO=[`event`,`http`,`timer`,`signal`,`effect`,`markForCheck`,`input`,`view`,`tick`,`zone`,`unknown`],UO={event:`Event`,http:`HTTP response`,timer:`Timer`,signal:`Signal write`,effect:`Effect`,markForCheck:`markForCheck`,input:`setInput`,view:`View change`,tick:`ApplicationRef.tick`,zone:`zone.js only`,unknown:`Unknown`},WO=e=>typeof e==`string`&&HO.includes(e);function GO(e){if(!PO(e)||!WO(e.kind))return;let t=[`component`,`listener`,`event`,`target`,`signal`,`task`],n={kind:e.kind};WO(e.via)&&(n.via=e.via);for(let r of t){let t=IO(e[r],bO);t&&(n[r]=t)}e.zone===!0&&(n.zone=!0);let r=RO(e.stack,AO).map(e=>IO(e,xO)).filter(Boolean);r.length&&(n.stack=r);let i=Math.floor(FO(e.more));return i&&(n.more=i),n}function KO(e){if(!PO(e))return null;let t=IO(e.name,bO);if(!t)return null;let n=e.strategy;return{name:t,refreshed:Math.floor(FO(e.refreshed)),unchanged:Math.floor(FO(e.unchanged)),...n===`OnPush`||n===`Eager`?{strategy:n}:{}}}function qO(e){if(!PO(e))return null;let t=IO(e.name,bO),n=IO(e.input,bO);if(!t||!n)return null;let r=IO(e.parent,bO);return{name:t,input:n,...r?{parent:r}:{},inPlace:Math.floor(FO(e.inPlace)),sameContents:Math.floor(FO(e.sameContents))}}function JO(e){if(!PO(e))return null;let t=IO(e.name,bO);if(!t)return null;let n=RO(e.tasks,3).map(e=>IO(e,bO)).filter(Boolean);return{name:t,ticks:Math.floor(FO(e.ticks)),...n.length?{tasks:n}:{}}}function YO(e){if(!PO(e))return;let t={};if(PO(e.causes))for(let n of HO){let r=Math.floor(FO(e.causes[n]));r&&(t[n]=r)}let n=RO(e.components,wO).map(KO).filter(e=>!!e),r=RO(e.inputs,jO).map(qO).filter(e=>!!e),i=RO(e.zone,jO).map(JO).filter(e=>!!e),a=Math.floor(FO(e.major));return{triggers:e.triggers===!0,waste:e.waste===!0,...a&&a<1e3?{major:a}:{},causes:t,components:n,...r.length?{inputs:r}:{},...i.length?{zone:i}:{},...typeof e.zoneJs==`boolean`?{zoneJs:e.zoneJs}:{}}}function XO(e){let t=[],n=e.component?` in ${e.component}${e.listener?` (${e.listener})`:``}`:``;switch(e.kind){case`event`:t.push(`${e.event??`Template listener`}${e.target?` on ${e.target}`:``}${n}`);break;case`http`:t.push(`HTTP response${n}`);break;case`timer`:t.push(`${e.task??`Timer`}${n}`);break;case`zone`:t.push(`zone.js tick with no Angular notification${e.task?` after ${e.task}`:``}`);break;case`tick`:t.push(`ApplicationRef.tick()${n}`);break;default:t.push(`${UO[e.kind]}${n}`)}return e.signal?t.push(e.signal===`?`?`wrote an unnamed signal`:`wrote signal ${e.signal}`):e.via&&e.via!==e.kind&&t.push(`via ${UO[e.via]}`),e.zone&&e.kind!==`zone`&&t.push(`run by zone.js`),e.more&&t.push(`${e.more} more notification${e.more===1?``:`s`}`),t.join(`, `)}function ZO(e){if(!e)return[];let t=[],n=(e.major??0)>=22;for(let r of e.components){if(r.refreshed<10)continue;let e=r.refreshed-r.unchanged;if(e/r.refreshed>.2)continue;let i=`refreshed ${r.refreshed} times and changed something in ${e}`;r.strategy===`Eager`?t.push({name:r.name,kind:`on-push`,text:n?`${r.name} was ${i}. It opts out of OnPush, which is the default from Angular 22: remove \`changeDetection: ChangeDetectionStrategy.Eager\` (or \`Default\`) so Angular skips it until an input, event, signal or markForCheck marks it.`:`${r.name} was ${i}. Add \`changeDetection: ChangeDetectionStrategy.OnPush\` so Angular skips it until an input, event, signal or markForCheck marks it.`}):r.strategy===`OnPush`&&t.push({name:r.name,kind:`already-on-push`,text:`${r.name} was ${i}, and it is already OnPush${n?` (the default from Angular 22)`:``}. Something keeps marking it: an input that gets a new reference each time, an event or output in it, markForCheck, or a signal it reads that is set to an equal value.`})}for(let n of e.inputs??[]){let e=n.parent?` set by ${n.parent}`:``;n.inPlace&&t.push({name:n.name,kind:`in-place`,text:`Input ${n.input} of ${n.name}${e} changed in place ${n.inPlace} time${n.inPlace===1?``:`s`}: same reference, different contents. OnPush components, computed and signal equality don't see that. Pass a new object or array instead of mutating it.`}),n.sameContents&&t.push({name:n.name,kind:`same-contents`,text:`Input ${n.input} of ${n.name}${e} got a new reference with the same contents ${n.sameContents} time${n.sameContents===1?``:`s`}, so Angular refreshed ${n.name} for nothing. Keep the reference when nothing changed, for example with a computed instead of a method call in the template.`})}for(let n of e.zone??[]){let e=n.tasks?.length?` (after ${n.tasks.join(`, `)})`:``;t.push({name:n.name,kind:`zone`,text:`${n.name} changed in ${n.ticks} tick${n.ticks===1?``:`s`} that only zone.js started${e}. Without zone.js it would not update: keep that state in a signal, or call markForCheck after changing it.`})}return t}function QO(e){let t=zO(e);return!t||!PO(e)?null:{...t,maxMs:FO(e.maxMs),cycles:FO(e.cycles)}}function $O(e){if(!PO(e))return null;let t=IO(e.name,bO),n=IO(e.hook,SO);if(!t||!n)return null;let{calls:r,ms:i,maxMs:a}=e;return{name:t,hook:n,calls:FO(r),ms:FO(i),maxMs:FO(a)}}function ek(e){if(!PO(e))return null;let t=IO(e.name,bO);if(!t)return null;let n=IO(e.listener,bO);return{name:t,...n?{listener:n}:{},calls:FO(e.calls),ms:FO(e.ms),maxMs:FO(e.maxMs)}}function tk(e){if(PO(e)&&FO(e.runs))return{runs:FO(e.runs),ms:FO(e.ms),maxMs:FO(e.maxMs)}}function nk(e,t){if(!PO(e))return null;let n=RO(e.spanNames,DO).map(e=>IO(e,xO)),r=Array.isArray(e.cycles)?e.cycles.slice(-Math.min(t,EO)).map(e=>VO(e,n.length)).filter(e=>!!e):[],i={},a=0;if(PO(e.hosts)){let t=Object.entries(e.hosts);a=Math.max(0,t.length-TO);for(let[e,n]of t.slice(0,TO))e.length<50&&FO(n)&&(i[e]=FO(n))}let o=Array.isArray(e.components)?e.components:[],s=Math.floor(FO(e.droppedClasses))+Math.max(0,o.length-wO),c=Math.floor(FO(e.droppedHosts))+a,l=RO(e.hooks,kO).map($O).filter(e=>!!e),u=RO(e.outputs,kO).map(ek).filter(e=>!!e),d=Math.max(0,RO(e.hooks,1/0).length-kO)+Math.max(0,RO(e.outputs,1/0).length-kO),f=Math.floor(FO(e.droppedTimings))+d,p=tk(e.afterRender),m=r.some(e=>e.spans?.length),h=YO(e.diagnosis);return{recording:e.recording===!0,startedAt:typeof e.startedAt==`number`&&e.startedAt<=yO?FO(e.startedAt):null,dropped:FO(e.dropped),cycles:r,components:o.slice(0,wO).map(QO).filter(e=>!!e),...s?{droppedClasses:s}:{},hosts:i,...c?{droppedHosts:c}:{},...l.length?{hooks:l}:{},...u.length?{outputs:u}:{},...f?{droppedTimings:f}:{},...p?{afterRender:p}:{},...m?{spanNames:n}:{},...h?{diagnosis:h}:{}}}var rk=`pangular-inspector/change-detection`;function ik(e,t,n=Date.now()){return{format:rk,version:1,exportedAt:n,pageId:t,recording:{...nk(e,EO)??e,recording:!1,hosts:{}}}}function ak(e,t){if(e.length>2e7||e.length*3>2e7&&new TextEncoder().encode(e).byteLength>2e7)return{ok:!1,error:`The file is larger than 20 MB.`};let n;try{n=JSON.parse(e)}catch{return{ok:!1,error:`The file is not valid JSON.`}}if(!PO(n))return{ok:!1,error:`The file is not a recording.`};if(n.format!==void 0&&n.format!==`pangular-inspector/change-detection`)return{ok:!1,error:`The file is not a change detection recording.`};let r=PO(n.recording)?n.recording:n;if(!Array.isArray(r.cycles))return{ok:!1,error:`The file has no change detection cycles.`};let i=nk(r,t);if(!i)return{ok:!1,error:`The file is not a recording.`};let a=IO(n.pageId??r.pageId,49)||`imported`,o=LO(n.exportedAt);return{ok:!0,pageId:a,...o?{exportedAt:o}:{},recording:{...i,recording:!1}}}var ok=1,sk=1,ck=2,lk={c:`component`,h:`lifecycle-hook`,r:`after-render`,o:`output`},uk=e=>Math.round(e*1e6)/1e3;function dk(e,t){let n=e.spanNames??[],r=e.cycles[0]?.at??0,i=e.startedAt??r,a=[],o=0,s=0;for(let t of e.cycles){let e=t.t??Math.max(0,t.at-i),r=e+t.ms;a.push({name:`Change detection #${t.id}`,cat:`change-detection`,ph:`X`,pid:ok,tid:sk,ts:uk(e),dur:uk(t.ms),args:{checks:t.checks,passes:t.passes,...t.trigger?{trigger:t.trigger}:{},...t.hookMs?{hookMs:t.hookMs}:{},...t.afterRenderMs?{afterRenderMs:t.afterRenderMs}:{},...t.outputMs?{outputMs:t.outputMs}:{},...t.cause?{cause:XO(t.cause)}:{},...t.unchanged?{unchanged:t.unchanged}:{},slowest:t.components.map(e=>`${e.name} ${e.checks}x ${e.ms}ms`)}}),s+=t.droppedSpans??0;let c=[{end:r}],l=[...t.spans??[]].sort((e,t)=>e[1]-t[1]||t[2]-e[2]);for(let[r,i,s,u,d]of l){o++;let l=n[r]??`?`;if(d===MO.output){let n=e+i;a.push({name:l,cat:lk[d],ph:`X`,pid:ok,tid:ck,ts:uk(n),dur:uk(i<0?Math.max(0,Math.min(s,-i)):s),args:{cycle:t.id}});continue}let f=Math.max(e,e+i);for(;c.length>1&&c.at(-1).end<=f;)c.pop();let p=c.at(-1).end,m=Math.min(f+s,p);me.ts??0));if(c<0)for(let e of a)e.ts=uk((e.ts-c)/1e3);a.sort((e,t)=>e.ts-t.ts||t.dur-e.dur);let l=(e,t,n)=>({name:t,ph:`M`,pid:ok,tid:e,args:{name:n}});return{traceEvents:[l(0,`process_name`,`Angular change detection (page ${t})`),l(sk,`thread_name`,`Change detection`),l(ck,`thread_name`,`Outputs`),...a],displayTimeUnit:`ms`,otherData:{source:`Pangular Inspector change detection recording`,pageId:t,cycles:e.cycles.length,droppedCycles:e.dropped,spans:o,droppedSpans:s,...e.startedAt&&e.startedAt<=yO?{startedAt:new Date(e.startedAt).toISOString()}:{}}}}var fk=16.6;function pk(e){return e.ms>fk}function mk(e){return`${e<10?e.toFixed(2):Math.round(e)} ms`}function hk(e,t){if(!t)return[...e];let n=Math.min(t.from,t.to),r=Math.max(t.from,t.to),i=e.filter(e=>e.id>=n&&e.id<=r);return i.length?i:[...e]}function gk(e){let t=new Map;for(let n of e)for(let e of n.components){let n=t.get(e.name);n?(n.checks+=e.checks,n.ms+=e.ms,n.maxMs=Math.max(n.maxMs,e.ms),n.cycles+=1):t.set(e.name,{name:e.name,checks:e.checks,ms:e.ms,maxMs:e.ms,cycles:1})}return[...t.values()].sort((e,t)=>t.ms-e.ms||e.name.localeCompare(t.name))}function _k(e){let t=e.reduce((e,t)=>Math.max(e,t.ms),0);return Math.max(t,fk*1.25)}function vk(e,t,n=3){let r=e.map(e=>({item:e,value:t(e)})).filter(e=>e.value>0).sort((e,t)=>t.value-e.value),i=r.reduce((e,t)=>e+t.value,0);if(!i)return[];let a=n/i,o=[],s=0,c=0,l=n,u=1,d=[],f=(e,t)=>{let n=e.reduce((e,t)=>e+t,0),r=Math.max(...e),i=Math.min(...e);return Math.max(t*t*r/(n*n),n*n/(t*t*i))},p=()=>{let e=d.reduce((e,t)=>e+t.area,0);if(l>=u){let t=e/u,n=c;for(let e of d){let r=e.area/t;o.push({item:e.item,x:s,y:n,w:t,h:r}),n+=r}s+=t,l-=t}else{let t=e/l,n=s;for(let e of d){let r=e.area/t;o.push({item:e.item,x:n,y:c,w:r,h:t}),n+=r}c+=t,u-=t}d=[]};for(let e of r){let t=e.value*a,n=Math.min(l,u),r=d.map(e=>e.area);d.length&&f([...r,t],n)>f(r,n)&&p(),d.push({item:e.item,area:t})}return d.length&&p(),o.map(e=>({item:e.item,x:e.x/n*100,y:e.y*100,w:e.w/n*100,h:e.h*100}))}var yk={c:`component`,h:`hook`,r:`afterRender`,o:`output`};function bk(e,t){if(t===`c`)return e||null;if(t===`h`){let t=e.lastIndexOf(`.`);return t>0?e.slice(0,t):null}if(t===`o`){let t=e.indexOf(` (`),n=t>0?e.slice(0,t):e;return n&&n!==`?`?n:null}return null}function xk(e,t){let n=e.filter(e=>e.spans?.length);if(!n.length)return null;let r=n.map(e=>{let t=e.spans,n=Math.min(0,...t.map(e=>e[1])),r=Math.max(e.ms,...t.map(e=>e[1]+e[2]));return{cycle:e,spans:t,from:n,width:Math.max(r-n,.001)}}),i=r.reduce((e,t)=>e+t.width,0),a=[],o=[],s=0,c=0;for(let{cycle:e,spans:n,from:l,width:u}of r){o.push({id:e.id,x:s/i*100,w:u/i*100,droppedSpans:e.droppedSpans??0});let r=[...n].sort((e,t)=>e[1]-t[1]||e[3]-t[3]),d=[];for(let[n,o,u,f,p]of r){let r=t[n]??`unknown`,m=d[f-1],h=f>0&&m!==void 0&&ot.kind,Ck=(e,t)=>t.name,wk=(e,t)=>t.name+`.`+t.input;function Tk(e,t){e&1&&(z(0,`p`,3),K(1,` The page has no Angular change detection scheduler the overlay could find (it needs Angular 18 or later), so cycles have no cause. `),B())}function Ek(e,t){if(e&1&&(z(0,`tr`)(1,`td`),K(2),B(),z(3,`td`,6),K(4),B()()),e&2){let e=t.$implicit;O(2),q(e.label),O(2),q(e.count)}}function Dk(e,t){if(e&1&&(z(0,`table`)(1,`thead`)(2,`tr`)(3,`th`,4),K(4,`Trigger`),B(),z(5,`th`,5),K(6,`Cycles`),B()()(),z(7,`tbody`),N(8,Ek,5,2,`tr`,null,Sk),B()()),e&2){let e=W(2);O(8),P(e.causes())}}function Ok(e,t){e&1&&(z(0,`p`,3),K(1,`No cycle has a cause yet.`),B())}function kk(e,t){if(e&1&&(z(0,`tr`)(1,`td`,7),K(2),B(),z(3,`td`,6),K(4),B(),z(5,`td`,7),K(6),B()()),e&2){let e=t.$implicit;O(2),q(e.name),O(2),q(e.ticks),O(2),q(e.tasks?.join(`, `))}}function Ak(e,t){if(e&1&&(z(0,`table`)(1,`thead`)(2,`tr`)(3,`th`,4),K(4,`Component`),B(),z(5,`th`,5),K(6,`Zone-only ticks`),B(),z(7,`th`,4),K(8,`After`),B()()(),z(9,`tbody`),N(10,kk,7,3,`tr`,null,Ck),B()()),e&2){let e=W(3);O(10),P(e.zone())}}function jk(e,t){if(e&1&&(z(0,`p`,3),K(1),B()),e&2){let e=W(3);O(),q(e.zoneNote())}}function Mk(e,t){if(e&1&&(z(0,`div`)(1,`h4`),K(2,`Depends on zone.js`),B(),j(3,Ak,12,0,`table`)(4,jk,2,1,`p`,3),B()),e&2){let e=W(),t=W();O(3),M(t.zone().length?3:e.triggers?4:-1)}}function Nk(e,t){e&1&&(z(0,`p`,3),K(1,`The page can't watch DOM updates, so wasted checks are not counted.`),B())}function Pk(e,t){if(e&1&&(z(0,`tr`)(1,`td`,7),K(2),B(),z(3,`td`,6),K(4),B(),z(5,`td`,6),K(6),B(),z(7,`td`),K(8),B()()),e&2){let e=t.$implicit,n=W(3);O(2),q(e.name),O(2),q(e.refreshed),O(2),Y(``,e.unchanged,` (`,n.share(e.unchanged,e.refreshed),`)`),O(2),q(e.strategy??`Unknown`)}}function Fk(e,t){if(e&1&&(z(0,`table`)(1,`thead`)(2,`tr`)(3,`th`,4),K(4,`Component`),B(),z(5,`th`,5),K(6,`Refreshed`),B(),z(7,`th`,5),K(8,`Changed nothing`),B(),z(9,`th`,4),K(10,`Strategy`),B()()(),z(11,`tbody`),N(12,Pk,9,5,`tr`,null,Ck),B()()),e&2){let e=W(2);O(12),P(e.wasted())}}function Ik(e,t){e&1&&(z(0,`p`,3),K(1,`Every refreshed check changed something.`),B())}function Lk(e,t){if(e&1&&(z(0,`tr`)(1,`td`,7),K(2),B(),z(3,`td`,7),K(4),B(),z(5,`td`,6),K(6),B(),z(7,`td`,6),K(8),B()()),e&2){let e=t.$implicit;O(2),Y(``,e.name,`.`,e.input),O(2),q(e.parent??`Unknown`),O(2),q(e.inPlace),O(2),q(e.sameContents)}}function Rk(e,t){if(e&1&&(z(0,`h4`),K(1,`Inputs that break OnPush`),B(),z(2,`table`)(3,`thead`)(4,`tr`)(5,`th`,4),K(6,`Input`),B(),z(7,`th`,4),K(8,`Set by`),B(),z(9,`th`,5),K(10,`Changed in place`),B(),z(11,`th`,5),K(12,`Same contents, new reference`),B()()(),z(13,`tbody`),N(14,Lk,9,5,`tr`,null,wk),B()()),e&2){let e=W(2);O(14),P(e.inputs())}}function zk(e,t){if(e&1&&(z(0,`li`),K(1),B()),e&2){let e=t.$implicit;O(),q(e.text)}}function Bk(e,t){if(e&1&&(z(0,`h4`),K(1,`Hints`),B(),z(2,`ul`,8),N(3,zk,2,1,`li`,null,yg),B()),e&2){let e=W(2);O(3),P(e.hints())}}function Vk(e,t){if(e&1&&(z(0,`section`,0)(1,`h3`,1),K(2,`Why it ran and what it wasted`),B(),z(3,`div`,2)(4,`div`)(5,`h4`),K(6,`What started the cycles`),B(),j(7,Tk,2,0,`p`,3)(8,Dk,10,0,`table`)(9,Ok,2,0,`p`,3),B(),j(10,Mk,5,1,`div`),B(),z(11,`h4`),K(12,`Wasted checks`),B(),j(13,Nk,2,0,`p`,3)(14,Fk,14,0,`table`)(15,Ik,2,0,`p`,3),j(16,Rk,16,0),j(17,Bk,5,0),B()),e&2){let e=t,n=W();O(7),M(e.triggers?n.causes().length?8:9:7),O(3),M(n.hasZone()?10:-1),O(3),M(e.waste?n.wasted().length?14:15:13),O(3),M(n.inputs().length?16:-1),O(),M(n.hints().length?17:-1)}}var Hk=10,Uk=class e{page=$(null);diagnosis=X(()=>this.page()?.diagnosis??null);causes=X(()=>{let e=this.diagnosis()?.causes??{};return HO.filter(t=>e[t]).map(t=>({kind:t,label:UO[t],count:e[t]}))});zone=X(()=>(this.diagnosis()?.zone??[]).slice(0,Hk));zoneTicks=X(()=>this.diagnosis()?.causes.zone??0);hasZone=X(()=>this.diagnosis()?.zoneJs??(this.zone().length>0||this.zoneTicks()>0));zoneNote=X(()=>{let e=this.zoneTicks();return e?`${e} ${e===1?`tick`:`ticks`} came from zone.js alone, and no component changed in them.`:`No component changed in a tick only zone.js started.`});wasted=X(()=>(this.diagnosis()?.components??[]).filter(e=>e.unchanged>0).slice(0,Hk));inputs=X(()=>(this.diagnosis()?.inputs??[]).slice(0,Hk));hints=X(()=>ZO(this.diagnosis()??void 0).slice(0,Hk));share(e,t){return t?`${Math.round(e/t*100)}%`:`0%`}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-cd-diagnosis`]],inputs:{page:[1,`page`]},decls:1,vars:1,consts:[[`aria-labelledby`,`cd-diagnosis-heading`,1,`diagnosis`],[`id`,`cd-diagnosis-heading`],[1,`grid`],[1,`note`],[`scope`,`col`],[`scope`,`col`,1,`num`],[1,`num`],[1,`mono`],[1,`hints`]],template:function(e,t){if(e&1&&j(0,Vk,18,5,`section`,0),e&2){let e;M((e=t.diagnosis())?0:-1,e)}},styles:[`[_nghost-%COMP%] { +}`]})},vO=864e13,yO=200,bO=300,xO=100,SO=10,CO=100,wO=2e3,TO=2e3,EO=4e3,DO=1e3,OO=100,kO=3,AO=50,jO={component:`c`,hook:`h`,afterRender:`r`,output:`o`},MO=Object.values(jO),NO=e=>!!e&&typeof e==`object`&&!Array.isArray(e),PO=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0?e:0,FO=(e,t)=>typeof e==`string`?e.slice(0,t):``,IO=e=>PO(e)>0?PO(e):void 0,LO=(e,t)=>Array.isArray(e)?e.slice(0,t):[];function RO(e){if(!NO(e))return null;let t=FO(e.name,yO);return t?{name:t,checks:PO(e.checks),ms:PO(e.ms)}:null}function zO(e,t){if(!Array.isArray(e)||e.length!==5)return null;let[n,r,i,a,o]=e;return typeof n!=`number`||!Number.isInteger(n)||n<0||n>=t||typeof r!=`number`||!Number.isFinite(r)||Math.abs(r)>1e7||typeof a!=`number`||!Number.isInteger(a)||a<0||a>DO||typeof o!=`string`||!MO.includes(o)?null:[n,r,PO(i),a,o]}function BO(e,t){if(!NO(e)||typeof e.id!=`number`)return null;let n=LO(e.components,SO).map(RO).filter(e=>!!e),r=FO(e.trigger,bO),i=LO(e.spans,40).map(e=>zO(e,t)).filter(e=>!!e),a=Array.isArray(e.spans)?e.spans.length-40:0,o=Math.floor(PO(e.droppedSpans))+Math.max(0,a),s={t:typeof e.t==`number`?PO(e.t):void 0,hookMs:IO(e.hookMs),afterRenderMs:IO(e.afterRenderMs),outputMs:IO(e.outputMs)},c=WO(e.cause),l=IO(e.refreshed),u=IO(e.unchanged);return{id:PO(e.id),at:PO(e.at),ms:PO(e.ms),passes:PO(e.passes),...r?{trigger:r}:{},checks:PO(e.checks),components:n,...Object.fromEntries(Object.entries(s).filter(([,e])=>e!==void 0)),...i.length?{spans:i}:{},...o?{droppedSpans:o}:{},...c?{cause:c}:{},...l?{refreshed:l}:{},...u?{unchanged:u}:{}}}var VO=[`event`,`http`,`timer`,`signal`,`effect`,`markForCheck`,`input`,`view`,`tick`,`zone`,`unknown`],HO={event:`Event`,http:`HTTP response`,timer:`Timer`,signal:`Signal write`,effect:`Effect`,markForCheck:`markForCheck`,input:`setInput`,view:`View change`,tick:`ApplicationRef.tick`,zone:`zone.js only`,unknown:`Unknown`},UO=e=>typeof e==`string`&&VO.includes(e);function WO(e){if(!NO(e)||!UO(e.kind))return;let t=[`component`,`listener`,`event`,`target`,`signal`,`task`],n={kind:e.kind};UO(e.via)&&(n.via=e.via);for(let r of t){let t=FO(e[r],yO);t&&(n[r]=t)}e.zone===!0&&(n.zone=!0);let r=LO(e.stack,kO).map(e=>FO(e,bO)).filter(Boolean);r.length&&(n.stack=r);let i=Math.floor(PO(e.more));return i&&(n.more=i),n}function GO(e){if(!NO(e))return null;let t=FO(e.name,yO);if(!t)return null;let n=e.strategy;return{name:t,refreshed:Math.floor(PO(e.refreshed)),unchanged:Math.floor(PO(e.unchanged)),...n===`OnPush`||n===`Eager`?{strategy:n}:{}}}function KO(e){if(!NO(e))return null;let t=FO(e.name,yO),n=FO(e.input,yO);if(!t||!n)return null;let r=FO(e.parent,yO);return{name:t,input:n,...r?{parent:r}:{},inPlace:Math.floor(PO(e.inPlace)),sameContents:Math.floor(PO(e.sameContents))}}function qO(e){if(!NO(e))return null;let t=FO(e.name,yO);if(!t)return null;let n=LO(e.tasks,3).map(e=>FO(e,yO)).filter(Boolean);return{name:t,ticks:Math.floor(PO(e.ticks)),...n.length?{tasks:n}:{}}}function JO(e){if(!NO(e))return;let t={};if(NO(e.causes))for(let n of VO){let r=Math.floor(PO(e.causes[n]));r&&(t[n]=r)}let n=LO(e.components,CO).map(GO).filter(e=>!!e),r=LO(e.inputs,AO).map(KO).filter(e=>!!e),i=LO(e.zone,AO).map(qO).filter(e=>!!e),a=Math.floor(PO(e.major));return{triggers:e.triggers===!0,waste:e.waste===!0,...a&&a<1e3?{major:a}:{},causes:t,components:n,...r.length?{inputs:r}:{},...i.length?{zone:i}:{},...typeof e.zoneJs==`boolean`?{zoneJs:e.zoneJs}:{}}}function YO(e){let t=[],n=e.component?` in ${e.component}${e.listener?` (${e.listener})`:``}`:``;switch(e.kind){case`event`:t.push(`${e.event??`Template listener`}${e.target?` on ${e.target}`:``}${n}`);break;case`http`:t.push(`HTTP response${n}`);break;case`timer`:t.push(`${e.task??`Timer`}${n}`);break;case`zone`:t.push(`zone.js tick with no Angular notification${e.task?` after ${e.task}`:``}`);break;case`tick`:t.push(`ApplicationRef.tick()${n}`);break;default:t.push(`${HO[e.kind]}${n}`)}return e.signal?t.push(e.signal===`?`?`wrote an unnamed signal`:`wrote signal ${e.signal}`):e.via&&e.via!==e.kind&&t.push(`via ${HO[e.via]}`),e.zone&&e.kind!==`zone`&&t.push(`run by zone.js`),e.more&&t.push(`${e.more} more notification${e.more===1?``:`s`}`),t.join(`, `)}function XO(e){if(!e)return[];let t=[],n=(e.major??0)>=22;for(let r of e.components){if(r.refreshed<10)continue;let e=r.refreshed-r.unchanged;if(e/r.refreshed>.2)continue;let i=`refreshed ${r.refreshed} times and changed something in ${e}`;r.strategy===`Eager`?t.push({name:r.name,kind:`on-push`,text:n?`${r.name} was ${i}. It opts out of OnPush, which is the default from Angular 22: remove \`changeDetection: ChangeDetectionStrategy.Eager\` (or \`Default\`) so Angular skips it until an input, event, signal or markForCheck marks it.`:`${r.name} was ${i}. Add \`changeDetection: ChangeDetectionStrategy.OnPush\` so Angular skips it until an input, event, signal or markForCheck marks it.`}):r.strategy===`OnPush`&&t.push({name:r.name,kind:`already-on-push`,text:`${r.name} was ${i}, and it is already OnPush${n?` (the default from Angular 22)`:``}. Something keeps marking it: an input that gets a new reference each time, an event or output in it, markForCheck, or a signal it reads that is set to an equal value.`})}for(let n of e.inputs??[]){let e=n.parent?` set by ${n.parent}`:``;n.inPlace&&t.push({name:n.name,kind:`in-place`,text:`Input ${n.input} of ${n.name}${e} changed in place ${n.inPlace} time${n.inPlace===1?``:`s`}: same reference, different contents. OnPush components, computed and signal equality don't see that. Pass a new object or array instead of mutating it.`}),n.sameContents&&t.push({name:n.name,kind:`same-contents`,text:`Input ${n.input} of ${n.name}${e} got a new reference with the same contents ${n.sameContents} time${n.sameContents===1?``:`s`}, so Angular refreshed ${n.name} for nothing. Keep the reference when nothing changed, for example with a computed instead of a method call in the template.`})}for(let n of e.zone??[]){let e=n.tasks?.length?` (after ${n.tasks.join(`, `)})`:``;t.push({name:n.name,kind:`zone`,text:`${n.name} changed in ${n.ticks} tick${n.ticks===1?``:`s`} that only zone.js started${e}. Without zone.js it would not update: keep that state in a signal, or call markForCheck after changing it.`})}return t}function ZO(e){let t=RO(e);return!t||!NO(e)?null:{...t,maxMs:PO(e.maxMs),cycles:PO(e.cycles)}}function QO(e){if(!NO(e))return null;let t=FO(e.name,yO),n=FO(e.hook,xO);if(!t||!n)return null;let{calls:r,ms:i,maxMs:a}=e;return{name:t,hook:n,calls:PO(r),ms:PO(i),maxMs:PO(a)}}function $O(e){if(!NO(e))return null;let t=FO(e.name,yO);if(!t)return null;let n=FO(e.listener,yO);return{name:t,...n?{listener:n}:{},calls:PO(e.calls),ms:PO(e.ms),maxMs:PO(e.maxMs)}}function ek(e){if(NO(e)&&PO(e.runs))return{runs:PO(e.runs),ms:PO(e.ms),maxMs:PO(e.maxMs)}}function tk(e,t){if(!NO(e))return null;let n=LO(e.spanNames,EO).map(e=>FO(e,bO)),r=Array.isArray(e.cycles)?e.cycles.slice(-Math.min(t,TO)).map(e=>BO(e,n.length)).filter(e=>!!e):[],i={},a=0;if(NO(e.hosts)){let t=Object.entries(e.hosts);a=Math.max(0,t.length-wO);for(let[e,n]of t.slice(0,wO))e.length<50&&PO(n)&&(i[e]=PO(n))}let o=Array.isArray(e.components)?e.components:[],s=Math.floor(PO(e.droppedClasses))+Math.max(0,o.length-CO),c=Math.floor(PO(e.droppedHosts))+a,l=LO(e.hooks,OO).map(QO).filter(e=>!!e),u=LO(e.outputs,OO).map($O).filter(e=>!!e),d=Math.max(0,LO(e.hooks,1/0).length-OO)+Math.max(0,LO(e.outputs,1/0).length-OO),f=Math.floor(PO(e.droppedTimings))+d,p=ek(e.afterRender),m=r.some(e=>e.spans?.length),h=JO(e.diagnosis);return{recording:e.recording===!0,startedAt:typeof e.startedAt==`number`&&e.startedAt<=vO?PO(e.startedAt):null,dropped:PO(e.dropped),cycles:r,components:o.slice(0,CO).map(ZO).filter(e=>!!e),...s?{droppedClasses:s}:{},hosts:i,...c?{droppedHosts:c}:{},...l.length?{hooks:l}:{},...u.length?{outputs:u}:{},...f?{droppedTimings:f}:{},...p?{afterRender:p}:{},...m?{spanNames:n}:{},...h?{diagnosis:h}:{}}}var nk=`pangular-inspector/change-detection`;function rk(e,t,n=Date.now()){return{format:nk,version:1,exportedAt:n,pageId:t,recording:{...tk(e,TO)??e,recording:!1,hosts:{}}}}function ik(e,t){if(e.length>2e7||e.length*3>2e7&&new TextEncoder().encode(e).byteLength>2e7)return{ok:!1,error:`The file is larger than 20 MB.`};let n;try{n=JSON.parse(e)}catch{return{ok:!1,error:`The file is not valid JSON.`}}if(!NO(n))return{ok:!1,error:`The file is not a recording.`};if(n.format!==void 0&&n.format!==`pangular-inspector/change-detection`)return{ok:!1,error:`The file is not a change detection recording.`};let r=NO(n.recording)?n.recording:n;if(!Array.isArray(r.cycles))return{ok:!1,error:`The file has no change detection cycles.`};let i=tk(r,t);if(!i)return{ok:!1,error:`The file is not a recording.`};let a=FO(n.pageId??r.pageId,49)||`imported`,o=IO(n.exportedAt);return{ok:!0,pageId:a,...o?{exportedAt:o}:{},recording:{...i,recording:!1}}}var ak=1,ok=1,sk=2,ck={c:`component`,h:`lifecycle-hook`,r:`after-render`,o:`output`},lk=e=>Math.round(e*1e6)/1e3;function uk(e,t){let n=e.spanNames??[],r=e.cycles[0]?.at??0,i=e.startedAt??r,a=[],o=0,s=0;for(let t of e.cycles){let e=t.t??Math.max(0,t.at-i),r=e+t.ms;a.push({name:`Change detection #${t.id}`,cat:`change-detection`,ph:`X`,pid:ak,tid:ok,ts:lk(e),dur:lk(t.ms),args:{checks:t.checks,passes:t.passes,...t.trigger?{trigger:t.trigger}:{},...t.hookMs?{hookMs:t.hookMs}:{},...t.afterRenderMs?{afterRenderMs:t.afterRenderMs}:{},...t.outputMs?{outputMs:t.outputMs}:{},...t.cause?{cause:YO(t.cause)}:{},...t.unchanged?{unchanged:t.unchanged}:{},slowest:t.components.map(e=>`${e.name} ${e.checks}x ${e.ms}ms`)}}),s+=t.droppedSpans??0;let c=[{end:r}],l=[...t.spans??[]].sort((e,t)=>e[1]-t[1]||t[2]-e[2]);for(let[r,i,s,u,d]of l){o++;let l=n[r]??`?`;if(d===jO.output){let n=e+i;a.push({name:l,cat:ck[d],ph:`X`,pid:ak,tid:sk,ts:lk(n),dur:lk(i<0?Math.max(0,Math.min(s,-i)):s),args:{cycle:t.id}});continue}let f=Math.max(e,e+i);for(;c.length>1&&c.at(-1).end<=f;)c.pop();let p=c.at(-1).end,m=Math.min(f+s,p);me.ts??0));if(c<0)for(let e of a)e.ts=lk((e.ts-c)/1e3);a.sort((e,t)=>e.ts-t.ts||t.dur-e.dur);let l=(e,t,n)=>({name:t,ph:`M`,pid:ak,tid:e,args:{name:n}});return{traceEvents:[l(0,`process_name`,`Angular change detection (page ${t})`),l(ok,`thread_name`,`Change detection`),l(sk,`thread_name`,`Outputs`),...a],displayTimeUnit:`ms`,otherData:{source:`Pangular Inspector change detection recording`,pageId:t,cycles:e.cycles.length,droppedCycles:e.dropped,spans:o,droppedSpans:s,...e.startedAt&&e.startedAt<=vO?{startedAt:new Date(e.startedAt).toISOString()}:{}}}}var dk=16.6;function fk(e){return e.ms>dk}function pk(e){return`${e<10?e.toFixed(2):Math.round(e)} ms`}function mk(e,t){if(!t)return[...e];let n=Math.min(t.from,t.to),r=Math.max(t.from,t.to),i=e.filter(e=>e.id>=n&&e.id<=r);return i.length?i:[...e]}function hk(e){let t=new Map;for(let n of e)for(let e of n.components){let n=t.get(e.name);n?(n.checks+=e.checks,n.ms+=e.ms,n.maxMs=Math.max(n.maxMs,e.ms),n.cycles+=1):t.set(e.name,{name:e.name,checks:e.checks,ms:e.ms,maxMs:e.ms,cycles:1})}return[...t.values()].sort((e,t)=>t.ms-e.ms||e.name.localeCompare(t.name))}function gk(e){let t=e.reduce((e,t)=>Math.max(e,t.ms),0);return Math.max(t,dk*1.25)}function _k(e,t,n=3){let r=e.map(e=>({item:e,value:t(e)})).filter(e=>e.value>0).sort((e,t)=>t.value-e.value),i=r.reduce((e,t)=>e+t.value,0);if(!i)return[];let a=n/i,o=[],s=0,c=0,l=n,u=1,d=[],f=(e,t)=>{let n=e.reduce((e,t)=>e+t,0),r=Math.max(...e),i=Math.min(...e);return Math.max(t*t*r/(n*n),n*n/(t*t*i))},p=()=>{let e=d.reduce((e,t)=>e+t.area,0);if(l>=u){let t=e/u,n=c;for(let e of d){let r=e.area/t;o.push({item:e.item,x:s,y:n,w:t,h:r}),n+=r}s+=t,l-=t}else{let t=e/l,n=s;for(let e of d){let r=e.area/t;o.push({item:e.item,x:n,y:c,w:r,h:t}),n+=r}c+=t,u-=t}d=[]};for(let e of r){let t=e.value*a,n=Math.min(l,u),r=d.map(e=>e.area);d.length&&f([...r,t],n)>f(r,n)&&p(),d.push({item:e.item,area:t})}return d.length&&p(),o.map(e=>({item:e.item,x:e.x/n*100,y:e.y*100,w:e.w/n*100,h:e.h*100}))}var vk={c:`component`,h:`hook`,r:`afterRender`,o:`output`};function yk(e,t){if(t===`c`)return e||null;if(t===`h`){let t=e.lastIndexOf(`.`);return t>0?e.slice(0,t):null}if(t===`o`){let t=e.indexOf(` (`),n=t>0?e.slice(0,t):e;return n&&n!==`?`?n:null}return null}function bk(e,t){let n=e.filter(e=>e.spans?.length);if(!n.length)return null;let r=n.map(e=>{let t=e.spans,n=Math.min(0,...t.map(e=>e[1])),r=Math.max(e.ms,...t.map(e=>e[1]+e[2]));return{cycle:e,spans:t,from:n,width:Math.max(r-n,.001)}}),i=r.reduce((e,t)=>e+t.width,0),a=[],o=[],s=0,c=0;for(let{cycle:e,spans:n,from:l,width:u}of r){o.push({id:e.id,x:s/i*100,w:u/i*100,droppedSpans:e.droppedSpans??0});let r=[...n].sort((e,t)=>e[1]-t[1]||e[3]-t[3]),d=[];for(let[n,o,u,f,p]of r){let r=t[n]??`unknown`,m=d[f-1],h=f>0&&m!==void 0&&ot.kind,Sk=(e,t)=>t.name,Ck=(e,t)=>t.name+`.`+t.input;function wk(e,t){e&1&&(z(0,`p`,3),K(1,` The page has no Angular change detection scheduler the overlay could find (it needs Angular 18 or later), so cycles have no cause. `),B())}function Tk(e,t){if(e&1&&(z(0,`tr`)(1,`td`),K(2),B(),z(3,`td`,6),K(4),B()()),e&2){let e=t.$implicit;O(2),q(e.label),O(2),q(e.count)}}function Ek(e,t){if(e&1&&(z(0,`table`)(1,`thead`)(2,`tr`)(3,`th`,4),K(4,`Trigger`),B(),z(5,`th`,5),K(6,`Cycles`),B()()(),z(7,`tbody`),N(8,Tk,5,2,`tr`,null,xk),B()()),e&2){let e=W(2);O(8),P(e.causes())}}function Dk(e,t){e&1&&(z(0,`p`,3),K(1,`No cycle has a cause yet.`),B())}function Ok(e,t){if(e&1&&(z(0,`tr`)(1,`td`,7),K(2),B(),z(3,`td`,6),K(4),B(),z(5,`td`,7),K(6),B()()),e&2){let e=t.$implicit;O(2),q(e.name),O(2),q(e.ticks),O(2),q(e.tasks?.join(`, `))}}function kk(e,t){if(e&1&&(z(0,`table`)(1,`thead`)(2,`tr`)(3,`th`,4),K(4,`Component`),B(),z(5,`th`,5),K(6,`Zone-only ticks`),B(),z(7,`th`,4),K(8,`After`),B()()(),z(9,`tbody`),N(10,Ok,7,3,`tr`,null,Sk),B()()),e&2){let e=W(3);O(10),P(e.zone())}}function Ak(e,t){if(e&1&&(z(0,`p`,3),K(1),B()),e&2){let e=W(3);O(),q(e.zoneNote())}}function jk(e,t){if(e&1&&(z(0,`div`)(1,`h4`),K(2,`Depends on zone.js`),B(),j(3,kk,12,0,`table`)(4,Ak,2,1,`p`,3),B()),e&2){let e=W(),t=W();O(3),M(t.zone().length?3:e.triggers?4:-1)}}function Mk(e,t){e&1&&(z(0,`p`,3),K(1,`The page can't watch DOM updates, so wasted checks are not counted.`),B())}function Nk(e,t){if(e&1&&(z(0,`tr`)(1,`td`,7),K(2),B(),z(3,`td`,6),K(4),B(),z(5,`td`,6),K(6),B(),z(7,`td`),K(8),B()()),e&2){let e=t.$implicit,n=W(3);O(2),q(e.name),O(2),q(e.refreshed),O(2),Y(``,e.unchanged,` (`,n.share(e.unchanged,e.refreshed),`)`),O(2),q(e.strategy??`Unknown`)}}function Pk(e,t){if(e&1&&(z(0,`table`)(1,`thead`)(2,`tr`)(3,`th`,4),K(4,`Component`),B(),z(5,`th`,5),K(6,`Refreshed`),B(),z(7,`th`,5),K(8,`Changed nothing`),B(),z(9,`th`,4),K(10,`Strategy`),B()()(),z(11,`tbody`),N(12,Nk,9,5,`tr`,null,Sk),B()()),e&2){let e=W(2);O(12),P(e.wasted())}}function Fk(e,t){e&1&&(z(0,`p`,3),K(1,`Every refreshed check changed something.`),B())}function Ik(e,t){if(e&1&&(z(0,`tr`)(1,`td`,7),K(2),B(),z(3,`td`,7),K(4),B(),z(5,`td`,6),K(6),B(),z(7,`td`,6),K(8),B()()),e&2){let e=t.$implicit;O(2),Y(``,e.name,`.`,e.input),O(2),q(e.parent??`Unknown`),O(2),q(e.inPlace),O(2),q(e.sameContents)}}function Lk(e,t){if(e&1&&(z(0,`h4`),K(1,`Inputs that break OnPush`),B(),z(2,`table`)(3,`thead`)(4,`tr`)(5,`th`,4),K(6,`Input`),B(),z(7,`th`,4),K(8,`Set by`),B(),z(9,`th`,5),K(10,`Changed in place`),B(),z(11,`th`,5),K(12,`Same contents, new reference`),B()()(),z(13,`tbody`),N(14,Ik,9,5,`tr`,null,Ck),B()()),e&2){let e=W(2);O(14),P(e.inputs())}}function Rk(e,t){if(e&1&&(z(0,`li`),K(1),B()),e&2){let e=t.$implicit;O(),q(e.text)}}function zk(e,t){if(e&1&&(z(0,`h4`),K(1,`Hints`),B(),z(2,`ul`,8),N(3,Rk,2,1,`li`,null,vg),B()),e&2){let e=W(2);O(3),P(e.hints())}}function Bk(e,t){if(e&1&&(z(0,`section`,0)(1,`h3`,1),K(2,`Why it ran and what it wasted`),B(),z(3,`div`,2)(4,`div`)(5,`h4`),K(6,`What started the cycles`),B(),j(7,wk,2,0,`p`,3)(8,Ek,10,0,`table`)(9,Dk,2,0,`p`,3),B(),j(10,jk,5,1,`div`),B(),z(11,`h4`),K(12,`Wasted checks`),B(),j(13,Mk,2,0,`p`,3)(14,Pk,14,0,`table`)(15,Fk,2,0,`p`,3),j(16,Lk,16,0),j(17,zk,5,0),B()),e&2){let e=t,n=W();O(7),M(e.triggers?n.causes().length?8:9:7),O(3),M(n.hasZone()?10:-1),O(3),M(e.waste?n.wasted().length?14:15:13),O(3),M(n.inputs().length?16:-1),O(),M(n.hints().length?17:-1)}}var Vk=10,Hk=class e{page=$(null);diagnosis=X(()=>this.page()?.diagnosis??null);causes=X(()=>{let e=this.diagnosis()?.causes??{};return VO.filter(t=>e[t]).map(t=>({kind:t,label:HO[t],count:e[t]}))});zone=X(()=>(this.diagnosis()?.zone??[]).slice(0,Vk));zoneTicks=X(()=>this.diagnosis()?.causes.zone??0);hasZone=X(()=>this.diagnosis()?.zoneJs??(this.zone().length>0||this.zoneTicks()>0));zoneNote=X(()=>{let e=this.zoneTicks();return e?`${e} ${e===1?`tick`:`ticks`} came from zone.js alone, and no component changed in them.`:`No component changed in a tick only zone.js started.`});wasted=X(()=>(this.diagnosis()?.components??[]).filter(e=>e.unchanged>0).slice(0,Vk));inputs=X(()=>(this.diagnosis()?.inputs??[]).slice(0,Vk));hints=X(()=>XO(this.diagnosis()??void 0).slice(0,Vk));share(e,t){return t?`${Math.round(e/t*100)}%`:`0%`}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-cd-diagnosis`]],inputs:{page:[1,`page`]},decls:1,vars:1,consts:[[`aria-labelledby`,`cd-diagnosis-heading`,1,`diagnosis`],[`id`,`cd-diagnosis-heading`],[1,`grid`],[1,`note`],[`scope`,`col`],[`scope`,`col`,1,`num`],[1,`num`],[1,`mono`],[1,`hints`]],template:function(e,t){if(e&1&&j(0,Bk,18,5,`section`,0),e&2){let e;M((e=t.diagnosis())?0:-1,e)}},styles:[`[_nghost-%COMP%] { display: block; } @@ -844,7 +844,7 @@ td.mono[_ngcontent-%COMP%] { .hints[_ngcontent-%COMP%] li[_ngcontent-%COMP%] + li[_ngcontent-%COMP%] { margin-top: 4px; -}`]})},Wk=(e,t)=>t.cycle.id,Gk=(e,t)=>t.id;function Kk(e,t){if(e&1){let e=V();z(0,`button`,27),U(`click`,function(){return w(e),T(W().showAll())}),K(1,`Show all cycles`),B()}}function qk(e,t){if(e&1&&jg(0,`div`,28),e&2){let e=t;S_(`left`,e.left,`%`)(`width`,e.width,`%`)}}function Jk(e,t){if(e&1&&(z(0,`div`,29),jg(1,`span`,30),B()),e&2){let e=t.$implicit,n=W();G(`over`,e.over)(`out`,!n.inRange(e.index)&&!!n.range())(`active`,n.focused()&&n.active()===e.index),Lg(`id`,n.optionId(e.index)),A(`data-index`,e.index)(`aria-selected`,n.inRange(e.index))(`aria-label`,e.label),O(),S_(`height`,e.height,`%`)}}function Yk(e,t){e&1&&(z(0,`span`,33),K(1,`over budget`),B())}function Xk(e,t){if(e&1&&(z(0,`p`),K(1,` after `),z(2,`span`,35),K(3),B()()),e&2){let e=W();O(3),q(e.cycle.trigger)}}function Zk(e,t){if(e&1&&(z(0,`p`,34)(1,`span`,36),K(2),B(),z(3,`span`),K(4),B()()),e&2){let e=t.$implicit,n=W(2);O(2),q(e.name),O(2),q(n.fmt(e.ms))}}function Qk(e,t){if(e&1&&(z(0,`div`,31)(1,`p`,32)(2,`strong`),K(3),B(),z(4,`span`),K(5),B(),j(6,Yk,2,0,`span`,33),B(),j(7,Xk,4,1,`p`),z(8,`p`),K(9),B(),N(10,Zk,5,2,`p`,34,yg),B()),e&2){let e=t,n=W();S_(`left`,e.left)(`right`,e.right),O(3),q(n.fmt(e.cycle.ms)),O(2),J(`cycle `,e.cycle.id),O(),M(e.over?6:-1),O(),M(e.cycle.trigger?7:-1),O(2),B_(` `,e.cycle.checks,` `,e.cycle.checks===1?`check`:`checks`,`, `,e.cycle.passes,` `,e.cycle.passes===1?`pass`:`passes`,` `),O(),P(e.top)}}function $k(e,t){if(e&1&&jg(0,`span`),e&2){let e=t.$implicit;G(`over`,e.over)}}function eA(e,t){if(e&1&&K(0),e&2){let e=t,n=W(2);Y(` `,e.name,` (`,n.fmt(e.ms),`) `)}}function tA(e,t){if(e&1&&(z(0,`tr`)(1,`td`,37),K(2),B(),z(3,`td`,37),K(4),B(),z(5,`td`),K(6),B(),z(7,`td`,37),K(8),B(),z(9,`td`,37),K(10),B(),z(11,`td`,35),K(12),B(),z(13,`td`,35),j(14,eA,1,2),B()()),e&2){let e,n=t.$implicit,r=W();O(2),q(n.id),O(2),q(r.fmt(n.ms)),O(2),q(r.isOver(n)?`Over`:`Within`),O(2),q(n.checks),O(2),q(n.passes),O(2),q(n.trigger??``),O(2),M((e=n.components[0])?14:-1,e)}}var nA=0,rA=80,iA=10,aA=class e{cycles=$([]);range=Tv(null);gapUntil=rA;budgetLabel=`${fk} ms budget`;uid=`cd-chart-${nA++}`;hintId=`${this.uid}-hint`;active=D(null);anchor=null;dragging=!1;hover=D(null);focused=D(!1);max=X(()=>_k(this.cycles()));budgetAt=X(()=>fk/this.max()*100);bars=X(()=>{let e=this.max();return this.cycles().map((t,n)=>({cycle:t,index:n,height:t.ms/e*100,over:pk(t),label:this.describe(t)}))});firstId=X(()=>this.cycles()[0]?.id??0);lastId=X(()=>this.cycles().at(-1)?.id??0);span=X(()=>{let e=this.range();if(!e)return null;let t=this.cycles(),n=Math.min(e.from,e.to),r=Math.max(e.from,e.to),i=t.findIndex(e=>e.id>=n),a=-1;for(let e=t.length-1;e>=0;e--)if(t[e].id<=r){a=e;break}return i<0||ahk(this.cycles(),this.range()));startId=X(()=>this.selected()[0]?.id??``);endId=X(()=>this.selected().at(-1)?.id??``);band=X(()=>{let e=this.span(),t=this.cycles().length;return!e||!t?null:{left:e.start/t*100,width:(e.end-e.start+1)/t*100}});summary=X(()=>{let e=this.selected(),t=e.filter(pk).length;return`${this.span()?e.length===1?`Cycle ${e[0].id}`:`Cycles ${e[0].id} to ${e.at(-1).id} (${e.length})`:`All ${e.length} ${e.length===1?`cycle`:`cycles`}`}. ${t} over the ${fk} ms budget.`});tableLabel=X(()=>this.span()?`Picked cycles, ${this.summary()}`:`All recorded cycles`);activeOptionId=X(()=>{let e=this.active();return this.focused()&&e!==null&&e{let e=this.hover()??(this.focused()?this.active():null),t=e===null?void 0:this.cycles()[e];return!t||e===null?null:{cycle:t,over:pk(t),top:t.components.slice(0,3),...this.tipSide(e)}});tipSide(e){let t=this.cycles().length;return e+.5=t.start&&e<=t.end}describe(e){let t=[`Cycle ${e.id}`,mk(e.ms)];pk(e)&&t.push(`over budget`),e.trigger&&t.push(`after ${e.trigger}`),t.push(`${e.checks} ${e.checks===1?`check`:`checks`}`);let n=e.components[0];return n&&t.push(`slowest ${n.name} ${mk(n.ms)}`),t.join(`, `)}select(e,t){let n=this.cycles(),r=n[Math.min(e,t)],i=n[Math.max(e,t)];r&&i&&this.range.set({from:r.id,to:i.id})}showAll(){this.range.set(null),this.anchor=null}setEnd(e,t){if(!this.cycles().length)return;let n=t.target,r=Number.parseInt(n.value,10);if(Number.isNaN(r)){n.value=String(e===`from`?this.startId():this.endId());return}let i=Math.min(Math.max(r,this.firstId()),this.lastId()),a=this.selected(),o=e===`from`?i:a[0]?.id??this.firstId(),s=e===`to`?i:a.at(-1)?.id??this.lastId();this.range.set({from:Math.min(o,s),to:Math.max(o,s)}),n.value=String(e===`from`?Math.min(o,s):Math.max(o,s))}onFocus(){this.focused.set(!0),(this.active()===null||this.active()>=this.cycles().length)&&this.active.set(this.span()?.start??Math.max(this.cycles().length-1,0)),this.anchor??=this.active()}onKey(e){let t=this.cycles().length;if(!t)return;let n=Math.min(this.active()??t-1,t-1),r=null;switch(e.key){case`ArrowRight`:case`ArrowDown`:r=n+1;break;case`ArrowLeft`:case`ArrowUp`:r=n-1;break;case`PageDown`:r=n+iA;break;case`PageUp`:r=n-iA;break;case`Home`:r=0;break;case`End`:r=t-1;break;case`Enter`:case` `:e.preventDefault(),this.anchor=n,this.select(n,n);return;case`Escape`:this.range()&&(e.preventDefault(),this.showAll());return;default:return}e.preventDefault(),r=Math.min(Math.max(r,0),t-1),this.active.set(r),this.hover.set(null),e.shiftKey?(this.anchor??=n,this.select(this.anchor,r)):this.anchor=r}indexAt(e){let t=e.target?.closest?.(`[data-index]`);if(t)return Number(t.getAttribute(`data-index`));let n=e.currentTarget?.getBoundingClientRect(),r=this.cycles().length;if(!n?.width||!r)return null;let i=(e.clientX-n.left)/n.width;return Math.min(Math.max(Math.floor(i*r),0),r-1)}startDrag(e){if(e.button!==0)return;let t=this.indexAt(e);t!==null&&(this.dragging=!0,this.anchor=t,this.active.set(t),this.select(t,t))}onPointerMove(e){let t=this.indexAt(e);this.hover.set(t),this.dragging&&t!==null&&this.anchor!==null&&(this.active.set(t),this.select(this.anchor,t))}endDrag(){this.dragging=!1}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-cd-cycle-chart`]],hostBindings:function(e,t){e&1&&H(`pointerup`,function(){return t.endDrag()},ju)(`pointercancel`,function(){return t.endDrag()},ju)},inputs:{cycles:[1,`cycles`],range:[1,`range`]},outputs:{range:`rangeChange`},decls:69,vars:25,consts:[[1,`range`],[`type`,`number`,`inputmode`,`numeric`,3,`change`,`min`,`max`,`value`],[`type`,`button`],[1,`summary`],[1,`hint`,3,`id`],[1,`plot`],[`aria-hidden`,`true`,1,`axis`],[1,`tick`,`top`],[1,`tick`,`zero`],[1,`area`],[`aria-hidden`,`true`,1,`band`,3,`left`,`width`],[`aria-hidden`,`true`,1,`budget`],[`role`,`listbox`,`aria-multiselectable`,`true`,`aria-orientation`,`horizontal`,`tabindex`,`0`,1,`bars`,3,`keydown`,`focus`,`blur`,`pointerdown`,`pointermove`,`pointerleave`],[`role`,`option`,1,`col`,3,`id`,`over`,`out`,`active`],[`aria-hidden`,`true`,1,`tip`,3,`left`,`right`],[`aria-hidden`,`true`,1,`markers`],[3,`over`],[`aria-label`,`Chart key`,1,`legend`],[`aria-hidden`,`true`,1,`key`,`ok`],[`aria-hidden`,`true`,1,`key`,`over`],[`aria-hidden`,`true`,1,`key-marker`],[`aria-hidden`,`true`,1,`key`,`line`],[1,`table`],[`tabindex`,`0`,`role`,`region`,1,`table-wrap`],[1,`sr-only`],[`scope`,`col`,1,`num`],[`scope`,`col`],[`type`,`button`,3,`click`],[`aria-hidden`,`true`,1,`band`],[`role`,`option`,1,`col`,3,`id`],[1,`bar`],[`aria-hidden`,`true`,1,`tip`],[1,`tip-head`],[1,`flag`],[1,`tip-row`],[1,`mono`],[1,`mono`,`name`],[1,`num`]],template:function(e,t){if(e&1&&(z(0,`div`,0)(1,`label`)(2,`span`),K(3,`Start`),B(),z(4,`input`,1),U(`change`,function(e){return t.setEnd(`from`,e)}),B()(),z(5,`label`)(6,`span`),K(7,`End`),B(),z(8,`input`,1),U(`change`,function(e){return t.setEnd(`to`,e)}),B()(),j(9,Kk,2,0,`button`,2),z(10,`p`,3),K(11),B()(),z(12,`p`,4),K(13,` Drag across the bars to pick a range of cycles. With the chart focused, the arrow keys move between cycles, Shift with an arrow key extends the range, Enter picks one cycle and Escape shows all cycles again. `),B(),z(14,`div`,5)(15,`div`,6)(16,`span`,7),K(17),B(),z(18,`span`,8),K(19,`0 ms`),B()(),z(20,`div`,9),j(21,qk,1,4,`div`,10),z(22,`div`,11)(23,`span`),K(24),B()(),z(25,`div`,12),U(`keydown`,function(e){return t.onKey(e)})(`focus`,function(){return t.onFocus()})(`blur`,function(){return t.focused.set(!1)})(`pointerdown`,function(e){return t.startDrag(e)})(`pointermove`,function(e){return t.onPointerMove(e)})(`pointerleave`,function(){return t.hover.set(null)}),N(26,Jk,2,12,`div`,13,Wk),B(),j(28,Qk,12,12,`div`,14),B()(),z(29,`div`,15),N(30,$k,1,2,`span`,16,Wk),B(),z(32,`ul`,17)(33,`li`),jg(34,`span`,18),K(35,`Within budget`),B(),z(36,`li`),jg(37,`span`,19)(38,`span`,20),K(39,`Over budget `),B(),z(40,`li`),jg(41,`span`,21),K(42),B()(),z(43,`details`,22)(44,`summary`),K(45,`Show the cycles as a table`),B(),z(46,`div`,23)(47,`table`)(48,`caption`,24),K(49),B(),z(50,`thead`)(51,`tr`)(52,`th`,25),K(53,`Cycle`),B(),z(54,`th`,25),K(55,`Duration`),B(),z(56,`th`,26),K(57,`Budget`),B(),z(58,`th`,25),K(59,`Checks`),B(),z(60,`th`,25),K(61,`Passes`),B(),z(62,`th`,26),K(63,`After`),B(),z(64,`th`,26),K(65,`Slowest component`),B()()(),z(66,`tbody`),N(67,tA,15,7,`tr`,null,Gk),B()()()()),e&2){let e,n;O(4),Lg(`min`,t.firstId())(`max`,t.lastId())(`value`,t.startId()),O(4),Lg(`min`,t.firstId())(`max`,t.lastId())(`value`,t.endId()),O(),M(t.range()?9:-1),O(2),q(t.summary()),O(),Lg(`id`,t.hintId),O(2),G(`flush`,t.bars().length>t.gapUntil),O(3),q(t.fmt(t.max())),O(4),M((e=t.band())?21:-1,e),O(),S_(`bottom`,t.budgetAt(),`%`),O(2),q(t.budgetLabel),O(),A(`aria-label`,`Change detection cycles, `+t.summary())(`aria-describedby`,t.hintId)(`aria-activedescendant`,t.activeOptionId()),O(),P(t.bars()),O(2),M((n=t.tip())?28:-1,n),O(),G(`flush`,t.bars().length>t.gapUntil),O(),P(t.bars()),O(12),q(t.budgetLabel),O(4),A(`aria-label`,t.tableLabel()),O(3),J(` `,t.tableLabel(),` `),O(18),P(t.selected())}},styles:[`[_nghost-%COMP%] { +}`]})},Uk=(e,t)=>t.cycle.id,Wk=(e,t)=>t.id;function Gk(e,t){if(e&1){let e=V();z(0,`button`,27),U(`click`,function(){return w(e),T(W().showAll())}),K(1,`Show all cycles`),B()}}function Kk(e,t){if(e&1&&Ag(0,`div`,28),e&2){let e=t;x_(`left`,e.left,`%`)(`width`,e.width,`%`)}}function qk(e,t){if(e&1&&(z(0,`div`,29),Ag(1,`span`,30),B()),e&2){let e=t.$implicit,n=W();G(`over`,e.over)(`out`,!n.inRange(e.index)&&!!n.range())(`active`,n.focused()&&n.active()===e.index),Ig(`id`,n.optionId(e.index)),A(`data-index`,e.index)(`aria-selected`,n.inRange(e.index))(`aria-label`,e.label),O(),x_(`height`,e.height,`%`)}}function Jk(e,t){e&1&&(z(0,`span`,33),K(1,`over budget`),B())}function Yk(e,t){if(e&1&&(z(0,`p`),K(1,` after `),z(2,`span`,35),K(3),B()()),e&2){let e=W();O(3),q(e.cycle.trigger)}}function Xk(e,t){if(e&1&&(z(0,`p`,34)(1,`span`,36),K(2),B(),z(3,`span`),K(4),B()()),e&2){let e=t.$implicit,n=W(2);O(2),q(e.name),O(2),q(n.fmt(e.ms))}}function Zk(e,t){if(e&1&&(z(0,`div`,31)(1,`p`,32)(2,`strong`),K(3),B(),z(4,`span`),K(5),B(),j(6,Jk,2,0,`span`,33),B(),j(7,Yk,4,1,`p`),z(8,`p`),K(9),B(),N(10,Xk,5,2,`p`,34,vg),B()),e&2){let e=t,n=W();x_(`left`,e.left)(`right`,e.right),O(3),q(n.fmt(e.cycle.ms)),O(2),J(`cycle `,e.cycle.id),O(),M(e.over?6:-1),O(),M(e.cycle.trigger?7:-1),O(2),z_(` `,e.cycle.checks,` `,e.cycle.checks===1?`check`:`checks`,`, `,e.cycle.passes,` `,e.cycle.passes===1?`pass`:`passes`,` `),O(),P(e.top)}}function Qk(e,t){if(e&1&&Ag(0,`span`),e&2){let e=t.$implicit;G(`over`,e.over)}}function $k(e,t){if(e&1&&K(0),e&2){let e=t,n=W(2);Y(` `,e.name,` (`,n.fmt(e.ms),`) `)}}function eA(e,t){if(e&1&&(z(0,`tr`)(1,`td`,37),K(2),B(),z(3,`td`,37),K(4),B(),z(5,`td`),K(6),B(),z(7,`td`,37),K(8),B(),z(9,`td`,37),K(10),B(),z(11,`td`,35),K(12),B(),z(13,`td`,35),j(14,$k,1,2),B()()),e&2){let e,n=t.$implicit,r=W();O(2),q(n.id),O(2),q(r.fmt(n.ms)),O(2),q(r.isOver(n)?`Over`:`Within`),O(2),q(n.checks),O(2),q(n.passes),O(2),q(n.trigger??``),O(2),M((e=n.components[0])?14:-1,e)}}var tA=0,nA=80,rA=10,iA=class e{cycles=$([]);range=wv(null);gapUntil=nA;budgetLabel=`${dk} ms budget`;uid=`cd-chart-${tA++}`;hintId=`${this.uid}-hint`;active=D(null);anchor=null;dragging=!1;hover=D(null);focused=D(!1);max=X(()=>gk(this.cycles()));budgetAt=X(()=>dk/this.max()*100);bars=X(()=>{let e=this.max();return this.cycles().map((t,n)=>({cycle:t,index:n,height:t.ms/e*100,over:fk(t),label:this.describe(t)}))});firstId=X(()=>this.cycles()[0]?.id??0);lastId=X(()=>this.cycles().at(-1)?.id??0);span=X(()=>{let e=this.range();if(!e)return null;let t=this.cycles(),n=Math.min(e.from,e.to),r=Math.max(e.from,e.to),i=t.findIndex(e=>e.id>=n),a=-1;for(let e=t.length-1;e>=0;e--)if(t[e].id<=r){a=e;break}return i<0||amk(this.cycles(),this.range()));startId=X(()=>this.selected()[0]?.id??``);endId=X(()=>this.selected().at(-1)?.id??``);band=X(()=>{let e=this.span(),t=this.cycles().length;return!e||!t?null:{left:e.start/t*100,width:(e.end-e.start+1)/t*100}});summary=X(()=>{let e=this.selected(),t=e.filter(fk).length;return`${this.span()?e.length===1?`Cycle ${e[0].id}`:`Cycles ${e[0].id} to ${e.at(-1).id} (${e.length})`:`All ${e.length} ${e.length===1?`cycle`:`cycles`}`}. ${t} over the ${dk} ms budget.`});tableLabel=X(()=>this.span()?`Picked cycles, ${this.summary()}`:`All recorded cycles`);activeOptionId=X(()=>{let e=this.active();return this.focused()&&e!==null&&e{let e=this.hover()??(this.focused()?this.active():null),t=e===null?void 0:this.cycles()[e];return!t||e===null?null:{cycle:t,over:fk(t),top:t.components.slice(0,3),...this.tipSide(e)}});tipSide(e){let t=this.cycles().length;return e+.5=t.start&&e<=t.end}describe(e){let t=[`Cycle ${e.id}`,pk(e.ms)];fk(e)&&t.push(`over budget`),e.trigger&&t.push(`after ${e.trigger}`),t.push(`${e.checks} ${e.checks===1?`check`:`checks`}`);let n=e.components[0];return n&&t.push(`slowest ${n.name} ${pk(n.ms)}`),t.join(`, `)}select(e,t){let n=this.cycles(),r=n[Math.min(e,t)],i=n[Math.max(e,t)];r&&i&&this.range.set({from:r.id,to:i.id})}showAll(){this.range.set(null),this.anchor=null}setEnd(e,t){if(!this.cycles().length)return;let n=t.target,r=Number.parseInt(n.value,10);if(Number.isNaN(r)){n.value=String(e===`from`?this.startId():this.endId());return}let i=Math.min(Math.max(r,this.firstId()),this.lastId()),a=this.selected(),o=e===`from`?i:a[0]?.id??this.firstId(),s=e===`to`?i:a.at(-1)?.id??this.lastId();this.range.set({from:Math.min(o,s),to:Math.max(o,s)}),n.value=String(e===`from`?Math.min(o,s):Math.max(o,s))}onFocus(){this.focused.set(!0),(this.active()===null||this.active()>=this.cycles().length)&&this.active.set(this.span()?.start??Math.max(this.cycles().length-1,0)),this.anchor??=this.active()}onKey(e){let t=this.cycles().length;if(!t)return;let n=Math.min(this.active()??t-1,t-1),r=null;switch(e.key){case`ArrowRight`:case`ArrowDown`:r=n+1;break;case`ArrowLeft`:case`ArrowUp`:r=n-1;break;case`PageDown`:r=n+rA;break;case`PageUp`:r=n-rA;break;case`Home`:r=0;break;case`End`:r=t-1;break;case`Enter`:case` `:e.preventDefault(),this.anchor=n,this.select(n,n);return;case`Escape`:this.range()&&(e.preventDefault(),this.showAll());return;default:return}e.preventDefault(),r=Math.min(Math.max(r,0),t-1),this.active.set(r),this.hover.set(null),e.shiftKey?(this.anchor??=n,this.select(this.anchor,r)):this.anchor=r}indexAt(e){let t=e.target?.closest?.(`[data-index]`);if(t)return Number(t.getAttribute(`data-index`));let n=e.currentTarget?.getBoundingClientRect(),r=this.cycles().length;if(!n?.width||!r)return null;let i=(e.clientX-n.left)/n.width;return Math.min(Math.max(Math.floor(i*r),0),r-1)}startDrag(e){if(e.button!==0)return;let t=this.indexAt(e);t!==null&&(this.dragging=!0,this.anchor=t,this.active.set(t),this.select(t,t))}onPointerMove(e){let t=this.indexAt(e);this.hover.set(t),this.dragging&&t!==null&&this.anchor!==null&&(this.active.set(t),this.select(this.anchor,t))}endDrag(){this.dragging=!1}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-cd-cycle-chart`]],hostBindings:function(e,t){e&1&&H(`pointerup`,function(){return t.endDrag()},ju)(`pointercancel`,function(){return t.endDrag()},ju)},inputs:{cycles:[1,`cycles`],range:[1,`range`]},outputs:{range:`rangeChange`},decls:69,vars:25,consts:[[1,`range`],[`type`,`number`,`inputmode`,`numeric`,3,`change`,`min`,`max`,`value`],[`type`,`button`],[1,`summary`],[1,`hint`,3,`id`],[1,`plot`],[`aria-hidden`,`true`,1,`axis`],[1,`tick`,`top`],[1,`tick`,`zero`],[1,`area`],[`aria-hidden`,`true`,1,`band`,3,`left`,`width`],[`aria-hidden`,`true`,1,`budget`],[`role`,`listbox`,`aria-multiselectable`,`true`,`aria-orientation`,`horizontal`,`tabindex`,`0`,1,`bars`,3,`keydown`,`focus`,`blur`,`pointerdown`,`pointermove`,`pointerleave`],[`role`,`option`,1,`col`,3,`id`,`over`,`out`,`active`],[`aria-hidden`,`true`,1,`tip`,3,`left`,`right`],[`aria-hidden`,`true`,1,`markers`],[3,`over`],[`aria-label`,`Chart key`,1,`legend`],[`aria-hidden`,`true`,1,`key`,`ok`],[`aria-hidden`,`true`,1,`key`,`over`],[`aria-hidden`,`true`,1,`key-marker`],[`aria-hidden`,`true`,1,`key`,`line`],[1,`table`],[`tabindex`,`0`,`role`,`region`,1,`table-wrap`],[1,`sr-only`],[`scope`,`col`,1,`num`],[`scope`,`col`],[`type`,`button`,3,`click`],[`aria-hidden`,`true`,1,`band`],[`role`,`option`,1,`col`,3,`id`],[1,`bar`],[`aria-hidden`,`true`,1,`tip`],[1,`tip-head`],[1,`flag`],[1,`tip-row`],[1,`mono`],[1,`mono`,`name`],[1,`num`]],template:function(e,t){if(e&1&&(z(0,`div`,0)(1,`label`)(2,`span`),K(3,`Start`),B(),z(4,`input`,1),U(`change`,function(e){return t.setEnd(`from`,e)}),B()(),z(5,`label`)(6,`span`),K(7,`End`),B(),z(8,`input`,1),U(`change`,function(e){return t.setEnd(`to`,e)}),B()(),j(9,Gk,2,0,`button`,2),z(10,`p`,3),K(11),B()(),z(12,`p`,4),K(13,` Drag across the bars to pick a range of cycles. With the chart focused, the arrow keys move between cycles, Shift with an arrow key extends the range, Enter picks one cycle and Escape shows all cycles again. `),B(),z(14,`div`,5)(15,`div`,6)(16,`span`,7),K(17),B(),z(18,`span`,8),K(19,`0 ms`),B()(),z(20,`div`,9),j(21,Kk,1,4,`div`,10),z(22,`div`,11)(23,`span`),K(24),B()(),z(25,`div`,12),U(`keydown`,function(e){return t.onKey(e)})(`focus`,function(){return t.onFocus()})(`blur`,function(){return t.focused.set(!1)})(`pointerdown`,function(e){return t.startDrag(e)})(`pointermove`,function(e){return t.onPointerMove(e)})(`pointerleave`,function(){return t.hover.set(null)}),N(26,qk,2,12,`div`,13,Uk),B(),j(28,Zk,12,12,`div`,14),B()(),z(29,`div`,15),N(30,Qk,1,2,`span`,16,Uk),B(),z(32,`ul`,17)(33,`li`),Ag(34,`span`,18),K(35,`Within budget`),B(),z(36,`li`),Ag(37,`span`,19)(38,`span`,20),K(39,`Over budget `),B(),z(40,`li`),Ag(41,`span`,21),K(42),B()(),z(43,`details`,22)(44,`summary`),K(45,`Show the cycles as a table`),B(),z(46,`div`,23)(47,`table`)(48,`caption`,24),K(49),B(),z(50,`thead`)(51,`tr`)(52,`th`,25),K(53,`Cycle`),B(),z(54,`th`,25),K(55,`Duration`),B(),z(56,`th`,26),K(57,`Budget`),B(),z(58,`th`,25),K(59,`Checks`),B(),z(60,`th`,25),K(61,`Passes`),B(),z(62,`th`,26),K(63,`After`),B(),z(64,`th`,26),K(65,`Slowest component`),B()()(),z(66,`tbody`),N(67,eA,15,7,`tr`,null,Wk),B()()()()),e&2){let e,n;O(4),Ig(`min`,t.firstId())(`max`,t.lastId())(`value`,t.startId()),O(4),Ig(`min`,t.firstId())(`max`,t.lastId())(`value`,t.endId()),O(),M(t.range()?9:-1),O(2),q(t.summary()),O(),Ig(`id`,t.hintId),O(2),G(`flush`,t.bars().length>t.gapUntil),O(3),q(t.fmt(t.max())),O(4),M((e=t.band())?21:-1,e),O(),x_(`bottom`,t.budgetAt(),`%`),O(2),q(t.budgetLabel),O(),A(`aria-label`,`Change detection cycles, `+t.summary())(`aria-describedby`,t.hintId)(`aria-activedescendant`,t.activeOptionId()),O(),P(t.bars()),O(2),M((n=t.tip())?28:-1,n),O(),G(`flush`,t.bars().length>t.gapUntil),O(),P(t.bars()),O(12),q(t.budgetLabel),O(4),A(`aria-label`,t.tableLabel()),O(3),J(` `,t.tableLabel(),` `),O(18),P(t.selected())}},styles:[`[_nghost-%COMP%] { display: block; min-width: 0; } @@ -1224,7 +1224,7 @@ td.mono[_ngcontent-%COMP%] { .bar[_ngcontent-%COMP%] { transition: none; } -}`]})},oA=(e,t)=>t.id,sA=(e,t)=>t.index,cA=(e,t)=>t.kind;function lA(e,t){if(e&1&&(z(0,`p`,0),K(1),B()),e&2){let e=W(2);O(),Y(` Pick `,e.max,` cycles or fewer to see their spans. `,e.count(),` are picked. `)}}function uA(e,t){if(e&1&&(z(0,`span`),K(1),B()),e&2){let e=t.$implicit;S_(`left`,e.x,`%`)(`width`,e.w,`%`),O(),J(`cycle `,e.id)}}function dA(e,t){if(e&1){let e=V();z(0,`button`,11),U(`focus`,function(){let t=w(e).$implicit;return T(W(3).current.set(t.index))})(`mouseenter`,function(){let t=w(e).$implicit;return T(W(3).hover.set(t.index))})(`mouseleave`,function(){return w(e),T(W(3).hover.set(null))})(`click`,function(){let t=w(e).$implicit;return T(W(3).choose(t))}),z(1,`span`,12),K(2),B()()}if(e&2){let e=t.$implicit,n=W(3);C_(Y_(`block kind-`,e.kind)),S_(`left`,e.x,`%`)(`width`,e.w,`%`)(`top`,e.depth*n.row,`px`),G(`narrow`,e.w<4),A(`tabindex`,e.index===n.tabStop()?0:-1)(`data-index`,e.index)(`aria-label`,n.describe(e))(`aria-disabled`,e.component?null:`true`),O(2),q(e.name)}}function fA(e,t){if(e&1&&(z(0,`li`),jg(1,`span`,13),K(2),B()),e&2){let e=t.$implicit;O(),C_(Y_(`key kind-`,e.kind)),O(),q(e.label)}}function pA(e,t){if(e&1&&(z(0,`p`,0),K(1),B()),e&2){let e=W(3);O(),Y(` Each cycle keeps its longest spans. `,e.dropped(),` shorter `,e.dropped()===1?`span was`:`spans were`,` left out. `)}}function mA(e,t){if(e&1&&(z(0,`tr`)(1,`td`,17),K(2),B(),z(3,`td`,18),K(4),B(),z(5,`td`),K(6),B(),z(7,`td`,17),K(8),B(),z(9,`td`,17),K(10),B(),z(11,`td`,17),K(12),B(),z(13,`td`,17),K(14),B()()),e&2){let e=t.$implicit,n=W(4);O(2),q(e.cycleId),O(),S_(`padding-left`,6+e.depth*8,`px`),O(),q(e.name),O(2),q(n.kindLabel(e)),O(2),q(e.depth),O(2),q(n.fmt(e.start)),O(2),q(n.fmt(e.ms)),O(2),q(n.fmt(e.selfMs))}}function hA(e,t){if(e&1&&(z(0,`div`,10)(1,`table`)(2,`caption`,14),K(3),B(),z(4,`thead`)(5,`tr`)(6,`th`,15),K(7,`Cycle`),B(),z(8,`th`,16),K(9,`Span`),B(),z(10,`th`,16),K(11,`Kind`),B(),z(12,`th`,15),K(13,`Depth`),B(),z(14,`th`,15),K(15,`Start`),B(),z(16,`th`,15),K(17,`Total`),B(),z(18,`th`,15),K(19,`Self`),B()()(),z(20,`tbody`),N(21,mA,15,9,`tr`,null,sA),B()()()),e&2){let e=W(),t=W(2);A(`aria-label`,t.tableLabel()),O(3),J(` `,t.tableLabel(),` `),O(18),P(e.blocks)}}function gA(e,t){if(e&1){let e=V();z(0,`div`,1),U(`keydown`,function(t){return w(e),T(W(2).onKey(t))}),z(1,`div`,2),N(2,uA,2,5,`span`,3,oA),B(),z(4,`div`,4),N(5,dA,3,16,`button`,5,sA),B()(),z(7,`p`,6),K(8),B(),z(9,`ul`,7),N(10,fA,3,4,`li`,null,cA),B(),z(12,`p`,8),K(13,` Arrow keys move along a row, Up goes to the enclosing span and Down to the first nested one. Enter on a component shows it in the tree. `),B(),j(14,pA,2,2,`p`,0),z(15,`details`,9),U(`toggle`,function(t){return w(e),T(W(2).onToggle(t))}),z(16,`summary`),K(17,`Show the spans as a table`),B(),j(18,hA,23,2,`div`,10),B()}if(e&2){let e=t,n=W(2);A(`aria-label`,n.label()),O(2),P(e.cycles),O(2),S_(`height`,e.depth*n.row,`px`),O(),P(e.blocks),O(3),q(n.readout()),O(2),P(n.kinds),O(4),M(n.dropped()?14:-1),O(4),M(n.tableOpen()?18:-1)}}function _A(e,t){if(e&1&&(z(0,`h3`),K(1,`Spans in the picked cycles`),B(),j(2,lA,2,2,`p`,0)(3,gA,19,6)),e&2){let e,t=W();O(2),M(t.tooMany()?2:(e=t.graph())?3:-1,e)}}var vA=22;function yA(e,t){for(let n=e.length-1;n>=0;n--)if(t(e[n]))return e[n]}var bA=class e{cycles=$([]);names=$([]);scope=$(`the recording`);pick=bv();row=vA;max=30;kinds=[`c`,`h`,`r`,`o`].map(e=>({kind:e,label:yk[e]}));current=D(0);tableOpen=D(!1);hover=D(null);hasSpans=X(()=>this.cycles().some(e=>e.spans?.length));count=X(()=>this.cycles().length);tooMany=X(()=>this.count()>30);graph=X(()=>this.tooMany()?null:xk(this.cycles(),this.names()));tabStop=X(()=>Math.min(this.current(),Math.max((this.graph()?.blocks.length??1)-1,0)));dropped=X(()=>this.graph()?.cycles.reduce((e,t)=>e+t.droppedSpans,0)??0);label=X(()=>`Spans in ${this.scope()} over time, nested by depth. Pick a component to show it in the tree.`);readout=X(()=>{let e=(this.graph()?.blocks??[])[this.hover()??this.tabStop()];return e?this.describe(e):``});tableLabel=X(()=>`Timed spans in ${this.scope()}`);fmt(e){return mk(e)}kindLabel(e){return yk[e.kind]}onToggle(e){this.tableOpen.set(e.target.open)}describe(e){let t=[e.name,yk[e.kind],`${mk(e.ms)} total`];return e.selfMs!==e.ms&&t.push(`${mk(e.selfMs)} self`),t.push(e.start<0?`cycle ${e.cycleId}, ${mk(-e.start)} before it started`:`cycle ${e.cycleId} at ${mk(e.start)}`),t.join(`, `)}choose(e){this.current.set(e.index),e.component&&this.pick.emit(e.component)}onKey(e){let t=this.graph()?.blocks??[];if(!t.length)return;let n=t[this.tabStop()],r;switch(e.key){case`ArrowRight`:r=t.find(e=>e.index>n.index&&e.depth===n.depth);break;case`ArrowLeft`:r=yA(t,e=>e.indexe.indexe.parent===n.index)??t.find(e=>e.index>n.index&&e.depth===n.depth+1);break;case`Home`:r=t[0];break;case`End`:r=t.at(-1);break;default:return}e.preventDefault(),this.hover.set(null),r&&(this.current.set(r.index),e.currentTarget.querySelector(`button[data-index="${r.index}"]`)?.focus())}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-cd-flame-graph`]],inputs:{cycles:[1,`cycles`],names:[1,`names`],scope:[1,`scope`]},outputs:{pick:`pick`},decls:1,vars:1,consts:[[1,`note`],[`role`,`group`,1,`flame`,3,`keydown`],[`aria-hidden`,`true`,1,`cycles`],[3,`left`,`width`],[1,`rows`],[`type`,`button`,3,`class`,`narrow`,`left`,`width`,`top`],[`aria-hidden`,`true`,1,`readout`],[`aria-label`,`Span kinds`,1,`legend`],[1,`hint`],[1,`table`,3,`toggle`],[`tabindex`,`0`,`role`,`region`,1,`table-wrap`],[`type`,`button`,3,`focus`,`mouseenter`,`mouseleave`,`click`],[1,`text`],[`aria-hidden`,`true`],[1,`sr-only`],[`scope`,`col`,1,`num`],[`scope`,`col`],[1,`num`],[1,`mono`]],template:function(e,t){e&1&&j(0,_A,4,1),e&2&&M(t.hasSpans()?0:-1)},styles:[`[_nghost-%COMP%] { +}`]})},aA=(e,t)=>t.id,oA=(e,t)=>t.index,sA=(e,t)=>t.kind;function cA(e,t){if(e&1&&(z(0,`p`,0),K(1),B()),e&2){let e=W(2);O(),Y(` Pick `,e.max,` cycles or fewer to see their spans. `,e.count(),` are picked. `)}}function lA(e,t){if(e&1&&(z(0,`span`),K(1),B()),e&2){let e=t.$implicit;x_(`left`,e.x,`%`)(`width`,e.w,`%`),O(),J(`cycle `,e.id)}}function uA(e,t){if(e&1){let e=V();z(0,`button`,11),U(`focus`,function(){let t=w(e).$implicit;return T(W(3).current.set(t.index))})(`mouseenter`,function(){let t=w(e).$implicit;return T(W(3).hover.set(t.index))})(`mouseleave`,function(){return w(e),T(W(3).hover.set(null))})(`click`,function(){let t=w(e).$implicit;return T(W(3).choose(t))}),z(1,`span`,12),K(2),B()()}if(e&2){let e=t.$implicit,n=W(3);S_(J_(`block kind-`,e.kind)),x_(`left`,e.x,`%`)(`width`,e.w,`%`)(`top`,e.depth*n.row,`px`),G(`narrow`,e.w<4),A(`tabindex`,e.index===n.tabStop()?0:-1)(`data-index`,e.index)(`aria-label`,n.describe(e))(`aria-disabled`,e.component?null:`true`),O(2),q(e.name)}}function dA(e,t){if(e&1&&(z(0,`li`),Ag(1,`span`,13),K(2),B()),e&2){let e=t.$implicit;O(),S_(J_(`key kind-`,e.kind)),O(),q(e.label)}}function fA(e,t){if(e&1&&(z(0,`p`,0),K(1),B()),e&2){let e=W(3);O(),Y(` Each cycle keeps its longest spans. `,e.dropped(),` shorter `,e.dropped()===1?`span was`:`spans were`,` left out. `)}}function pA(e,t){if(e&1&&(z(0,`tr`)(1,`td`,17),K(2),B(),z(3,`td`,18),K(4),B(),z(5,`td`),K(6),B(),z(7,`td`,17),K(8),B(),z(9,`td`,17),K(10),B(),z(11,`td`,17),K(12),B(),z(13,`td`,17),K(14),B()()),e&2){let e=t.$implicit,n=W(4);O(2),q(e.cycleId),O(),x_(`padding-left`,6+e.depth*8,`px`),O(),q(e.name),O(2),q(n.kindLabel(e)),O(2),q(e.depth),O(2),q(n.fmt(e.start)),O(2),q(n.fmt(e.ms)),O(2),q(n.fmt(e.selfMs))}}function mA(e,t){if(e&1&&(z(0,`div`,10)(1,`table`)(2,`caption`,14),K(3),B(),z(4,`thead`)(5,`tr`)(6,`th`,15),K(7,`Cycle`),B(),z(8,`th`,16),K(9,`Span`),B(),z(10,`th`,16),K(11,`Kind`),B(),z(12,`th`,15),K(13,`Depth`),B(),z(14,`th`,15),K(15,`Start`),B(),z(16,`th`,15),K(17,`Total`),B(),z(18,`th`,15),K(19,`Self`),B()()(),z(20,`tbody`),N(21,pA,15,9,`tr`,null,oA),B()()()),e&2){let e=W(),t=W(2);A(`aria-label`,t.tableLabel()),O(3),J(` `,t.tableLabel(),` `),O(18),P(e.blocks)}}function hA(e,t){if(e&1){let e=V();z(0,`div`,1),U(`keydown`,function(t){return w(e),T(W(2).onKey(t))}),z(1,`div`,2),N(2,lA,2,5,`span`,3,aA),B(),z(4,`div`,4),N(5,uA,3,16,`button`,5,oA),B()(),z(7,`p`,6),K(8),B(),z(9,`ul`,7),N(10,dA,3,4,`li`,null,sA),B(),z(12,`p`,8),K(13,` Arrow keys move along a row, Up goes to the enclosing span and Down to the first nested one. Enter on a component shows it in the tree. `),B(),j(14,fA,2,2,`p`,0),z(15,`details`,9),U(`toggle`,function(t){return w(e),T(W(2).onToggle(t))}),z(16,`summary`),K(17,`Show the spans as a table`),B(),j(18,mA,23,2,`div`,10),B()}if(e&2){let e=t,n=W(2);A(`aria-label`,n.label()),O(2),P(e.cycles),O(2),x_(`height`,e.depth*n.row,`px`),O(),P(e.blocks),O(3),q(n.readout()),O(2),P(n.kinds),O(4),M(n.dropped()?14:-1),O(4),M(n.tableOpen()?18:-1)}}function gA(e,t){if(e&1&&(z(0,`h3`),K(1,`Spans in the picked cycles`),B(),j(2,cA,2,2,`p`,0)(3,hA,19,6)),e&2){let e,t=W();O(2),M(t.tooMany()?2:(e=t.graph())?3:-1,e)}}var _A=22;function vA(e,t){for(let n=e.length-1;n>=0;n--)if(t(e[n]))return e[n]}var yA=class e{cycles=$([]);names=$([]);scope=$(`the recording`);pick=yv();row=_A;max=30;kinds=[`c`,`h`,`r`,`o`].map(e=>({kind:e,label:vk[e]}));current=D(0);tableOpen=D(!1);hover=D(null);hasSpans=X(()=>this.cycles().some(e=>e.spans?.length));count=X(()=>this.cycles().length);tooMany=X(()=>this.count()>30);graph=X(()=>this.tooMany()?null:bk(this.cycles(),this.names()));tabStop=X(()=>Math.min(this.current(),Math.max((this.graph()?.blocks.length??1)-1,0)));dropped=X(()=>this.graph()?.cycles.reduce((e,t)=>e+t.droppedSpans,0)??0);label=X(()=>`Spans in ${this.scope()} over time, nested by depth. Pick a component to show it in the tree.`);readout=X(()=>{let e=(this.graph()?.blocks??[])[this.hover()??this.tabStop()];return e?this.describe(e):``});tableLabel=X(()=>`Timed spans in ${this.scope()}`);fmt(e){return pk(e)}kindLabel(e){return vk[e.kind]}onToggle(e){this.tableOpen.set(e.target.open)}describe(e){let t=[e.name,vk[e.kind],`${pk(e.ms)} total`];return e.selfMs!==e.ms&&t.push(`${pk(e.selfMs)} self`),t.push(e.start<0?`cycle ${e.cycleId}, ${pk(-e.start)} before it started`:`cycle ${e.cycleId} at ${pk(e.start)}`),t.join(`, `)}choose(e){this.current.set(e.index),e.component&&this.pick.emit(e.component)}onKey(e){let t=this.graph()?.blocks??[];if(!t.length)return;let n=t[this.tabStop()],r;switch(e.key){case`ArrowRight`:r=t.find(e=>e.index>n.index&&e.depth===n.depth);break;case`ArrowLeft`:r=vA(t,e=>e.indexe.indexe.parent===n.index)??t.find(e=>e.index>n.index&&e.depth===n.depth+1);break;case`Home`:r=t[0];break;case`End`:r=t.at(-1);break;default:return}e.preventDefault(),this.hover.set(null),r&&(this.current.set(r.index),e.currentTarget.querySelector(`button[data-index="${r.index}"]`)?.focus())}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-cd-flame-graph`]],inputs:{cycles:[1,`cycles`],names:[1,`names`],scope:[1,`scope`]},outputs:{pick:`pick`},decls:1,vars:1,consts:[[1,`note`],[`role`,`group`,1,`flame`,3,`keydown`],[`aria-hidden`,`true`,1,`cycles`],[3,`left`,`width`],[1,`rows`],[`type`,`button`,3,`class`,`narrow`,`left`,`width`,`top`],[`aria-hidden`,`true`,1,`readout`],[`aria-label`,`Span kinds`,1,`legend`],[1,`hint`],[1,`table`,3,`toggle`],[`tabindex`,`0`,`role`,`region`,1,`table-wrap`],[`type`,`button`,3,`focus`,`mouseenter`,`mouseleave`,`click`],[1,`text`],[`aria-hidden`,`true`],[1,`sr-only`],[`scope`,`col`,1,`num`],[`scope`,`col`],[1,`num`],[1,`mono`]],template:function(e,t){e&1&&j(0,gA,4,1),e&2&&M(t.hasSpans()?0:-1)},styles:[`[_nghost-%COMP%] { display: block; min-width: 0; } @@ -1431,7 +1431,7 @@ td.mono[_ngcontent-%COMP%] { .num[_ngcontent-%COMP%] { text-align: right; font-variant-numeric: tabular-nums; -}`]})};function xA(e,t){if(e&1&&(z(0,`tr`)(1,`td`,5),K(2),B(),z(3,`td`,6),K(4),B(),z(5,`td`,6),K(6),B(),z(7,`td`,6),K(8),B()()),e&2){let e=t.$implicit,n=W(3);O(2),Y(``,e.name,`.`,e.hook),O(2),q(e.calls),O(2),q(n.ms(e.ms)),O(2),q(n.ms(e.maxMs))}}function SA(e,t){if(e&1&&(z(0,`div`)(1,`h3`),K(2,`Lifecycle hooks`),B(),z(3,`table`)(4,`thead`)(5,`tr`)(6,`th`,3),K(7,`Hook`),B(),z(8,`th`,4),K(9,`Calls`),B(),z(10,`th`,4),K(11,`Time`),B(),z(12,`th`,4),K(13,`Slowest`),B()()(),z(14,`tbody`),N(15,xA,9,5,`tr`,null,yg),B()()()),e&2){let e=W(2);O(15),P(e.hooks())}}function CA(e,t){if(e&1&&K(0),e&2){let e=W().$implicit;J(` (`,e.listener,`) `)}}function wA(e,t){if(e&1&&(z(0,`tr`)(1,`td`,5),K(2),j(3,CA,1,1),B(),z(4,`td`,6),K(5),B(),z(6,`td`,6),K(7),B(),z(8,`td`,6),K(9),B()()),e&2){let e=t.$implicit,n=W(3);O(2),J(` `,e.name,` `),O(),M(e.listener?3:-1),O(2),q(e.calls),O(2),q(n.ms(e.ms)),O(2),q(n.ms(e.maxMs))}}function TA(e,t){if(e&1&&(z(0,`div`)(1,`h3`),K(2,`Output listeners`),B(),z(3,`table`)(4,`thead`)(5,`tr`)(6,`th`,3),K(7,`Listener`),B(),z(8,`th`,4),K(9,`Calls`),B(),z(10,`th`,4),K(11,`Time`),B(),z(12,`th`,4),K(13,`Slowest`),B()()(),z(14,`tbody`),N(15,wA,10,5,`tr`,null,yg),B()()()),e&2){let e=W(2);O(15),P(e.outputs())}}function EA(e,t){if(e&1&&(z(0,`p`,1),K(1),B()),e&2){let e=t,n=W(2);O(),B_(` afterRender callbacks ran `,e.runs,` `,e.runs===1?`time`:`times`,`, `,n.ms(e.ms),` in total, slowest `,n.ms(e.maxMs),`. `)}}function DA(e,t){if(e&1&&(z(0,`p`,2),K(1),B()),e&2){let e=W(2);O(),Y(` `,e.dropped(),` more hook or output `,e.dropped()===1?`row is`:`rows are`,` left out. A recording lists at most 100 of each. `)}}function OA(e,t){if(e&1&&(z(0,`div`,0),j(1,SA,17,0,`div`),j(2,TA,17,0,`div`),B(),j(3,EA,2,4,`p`,1),j(4,DA,2,2,`p`,2)),e&2){let e,t=W();O(),M(t.hooks().length?1:-1),O(),M(t.outputs().length?2:-1),O(),M((e=t.afterRender())?3:-1,e),O(),M(t.dropped()?4:-1)}}var kA=10;function AA(e){return`${e<10?e.toFixed(2):Math.round(e)} ms`}var jA=class e{page=$(null);hooks=X(()=>(this.page()?.hooks??[]).slice(0,kA));outputs=X(()=>(this.page()?.outputs??[]).slice(0,kA));afterRender=X(()=>{let e=this.page()?.afterRender;return e?.runs?e:null});dropped=X(()=>this.page()?.droppedTimings??0);ms(e){return AA(e)}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-cd-timing`]],inputs:{page:[1,`page`]},decls:1,vars:1,consts:[[1,`timing`],[1,`after-render`],[1,`note`],[`scope`,`col`],[`scope`,`col`,1,`num`],[1,`mono`],[1,`num`]],template:function(e,t){e&1&&j(0,OA,5,4),e&2&&M(t.hooks().length||t.outputs().length||t.afterRender()?0:-1)},styles:[`[_nghost-%COMP%] { +}`]})};function bA(e,t){if(e&1&&(z(0,`tr`)(1,`td`,5),K(2),B(),z(3,`td`,6),K(4),B(),z(5,`td`,6),K(6),B(),z(7,`td`,6),K(8),B()()),e&2){let e=t.$implicit,n=W(3);O(2),Y(``,e.name,`.`,e.hook),O(2),q(e.calls),O(2),q(n.ms(e.ms)),O(2),q(n.ms(e.maxMs))}}function xA(e,t){if(e&1&&(z(0,`div`)(1,`h3`),K(2,`Lifecycle hooks`),B(),z(3,`table`)(4,`thead`)(5,`tr`)(6,`th`,3),K(7,`Hook`),B(),z(8,`th`,4),K(9,`Calls`),B(),z(10,`th`,4),K(11,`Time`),B(),z(12,`th`,4),K(13,`Slowest`),B()()(),z(14,`tbody`),N(15,bA,9,5,`tr`,null,vg),B()()()),e&2){let e=W(2);O(15),P(e.hooks())}}function SA(e,t){if(e&1&&K(0),e&2){let e=W().$implicit;J(` (`,e.listener,`) `)}}function CA(e,t){if(e&1&&(z(0,`tr`)(1,`td`,5),K(2),j(3,SA,1,1),B(),z(4,`td`,6),K(5),B(),z(6,`td`,6),K(7),B(),z(8,`td`,6),K(9),B()()),e&2){let e=t.$implicit,n=W(3);O(2),J(` `,e.name,` `),O(),M(e.listener?3:-1),O(2),q(e.calls),O(2),q(n.ms(e.ms)),O(2),q(n.ms(e.maxMs))}}function wA(e,t){if(e&1&&(z(0,`div`)(1,`h3`),K(2,`Output listeners`),B(),z(3,`table`)(4,`thead`)(5,`tr`)(6,`th`,3),K(7,`Listener`),B(),z(8,`th`,4),K(9,`Calls`),B(),z(10,`th`,4),K(11,`Time`),B(),z(12,`th`,4),K(13,`Slowest`),B()()(),z(14,`tbody`),N(15,CA,10,5,`tr`,null,vg),B()()()),e&2){let e=W(2);O(15),P(e.outputs())}}function TA(e,t){if(e&1&&(z(0,`p`,1),K(1),B()),e&2){let e=t,n=W(2);O(),z_(` afterRender callbacks ran `,e.runs,` `,e.runs===1?`time`:`times`,`, `,n.ms(e.ms),` in total, slowest `,n.ms(e.maxMs),`. `)}}function EA(e,t){if(e&1&&(z(0,`p`,2),K(1),B()),e&2){let e=W(2);O(),Y(` `,e.dropped(),` more hook or output `,e.dropped()===1?`row is`:`rows are`,` left out. A recording lists at most 100 of each. `)}}function DA(e,t){if(e&1&&(z(0,`div`,0),j(1,xA,17,0,`div`),j(2,wA,17,0,`div`),B(),j(3,TA,2,4,`p`,1),j(4,EA,2,2,`p`,2)),e&2){let e,t=W();O(),M(t.hooks().length?1:-1),O(),M(t.outputs().length?2:-1),O(),M((e=t.afterRender())?3:-1,e),O(),M(t.dropped()?4:-1)}}var OA=10;function kA(e){return`${e<10?e.toFixed(2):Math.round(e)} ms`}var AA=class e{page=$(null);hooks=X(()=>(this.page()?.hooks??[]).slice(0,OA));outputs=X(()=>(this.page()?.outputs??[]).slice(0,OA));afterRender=X(()=>{let e=this.page()?.afterRender;return e?.runs?e:null});dropped=X(()=>this.page()?.droppedTimings??0);ms(e){return kA(e)}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-cd-timing`]],inputs:{page:[1,`page`]},decls:1,vars:1,consts:[[1,`timing`],[1,`after-render`],[1,`note`],[`scope`,`col`],[`scope`,`col`,1,`num`],[1,`mono`],[1,`num`]],template:function(e,t){e&1&&j(0,DA,5,4),e&2&&M(t.hooks().length||t.outputs().length||t.afterRender()?0:-1)},styles:[`[_nghost-%COMP%] { display: block; } @@ -1491,7 +1491,7 @@ td.mono[_ngcontent-%COMP%] { margin: 8px 0 0; color: var(--%NS%text-2); font-size: 12px; -}`]})};function MA(e,t){if(e&1&&(z(0,`p`,5),K(1),B()),e&2){let e=W();O(),q(e.error())}}function NA(e,t){let n=new Blob([JSON.stringify(e,null,2)],{type:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=t,document.body.append(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(r),0)}var PA=class e{page=$(null);maxCycles=$(200);imported=bv();error=D(``);hasCycles(){return(this.page()?.cycles.length??0)>0}exportJson(){let e=this.page();e&&NA(ik(e,e.pageId),`change-detection-${e.pageId}.json`)}exportTrace(){let e=this.page();e&&NA(dk(e,e.pageId),`change-detection-${e.pageId}.trace.json`)}async read(e){let t=e.files?.[0];if(e.value=``,!t)return;if(t.size>2e7){this.error.set(`${t.name}: The file is larger than 20 MB.`);return}let n;try{n=await t.text()}catch{this.error.set(`Could not read the file.`);return}let r=ak(n,this.maxCycles());if(!r.ok){this.error.set(`${t.name}: ${r.error}`);return}this.error.set(``),this.imported.emit({fileName:t.name,page:{...r.recording,pageId:r.pageId,supported:!0}})}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-cd-transfer`]],inputs:{page:[1,`page`],maxCycles:[1,`maxCycles`]},outputs:{imported:`imported`},decls:10,vars:3,consts:[[`file`,``],[`role`,`group`,`aria-label`,`Export and import the recording`,1,`transfer`],[`type`,`button`,3,`click`,`disabled`],[`type`,`button`,3,`click`],[`type`,`file`,`accept`,`.json,application/json`,`hidden`,``,3,`change`],[`role`,`alert`,1,`error`]],template:function(e,t){if(e&1){let e=V();z(0,`div`,1)(1,`button`,2),U(`click`,function(){return t.exportJson()}),K(2,`Export JSON`),B(),z(3,`button`,2),U(`click`,function(){return t.exportTrace()}),K(4,` Export trace (Perfetto) `),B(),z(5,`button`,3),U(`click`,function(){return w(e),T(t_(8).click())}),K(6,`Import`),B(),z(7,`input`,4,0),U(`change`,function(){w(e);let n=t_(8);return T(t.read(n))}),B()(),j(9,MA,2,1,`p`,5)}e&2&&(O(),Lg(`disabled`,!t.hasCycles()),O(2),Lg(`disabled`,!t.hasCycles()),O(6),M(t.error()?9:-1))},styles:[`[_nghost-%COMP%] { +}`]})};function jA(e,t){if(e&1&&(z(0,`p`,5),K(1),B()),e&2){let e=W();O(),q(e.error())}}function MA(e,t){let n=new Blob([JSON.stringify(e,null,2)],{type:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=t,document.body.append(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(r),0)}var NA=class e{page=$(null);maxCycles=$(200);imported=yv();error=D(``);hasCycles(){return(this.page()?.cycles.length??0)>0}exportJson(){let e=this.page();e&&MA(rk(e,e.pageId),`change-detection-${e.pageId}.json`)}exportTrace(){let e=this.page();e&&MA(uk(e,e.pageId),`change-detection-${e.pageId}.trace.json`)}async read(e){let t=e.files?.[0];if(e.value=``,!t)return;if(t.size>2e7){this.error.set(`${t.name}: The file is larger than 20 MB.`);return}let n;try{n=await t.text()}catch{this.error.set(`Could not read the file.`);return}let r=ik(n,this.maxCycles());if(!r.ok){this.error.set(`${t.name}: ${r.error}`);return}this.error.set(``),this.imported.emit({fileName:t.name,page:{...r.recording,pageId:r.pageId,supported:!0}})}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-cd-transfer`]],inputs:{page:[1,`page`],maxCycles:[1,`maxCycles`]},outputs:{imported:`imported`},decls:10,vars:3,consts:[[`file`,``],[`role`,`group`,`aria-label`,`Export and import the recording`,1,`transfer`],[`type`,`button`,3,`click`,`disabled`],[`type`,`button`,3,`click`],[`type`,`file`,`accept`,`.json,application/json`,`hidden`,``,3,`change`],[`role`,`alert`,1,`error`]],template:function(e,t){if(e&1){let e=V();z(0,`div`,1)(1,`button`,2),U(`click`,function(){return t.exportJson()}),K(2,`Export JSON`),B(),z(3,`button`,2),U(`click`,function(){return t.exportTrace()}),K(4,` Export trace (Perfetto) `),B(),z(5,`button`,3),U(`click`,function(){return w(e),T(e_(8).click())}),K(6,`Import`),B(),z(7,`input`,4,0),U(`change`,function(){w(e);let n=e_(8);return T(t.read(n))}),B()(),j(9,jA,2,1,`p`,5)}e&2&&(O(),Ig(`disabled`,!t.hasCycles()),O(2),Ig(`disabled`,!t.hasCycles()),O(6),M(t.error()?9:-1))},styles:[`[_nghost-%COMP%] { display: contents; } @@ -1533,7 +1533,7 @@ button[_ngcontent-%COMP%]:disabled { margin: 0; color: var(--%NS%danger-text); font-size: 12px; -}`]})},FA=(e,t)=>t.stat.name;function IA(e,t){if(e&1&&(z(0,`span`,8),K(1),B()),e&2){let e=W(2).$implicit;O(),J(``,e.other,` more`)}}function LA(e,t){if(e&1&&(z(0,`div`,6)(1,`span`,7),K(2),B(),j(3,IA,2,1,`span`,8),B()),e&2){let e=W().$implicit;S_(`--%NS%tone`,e.tone+`%`),O(2),q(e.label),O(),M(e.roomy?3:-1)}}function RA(e,t){if(e&1&&(z(0,`span`,10),K(1),B(),z(2,`span`,11),K(3),B()),e&2){let e=W(2).$implicit,t=W(2);O(),q(e.stat.name),O(2),q(t.fmt(e.stat.ms))}}function zA(e,t){if(e&1){let e=V();z(0,`button`,9),U(`focus`,function(){w(e);let t=W().$index;return T(W(2).current.set(t))})(`click`,function(){w(e);let t=W().$implicit;return T(W(2).pick.emit(t.stat.name))}),j(1,RA,4,2),B()}if(e&2){let e=W(),t=e.$implicit,n=e.$index,r=W(2);S_(`--%NS%tone`,t.tone+`%`),A(`tabindex`,n===r.tabStop()?0:-1)(`aria-label`,t.label)(`data-index`,n),O(),M(t.roomy?1:-1)}}function BA(e,t){if(e&1&&(z(0,`li`),j(1,LA,4,4,`div`,4)(2,zA,2,6,`button`,5),B()),e&2){let e=t.$implicit;S_(`left`,e.x,`%`)(`top`,e.y,`%`)(`width`,e.w,`%`)(`height`,e.h,`%`),O(),M(e.other?1:2)}}function VA(e,t){if(e&1){let e=V();z(0,`ul`,2),U(`keydown`,function(t){return w(e),T(W().onKey(t))}),N(1,BA,3,9,`li`,3,FA),B()}if(e&2){let e=W();A(`aria-label`,e.label()),O(),P(e.cells())}}function HA(e,t){e&1&&(z(0,`p`,1),K(1,`No component time in these cycles.`),B())}var UA=24,WA=3,GA=class e{stats=$([]);scope=$(`the recording`);pick=bv();current=D(0);label=X(()=>`Self time per component in ${this.scope()}, largest first. Pick one to show it in the tree.`);cells=X(()=>{let e=this.stats().filter(e=>e.ms>0),t=e.slice(0,UA),n=e.slice(UA),r=n.reduce((e,t)=>e+t.ms,0),i=t.map(e=>({stat:e,other:0}));n.length&&i.push({stat:{name:`Other components`,checks:0,ms:r,maxMs:0,cycles:0},other:n.length});let a=e.reduce((e,t)=>e+t.ms,0),o=t[0]?.ms??1,s=vk(i,e=>e.stat.ms,WA);return s.sort((e,t)=>Number(e.item.other>0)-Number(t.item.other>0)),s.map(e=>{let{stat:t,other:n}=e.item,r=a?Math.round(t.ms/a*100):0;return{stat:t,other:n,x:e.x,y:e.y,w:e.w,h:e.h,tone:n?0:14+Math.round(26*Math.min(t.ms/o,1)),roomy:e.w>=10&&e.h>=22,label:n?`${n} more components, ${mk(t.ms)}, ${r}% of self time`:`${t.name}, ${mk(t.ms)} self time, ${r}%, ${t.checks} ${t.checks===1?`check`:`checks`}`}})});tabStop=X(()=>Math.min(this.current(),Math.max(this.cells().filter(e=>!e.other).length-1,0)));fmt(e){return mk(e)}onKey(e){let t=this.cells().filter(e=>!e.other).length;if(!t)return;let n=this.tabStop(),r;switch(e.key){case`ArrowRight`:case`ArrowDown`:r=Math.min(n+1,t-1);break;case`ArrowLeft`:case`ArrowUp`:r=Math.max(n-1,0);break;case`Home`:r=0;break;case`End`:r=t-1;break;default:return}e.preventDefault(),this.current.set(r),e.currentTarget.querySelector(`button[data-index="${r}"]`)?.focus()}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-cd-treemap`]],inputs:{stats:[1,`stats`],scope:[1,`scope`]},outputs:{pick:`pick`},decls:2,vars:1,consts:[[1,`map`],[1,`empty`],[1,`map`,3,`keydown`],[3,`left`,`top`,`width`,`height`],[1,`cell`,`other`,3,`--%NS%tone`],[`type`,`button`,1,`cell`,3,`--%NS%tone`],[1,`cell`,`other`],[1,`sr-only`],[`aria-hidden`,`true`,1,`name`],[`type`,`button`,1,`cell`,3,`focus`,`click`],[1,`name`,`mono`],[1,`ms`]],template:function(e,t){e&1&&j(0,VA,3,1,`ul`,0)(1,HA,2,0,`p`,1),e&2&&M(+!t.cells().length)},styles:[`[_nghost-%COMP%] { +}`]})},PA=(e,t)=>t.stat.name;function FA(e,t){if(e&1&&(z(0,`span`,8),K(1),B()),e&2){let e=W(2).$implicit;O(),J(``,e.other,` more`)}}function IA(e,t){if(e&1&&(z(0,`div`,6)(1,`span`,7),K(2),B(),j(3,FA,2,1,`span`,8),B()),e&2){let e=W().$implicit;x_(`--%NS%tone`,e.tone+`%`),O(2),q(e.label),O(),M(e.roomy?3:-1)}}function LA(e,t){if(e&1&&(z(0,`span`,10),K(1),B(),z(2,`span`,11),K(3),B()),e&2){let e=W(2).$implicit,t=W(2);O(),q(e.stat.name),O(2),q(t.fmt(e.stat.ms))}}function RA(e,t){if(e&1){let e=V();z(0,`button`,9),U(`focus`,function(){w(e);let t=W().$index;return T(W(2).current.set(t))})(`click`,function(){w(e);let t=W().$implicit;return T(W(2).pick.emit(t.stat.name))}),j(1,LA,4,2),B()}if(e&2){let e=W(),t=e.$implicit,n=e.$index,r=W(2);x_(`--%NS%tone`,t.tone+`%`),A(`tabindex`,n===r.tabStop()?0:-1)(`aria-label`,t.label)(`data-index`,n),O(),M(t.roomy?1:-1)}}function zA(e,t){if(e&1&&(z(0,`li`),j(1,IA,4,4,`div`,4)(2,RA,2,6,`button`,5),B()),e&2){let e=t.$implicit;x_(`left`,e.x,`%`)(`top`,e.y,`%`)(`width`,e.w,`%`)(`height`,e.h,`%`),O(),M(e.other?1:2)}}function BA(e,t){if(e&1){let e=V();z(0,`ul`,2),U(`keydown`,function(t){return w(e),T(W().onKey(t))}),N(1,zA,3,9,`li`,3,PA),B()}if(e&2){let e=W();A(`aria-label`,e.label()),O(),P(e.cells())}}function VA(e,t){e&1&&(z(0,`p`,1),K(1,`No component time in these cycles.`),B())}var HA=24,UA=3,WA=class e{stats=$([]);scope=$(`the recording`);pick=yv();current=D(0);label=X(()=>`Self time per component in ${this.scope()}, largest first. Pick one to show it in the tree.`);cells=X(()=>{let e=this.stats().filter(e=>e.ms>0),t=e.slice(0,HA),n=e.slice(HA),r=n.reduce((e,t)=>e+t.ms,0),i=t.map(e=>({stat:e,other:0}));n.length&&i.push({stat:{name:`Other components`,checks:0,ms:r,maxMs:0,cycles:0},other:n.length});let a=e.reduce((e,t)=>e+t.ms,0),o=t[0]?.ms??1,s=_k(i,e=>e.stat.ms,UA);return s.sort((e,t)=>Number(e.item.other>0)-Number(t.item.other>0)),s.map(e=>{let{stat:t,other:n}=e.item,r=a?Math.round(t.ms/a*100):0;return{stat:t,other:n,x:e.x,y:e.y,w:e.w,h:e.h,tone:n?0:14+Math.round(26*Math.min(t.ms/o,1)),roomy:e.w>=10&&e.h>=22,label:n?`${n} more components, ${pk(t.ms)}, ${r}% of self time`:`${t.name}, ${pk(t.ms)} self time, ${r}%, ${t.checks} ${t.checks===1?`check`:`checks`}`}})});tabStop=X(()=>Math.min(this.current(),Math.max(this.cells().filter(e=>!e.other).length-1,0)));fmt(e){return pk(e)}onKey(e){let t=this.cells().filter(e=>!e.other).length;if(!t)return;let n=this.tabStop(),r;switch(e.key){case`ArrowRight`:case`ArrowDown`:r=Math.min(n+1,t-1);break;case`ArrowLeft`:case`ArrowUp`:r=Math.max(n-1,0);break;case`Home`:r=0;break;case`End`:r=t-1;break;default:return}e.preventDefault(),this.current.set(r),e.currentTarget.querySelector(`button[data-index="${r}"]`)?.focus()}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-cd-treemap`]],inputs:{stats:[1,`stats`],scope:[1,`scope`]},outputs:{pick:`pick`},decls:2,vars:1,consts:[[1,`map`],[1,`empty`],[1,`map`,3,`keydown`],[3,`left`,`top`,`width`,`height`],[1,`cell`,`other`,3,`--%NS%tone`],[`type`,`button`,1,`cell`,3,`--%NS%tone`],[1,`cell`,`other`],[1,`sr-only`],[`aria-hidden`,`true`,1,`name`],[`type`,`button`,1,`cell`,3,`focus`,`click`],[1,`name`,`mono`],[1,`ms`]],template:function(e,t){e&1&&j(0,BA,3,1,`ul`,0)(1,VA,2,0,`p`,1),e&2&&M(+!t.cells().length)},styles:[`[_nghost-%COMP%] { display: block; min-width: 0; } @@ -1609,7 +1609,7 @@ button.cell[_ngcontent-%COMP%]:focus-visible { .empty[_ngcontent-%COMP%] { margin: 8px 0; color: var(--%NS%text-2); -}`]})},KA=(e,t)=>t.id;function qA(e,t){if(e&1){let e=V();I(0,`button`,14),H(`click`,function(){return w(e),T(W(2).clear())}),K(1,`Clear`),L()}}function JA(e,t){if(e&1){let e=V();I(0,`button`,11),H(`click`,function(){return w(e),T(W().toggle())}),R(1,`span`,12),K(2),L(),j(3,qA,2,0,`button`,13)}if(e&2){let e=W();G(`on`,e.recording()),F(`disabled`,!e.pageId()),O(2),J(` `,e.recording()?`Stop recording`:`Record`,` `),O(),M(e.cycles().length?3:-1)}}function YA(e,t){if(e&1){let e=V();I(0,`p`,6)(1,`span`,15),K(2,`Imported recording`),L(),I(3,`span`,16),K(4),L(),I(5,`button`,14),H(`click`,function(){return w(e),T(W().closeImport())}),K(6,`Back to live recording`),L()()}e&2&&(O(4),q(t.fileName))}function XA(e,t){e&1&&K(0,` An app on a device has no DOM, so checks that changed nothing are not counted there. `)}function ZA(e,t){e&1&&(I(0,`p`,9),K(1,` The page has Angular's profiler hook, but the recording could not attach to it yet. The page tries again on its next update while recording is on. If this stays, stop and start the recording, or reload the page. `),L())}function QA(e,t){e&1&&R(0,`app-angular-unavailable`,17),e&2&&F(`page`,W(2).angularPage())}function $A(e,t){e&1&&j(0,ZA,2,0,`p`,9)(1,QA,1,1,`app-angular-unavailable`,17),e&2&&M(+!W().attachPending())}function ej(e,t){e&1&&(I(0,`p`,9),K(1,`Angular profiling stays on until the page reloads.`),L())}function tj(e,t){e&1&&R(0,`app-angular-unavailable`,21),e&2&&F(`page`,W(2).angularPage())}function nj(e,t){if(e&1){let e=V();I(0,`div`,18)(1,`span`,19),K(2,`Live views`),L(),I(3,`button`,20),H(`click`,function(){w(e);let t=W();return T(t.setView(`flash`,!t.views().flash))}),R(4,`span`,12),K(5,` Flash checks `),L(),I(6,`button`,20),H(`click`,function(){w(e);let t=W();return T(t.setView(`track`,!t.views().track))}),R(7,`span`,12),K(8,` Performance track `),L(),I(9,`button`,20),H(`click`,function(){return w(e),T(W().setView(`angularProfiling`,!0))}),R(10,`span`,12),K(11,` Angular profiling `),L()(),I(12,`p`,7),K(13,` Flash checks draws a box over each component on the page as Angular checks it, with its name and how often it was checked, fading over a second. Performance track adds a Pangular track to the Chrome Performance panel with every component check, hook and output. Angular profiling turns on Angular's own track there. `),L(),j(14,ej,2,0,`p`,9)(15,tj,1,1,`app-angular-unavailable`,21)}if(e&2){let e=W();O(3),F(`disabled`,!e.canShowViews()),A(`aria-pressed`,e.views().flash),O(3),F(`disabled`,!e.canShowViews()),A(`aria-pressed`,e.views().track),O(3),F(`disabled`,!e.canShowViews()||e.views().angularProfiling||!e.views().angularProfilingAvailable),A(`aria-pressed`,e.views().angularProfiling),O(5),M(e.views().angularProfiling?14:e.views().angularProfilingAvailable?-1:15)}}function rj(e,t){if(e&1&&(I(0,`p`,9),K(1),L()),e&2){let e=t.$implicit;O(),q(e)}}function ij(e,t){if(e&1&&(I(0,`p`,24),K(1),L()),e&2){let e=W(2);O(),J(` `,e.range()?`The picked cycles have no timed spans, so there is no flame graph for them.`:`This recording has no timed spans, so there is no flame graph. A recording from an older version, or a file saved without spans, has none.`,` `)}}function aj(e,t){e&1&&(I(0,`p`,9),K(1,` For picked cycles, totals come from the 10 slowest components each cycle lists. `),L())}function oj(e,t){if(e&1){let e=V();I(0,`h3`),K(1,`Cycles`),L(),I(2,`app-cd-cycle-chart`,22),W_(`rangeChange`,function(t){w(e);let n=W();return U_(n.range,t)||(n.range=t),T(t)}),L(),I(3,`app-cd-flame-graph`,23),H(`pick`,function(t){return w(e),T(W().showComponent.emit(t))}),L(),j(4,ij,2,1,`p`,24),I(5,`h3`),K(6,`Self time by component`),L(),j(7,aj,2,0,`p`,9),I(8,`app-cd-treemap`,25),H(`pick`,function(t){return w(e),T(W().showComponent.emit(t))}),L()}if(e&2){let e=W();O(2),F(`cycles`,e.cycles()),H_(`range`,e.range),O(),F(`cycles`,e.picked())(`names`,e.spanNames())(`scope`,e.scope()),O(),M(e.hasSpans()?-1:4),O(3),M(e.range()?7:-1),O(),F(`stats`,e.stats())(`scope`,e.scope())}}function sj(e,t){if(e&1&&(I(0,`tr`)(1,`td`,16),K(2),L(),I(3,`td`,31),K(4),L(),I(5,`td`,31),K(6),L(),I(7,`td`,31),K(8),L()()),e&2){let e=t.$implicit,n=W(2);O(2),q(e.name),O(2),q(e.checks),O(2),q(n.ms(e.ms)),O(2),q(n.ms(e.maxMs))}}function cj(e,t){e&1&&(I(0,`tr`)(1,`td`,32),K(2,`No component time in the picked cycles.`),L()())}function lj(e,t){if(e&1&&(I(0,`span`,34),K(1,`from `),I(2,`span`,16),K(3),L()()),e&2){let e=W(3);O(3),q(e.causeText(t))}}function uj(e,t){if(e&1&&(I(0,`span`,34),K(1,`after `),I(2,`span`,16),K(3),L()()),e&2){let e=W().$implicit;O(3),q(e.trigger)}}function dj(e,t){if(e&1&&(I(0,`span`,35),K(1),L()),e&2){let e=W().$implicit;O(),J(``,e.unchanged,` changed nothing`)}}function fj(e,t){if(e&1&&(I(0,`span`,35),K(1),L()),e&2){let e=W().$implicit,t=W(2);O(),J(`hooks `,t.ms(e.hookMs))}}function pj(e,t){if(e&1&&(I(0,`span`,35),K(1),L()),e&2){let e=W().$implicit,t=W(2);O(),J(`afterRender `,t.ms(e.afterRenderMs))}}function mj(e,t){if(e&1&&(I(0,`span`,36),K(1,` slowest `),I(2,`span`,16),K(3),L(),K(4),L()),e&2){let e=t,n=W(3);O(3),q(e.name),O(),J(` `,n.ms(e.ms),` `)}}function hj(e,t){if(e&1&&(I(0,`li`)(1,`span`,33),K(2),L(),I(3,`span`,16),K(4),L(),I(5,`span`),K(6),L(),j(7,lj,4,1,`span`,34)(8,uj,4,1,`span`,34),j(9,dj,2,1,`span`,35),j(10,fj,2,1,`span`,35),j(11,pj,2,1,`span`,35),j(12,mj,5,2,`span`,36),L()),e&2){let e,n,r=t.$implicit,i=W(2);O(2),q(i.clock(r.at)),O(2),q(i.ms(r.ms)),O(2),B_(` `,r.checks,` `,r.checks===1?`check`:`checks`,`, `,r.passes,` `,r.passes===1?`pass`:`passes`,` `),O(),M((e=r.cause)?7:r.trigger?8:-1,e),O(2),M(r.unchanged?9:-1),O(),M(r.hookMs?10:-1),O(),M(r.afterRenderMs?11:-1),O(),M((n=r.components[0])?12:-1,n)}}function gj(e,t){if(e&1&&(I(0,`div`,26)(1,`div`)(2,`h3`),K(3),L(),I(4,`table`)(5,`thead`)(6,`tr`)(7,`th`,27),K(8,`Component`),L(),I(9,`th`,28),K(10,`Checks`),L(),I(11,`th`,28),K(12,`Self time`),L(),I(13,`th`,28),K(14,`Slowest`),L()()(),I(15,`tbody`),N(16,sj,9,4,`tr`,null,yg,!1,cj,3,0,`tr`),L()()(),I(19,`div`)(20,`h3`),K(21,`Latest cycles`),L(),I(22,`ol`,29),N(23,hj,13,11,`li`,null,KA),L()()(),R(25,`app-cd-timing`,30)(26,`app-cd-diagnosis`,30)),e&2){let e=W();O(3),J(` `,e.range()?`Slowest components in the picked cycles`:`Slowest components`,` `),O(13),P(e.slowest()),O(7),P(e.latest()),O(2),F(`page`,e.page()),O(),F(`page`,e.page())}}function _j(e,t){e&1&&(I(0,`p`,10),K(1,`Use the app. Cycles show up here as Angular runs change detection.`),L())}var vj=3e3,yj=10,bj=class e{livePage=$(null,{alias:`page`});pageId=$(null);rpc=$(null);native=$(!1);angularPages=wD(()=>this.rpc());angularPage=X(()=>TD(this.angularPages(),this.pageId()));attachPending=X(()=>this.angularPage()?.capabilities.profiler===!0);showComponent=bv();range=D(null);imported=D(null);page=X(()=>this.imported()?.page??this.livePage());views=Q(()=>this.livePage()?.options??{flash:!1,track:!1,angularProfiling:!1,angularProfilingAvailable:!0});canShowViews=X(()=>!!this.pageId()&&this.livePage()?.supported!==!1);message=D(``);announcement=D(``);recording=X(()=>this.page()?.recording===!0);cycles=X(()=>this.page()?.cycles??[]);maxCycles=X(()=>pE(this.rpc()).limits.cdCycles);picked=X(()=>hk(this.cycles(),this.range()));hasSpans=X(()=>this.picked().some(e=>e.spans?.length));spanNames=X(()=>this.page()?.spanNames??[]);stats=X(()=>this.range()?gk(this.picked()):[...this.page()?.components??[]].sort((e,t)=>t.ms-e.ms));scope=X(()=>{let e=this.range()?this.picked():[];return e.length?e.length===1?`cycle ${e[0].id}`:`cycles ${e[0].id} to ${e.at(-1).id}`:`the recording`});slowest=X(()=>this.stats().slice(0,yj));latest=X(()=>this.cycles().slice(-30).reverse());capNotes=X(()=>{let e=this.page()?.droppedClasses??0,t=this.page()?.droppedHosts??0,n=[];return e>0&&n.push(`${e} more component ${e===1?`class was`:`classes were`} checked than a recording keeps, so ${e===1?`it is`:`they are`} left out of these totals.`),t>0&&n.push(`${t} component ${t===1?`instance was`:`instances were`} checked past the 2000 a recording counts, so ${t===1?`its tree row shows`:`their tree rows show`} no check count.`),n});status=X(()=>{if(this.message())return this.message();let e=this.cycles().length;return this.imported()?`${e} ${e===1?`cycle`:`cycles`} imported.`:this.recording()?`Recording. ${e} ${e===1?`cycle`:`cycles`} so far.`:e?`${e} ${e===1?`cycle`:`cycles`} recorded.`:``});ms(e){return`${e<10?e.toFixed(2):Math.round(e)} ms`}clock(e){return fO(e)}causeText(e){return XO(e)}stopping=D(!1);stopTimer;constructor(){bc(()=>{this.stopping()&&this.livePage()?.recording!==!0&&Z(()=>this.announceStopped())}),C(Ns).onDestroy(()=>clearTimeout(this.stopTimer))}announceStopped(){clearTimeout(this.stopTimer),this.stopping.set(!1);let e=this.livePage()?.cycles.length??0;this.announce(`Recording stopped. ${e} ${e===1?`cycle`:`cycles`} recorded.`)}async toggle(){if(this.recording()){if(!await this.send({on:!1},``,()=>``,`request-change-detection-record`,{quiet:!0}))return;this.stopping.set(!0),clearTimeout(this.stopTimer),this.stopTimer=setTimeout(()=>this.announceStopped(),vj)}else await this.send({on:!0},`Starting…`,()=>`Recording started.`)}showImport(e){this.message.set(``),this.range.set(null),this.imported.set(e);let t=e.page.cycles.length;this.announce(`Imported ${e.fileName}: ${t} ${t===1?`cycle`:`cycles`}. Showing the imported recording.`)}closeImport(){this.imported.set(null),this.range.set(null),this.announce(`Showing the live recording.`)}async clear(){this.range.set(null),await this.send({clear:!0},``,()=>`Cleared the recorded cycles.`)}async setView(e,t){let n=this.views();this.views.set({...n,[e]:t});let r={flash:t?`Flash checks on.`:`Flash checks off.`,track:t?`Performance track on. Record in the Chrome Performance panel to see it.`:`Performance track off.`,angularProfiling:`Angular profiling on. It stays on until the page reloads.`}[e];await this.send({[e]:t},``,()=>r,`request-change-detection-options`)||this.views.set(n)}async send(e,t,n,r=`request-change-detection-record`,{quiet:i=!1}={}){this.message.set(t);try{if(!this.rpc())throw Error(`no client`);return await ZT(this.rpc(),r,{pageId:this.pageId(),...e}),this.message.set(``),i||this.announce(n()),!0}catch{let e=`Could not reach the page.`;return this.message.set(e),this.announce(e),!1}}announce(e){this.announcement.update(t=>t===e?`${e} `:e)}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-cd-recording`]],inputs:{livePage:[1,`page`,`livePage`],pageId:[1,`pageId`],rpc:[1,`rpc`],native:[1,`native`]},outputs:{showComponent:`showComponent`},decls:22,vars:13,consts:[[`aria-labelledby`,`cd-heading`,1,`cd`],[1,`cd-head`],[`id`,`cd-heading`],[3,`imported`,`page`,`maxCycles`],[1,`status`],[`role`,`status`,1,`sr-only`],[1,`imported`],[1,`hint`],[`what`,`cycles`,`limit`,`cdCycles`,3,`dropped`,`max`],[1,`note`],[1,`empty`],[`type`,`button`,3,`click`,`disabled`],[`aria-hidden`,`true`,1,`dot`],[`type`,`button`],[`type`,`button`,3,`click`],[1,`badge`],[1,`mono`],[`capability`,`profiler`,`missing`,``,`compact`,``,3,`page`],[`role`,`group`,`aria-labelledby`,`cd-views-label`,1,`views`],[`id`,`cd-views-label`,1,`views-label`],[`type`,`button`,1,`view`,3,`click`,`disabled`],[`capability`,`angularProfiling`,`missing`,``,`compact`,``,3,`page`],[3,`rangeChange`,`cycles`,`range`],[3,`pick`,`cycles`,`names`,`scope`],[1,`spans-note`],[3,`pick`,`stats`,`scope`],[1,`cd-grid`],[`scope`,`col`],[`scope`,`col`,1,`num`],[`aria-label`,`Latest change detection cycles, newest first`,1,`cycles`],[3,`page`],[1,`num`],[`colspan`,`4`],[1,`when`],[1,`trigger`],[1,`timing`],[1,`top`]],template:function(e,t){if(e&1&&(I(0,`section`,0)(1,`div`,1)(2,`h2`,2),K(3,`Change detection`),L(),j(4,JA,4,5),I(5,`app-cd-transfer`,3),H(`imported`,function(e){return t.showImport(e)}),L(),I(6,`p`,4),K(7),L(),I(8,`p`,5),K(9),L()(),j(10,YA,7,1,`p`,6),I(11,`p`,7),K(12,` Records each change detection cycle with Angular's profiler: how long it took, how many components it checked, what started it and which checks changed nothing. Tree rows show how often each instance was checked. Times come from a development build. While it records, the page also wraps Angular's scheduler, adds a signal write hook and watches DOM updates; all of it stops with the recording. `),j(13,XA,1,0),L(),j(14,$A,2,1),j(15,nj,16,7),R(16,`app-limit-note`,8),N(17,rj,2,1,`p`,9,bg),j(19,oj,9,9),j(20,gj,27,4)(21,_j,2,0,`p`,10),L()),e&2){let e;O(4),M(t.imported()?-1:4),O(),F(`page`,t.page())(`maxCycles`,t.maxCycles()),O(2),q(t.status()),O(2),q(t.announcement()),O(),M((e=t.imported())?10:-1,e),O(3),M(t.native()?13:-1),O(),M(t.page()?.supported===!1?14:-1),O(),M(!t.imported()&&!t.native()?15:-1),O(),F(`dropped`,t.page()?.dropped??0)(`max`,t.maxCycles()),O(),P(t.capNotes()),O(2),M(t.cycles().length?19:-1),O(),M(t.page()?.components?.length?20:t.recording()?21:-1)}},dependencies:[kD,vO,jA,Uk,PA,aA,bA,GA],styles:[`[_nghost-%COMP%] { +}`]})},GA=(e,t)=>t.id;function KA(e,t){if(e&1){let e=V();I(0,`button`,14),H(`click`,function(){return w(e),T(W(2).clear())}),K(1,`Clear`),L()}}function qA(e,t){if(e&1){let e=V();I(0,`button`,11),H(`click`,function(){return w(e),T(W().toggle())}),R(1,`span`,12),K(2),L(),j(3,KA,2,0,`button`,13)}if(e&2){let e=W();G(`on`,e.recording()),F(`disabled`,!e.pageId()),O(2),J(` `,e.recording()?`Stop recording`:`Record`,` `),O(),M(e.cycles().length?3:-1)}}function JA(e,t){if(e&1){let e=V();I(0,`p`,6)(1,`span`,15),K(2,`Imported recording`),L(),I(3,`span`,16),K(4),L(),I(5,`button`,14),H(`click`,function(){return w(e),T(W().closeImport())}),K(6,`Back to live recording`),L()()}e&2&&(O(4),q(t.fileName))}function YA(e,t){e&1&&K(0,` An app on a device has no DOM, so checks that changed nothing are not counted there. `)}function XA(e,t){e&1&&(I(0,`p`,9),K(1,` The page has Angular's profiler hook, but the recording could not attach to it yet. The page tries again on its next update while recording is on. If this stays, stop and start the recording, or reload the page. `),L())}function ZA(e,t){e&1&&R(0,`app-angular-unavailable`,17),e&2&&F(`page`,W(2).angularPage())}function QA(e,t){e&1&&j(0,XA,2,0,`p`,9)(1,ZA,1,1,`app-angular-unavailable`,17),e&2&&M(+!W().attachPending())}function $A(e,t){e&1&&(I(0,`p`,9),K(1,`Angular profiling stays on until the page reloads.`),L())}function ej(e,t){e&1&&R(0,`app-angular-unavailable`,21),e&2&&F(`page`,W(2).angularPage())}function tj(e,t){if(e&1){let e=V();I(0,`div`,18)(1,`span`,19),K(2,`Live views`),L(),I(3,`button`,20),H(`click`,function(){w(e);let t=W();return T(t.setView(`flash`,!t.views().flash))}),R(4,`span`,12),K(5,` Flash checks `),L(),I(6,`button`,20),H(`click`,function(){w(e);let t=W();return T(t.setView(`track`,!t.views().track))}),R(7,`span`,12),K(8,` Performance track `),L(),I(9,`button`,20),H(`click`,function(){return w(e),T(W().setView(`angularProfiling`,!0))}),R(10,`span`,12),K(11,` Angular profiling `),L()(),I(12,`p`,7),K(13,` Flash checks draws a box over each component on the page as Angular checks it, with its name and how often it was checked, fading over a second. Performance track adds a Pangular track to the Chrome Performance panel with every component check, hook and output. Angular profiling turns on Angular's own track there. `),L(),j(14,$A,2,0,`p`,9)(15,ej,1,1,`app-angular-unavailable`,21)}if(e&2){let e=W();O(3),F(`disabled`,!e.canShowViews()),A(`aria-pressed`,e.views().flash),O(3),F(`disabled`,!e.canShowViews()),A(`aria-pressed`,e.views().track),O(3),F(`disabled`,!e.canShowViews()||e.views().angularProfiling||!e.views().angularProfilingAvailable),A(`aria-pressed`,e.views().angularProfiling),O(5),M(e.views().angularProfiling?14:e.views().angularProfilingAvailable?-1:15)}}function nj(e,t){if(e&1&&(I(0,`p`,9),K(1),L()),e&2){let e=t.$implicit;O(),q(e)}}function rj(e,t){if(e&1&&(I(0,`p`,24),K(1),L()),e&2){let e=W(2);O(),J(` `,e.range()?`The picked cycles have no timed spans, so there is no flame graph for them.`:`This recording has no timed spans, so there is no flame graph. A recording from an older version, or a file saved without spans, has none.`,` `)}}function ij(e,t){e&1&&(I(0,`p`,9),K(1,` For picked cycles, totals come from the 10 slowest components each cycle lists. `),L())}function aj(e,t){if(e&1){let e=V();I(0,`h3`),K(1,`Cycles`),L(),I(2,`app-cd-cycle-chart`,22),U_(`rangeChange`,function(t){w(e);let n=W();return H_(n.range,t)||(n.range=t),T(t)}),L(),I(3,`app-cd-flame-graph`,23),H(`pick`,function(t){return w(e),T(W().showComponent.emit(t))}),L(),j(4,rj,2,1,`p`,24),I(5,`h3`),K(6,`Self time by component`),L(),j(7,ij,2,0,`p`,9),I(8,`app-cd-treemap`,25),H(`pick`,function(t){return w(e),T(W().showComponent.emit(t))}),L()}if(e&2){let e=W();O(2),F(`cycles`,e.cycles()),V_(`range`,e.range),O(),F(`cycles`,e.picked())(`names`,e.spanNames())(`scope`,e.scope()),O(),M(e.hasSpans()?-1:4),O(3),M(e.range()?7:-1),O(),F(`stats`,e.stats())(`scope`,e.scope())}}function oj(e,t){if(e&1&&(I(0,`tr`)(1,`td`,16),K(2),L(),I(3,`td`,31),K(4),L(),I(5,`td`,31),K(6),L(),I(7,`td`,31),K(8),L()()),e&2){let e=t.$implicit,n=W(2);O(2),q(e.name),O(2),q(e.checks),O(2),q(n.ms(e.ms)),O(2),q(n.ms(e.maxMs))}}function sj(e,t){e&1&&(I(0,`tr`)(1,`td`,32),K(2,`No component time in the picked cycles.`),L()())}function cj(e,t){if(e&1&&(I(0,`span`,34),K(1,`from `),I(2,`span`,16),K(3),L()()),e&2){let e=W(3);O(3),q(e.causeText(t))}}function lj(e,t){if(e&1&&(I(0,`span`,34),K(1,`after `),I(2,`span`,16),K(3),L()()),e&2){let e=W().$implicit;O(3),q(e.trigger)}}function uj(e,t){if(e&1&&(I(0,`span`,35),K(1),L()),e&2){let e=W().$implicit;O(),J(``,e.unchanged,` changed nothing`)}}function dj(e,t){if(e&1&&(I(0,`span`,35),K(1),L()),e&2){let e=W().$implicit,t=W(2);O(),J(`hooks `,t.ms(e.hookMs))}}function fj(e,t){if(e&1&&(I(0,`span`,35),K(1),L()),e&2){let e=W().$implicit,t=W(2);O(),J(`afterRender `,t.ms(e.afterRenderMs))}}function pj(e,t){if(e&1&&(I(0,`span`,36),K(1,` slowest `),I(2,`span`,16),K(3),L(),K(4),L()),e&2){let e=t,n=W(3);O(3),q(e.name),O(),J(` `,n.ms(e.ms),` `)}}function mj(e,t){if(e&1&&(I(0,`li`)(1,`span`,33),K(2),L(),I(3,`span`,16),K(4),L(),I(5,`span`),K(6),L(),j(7,cj,4,1,`span`,34)(8,lj,4,1,`span`,34),j(9,uj,2,1,`span`,35),j(10,dj,2,1,`span`,35),j(11,fj,2,1,`span`,35),j(12,pj,5,2,`span`,36),L()),e&2){let e,n,r=t.$implicit,i=W(2);O(2),q(i.clock(r.at)),O(2),q(i.ms(r.ms)),O(2),z_(` `,r.checks,` `,r.checks===1?`check`:`checks`,`, `,r.passes,` `,r.passes===1?`pass`:`passes`,` `),O(),M((e=r.cause)?7:r.trigger?8:-1,e),O(2),M(r.unchanged?9:-1),O(),M(r.hookMs?10:-1),O(),M(r.afterRenderMs?11:-1),O(),M((n=r.components[0])?12:-1,n)}}function hj(e,t){if(e&1&&(I(0,`div`,26)(1,`div`)(2,`h3`),K(3),L(),I(4,`table`)(5,`thead`)(6,`tr`)(7,`th`,27),K(8,`Component`),L(),I(9,`th`,28),K(10,`Checks`),L(),I(11,`th`,28),K(12,`Self time`),L(),I(13,`th`,28),K(14,`Slowest`),L()()(),I(15,`tbody`),N(16,oj,9,4,`tr`,null,vg,!1,sj,3,0,`tr`),L()()(),I(19,`div`)(20,`h3`),K(21,`Latest cycles`),L(),I(22,`ol`,29),N(23,mj,13,11,`li`,null,GA),L()()(),R(25,`app-cd-timing`,30)(26,`app-cd-diagnosis`,30)),e&2){let e=W();O(3),J(` `,e.range()?`Slowest components in the picked cycles`:`Slowest components`,` `),O(13),P(e.slowest()),O(7),P(e.latest()),O(2),F(`page`,e.page()),O(),F(`page`,e.page())}}function gj(e,t){e&1&&(I(0,`p`,10),K(1,`Use the app. Cycles show up here as Angular runs change detection.`),L())}var _j=3e3,vj=10,yj=class e{livePage=$(null,{alias:`page`});pageId=$(null);rpc=$(null);native=$(!1);angularPages=CD(()=>this.rpc());angularPage=X(()=>wD(this.angularPages(),this.pageId()));attachPending=X(()=>this.angularPage()?.capabilities.profiler===!0);showComponent=yv();range=D(null);imported=D(null);page=X(()=>this.imported()?.page??this.livePage());views=Q(()=>this.livePage()?.options??{flash:!1,track:!1,angularProfiling:!1,angularProfilingAvailable:!0});canShowViews=X(()=>!!this.pageId()&&this.livePage()?.supported!==!1);message=D(``);announcement=D(``);recording=X(()=>this.page()?.recording===!0);cycles=X(()=>this.page()?.cycles??[]);maxCycles=X(()=>fE(this.rpc()).limits.cdCycles);picked=X(()=>mk(this.cycles(),this.range()));hasSpans=X(()=>this.picked().some(e=>e.spans?.length));spanNames=X(()=>this.page()?.spanNames??[]);stats=X(()=>this.range()?hk(this.picked()):[...this.page()?.components??[]].sort((e,t)=>t.ms-e.ms));scope=X(()=>{let e=this.range()?this.picked():[];return e.length?e.length===1?`cycle ${e[0].id}`:`cycles ${e[0].id} to ${e.at(-1).id}`:`the recording`});slowest=X(()=>this.stats().slice(0,vj));latest=X(()=>this.cycles().slice(-30).reverse());capNotes=X(()=>{let e=this.page()?.droppedClasses??0,t=this.page()?.droppedHosts??0,n=[];return e>0&&n.push(`${e} more component ${e===1?`class was`:`classes were`} checked than a recording keeps, so ${e===1?`it is`:`they are`} left out of these totals.`),t>0&&n.push(`${t} component ${t===1?`instance was`:`instances were`} checked past the 2000 a recording counts, so ${t===1?`its tree row shows`:`their tree rows show`} no check count.`),n});status=X(()=>{if(this.message())return this.message();let e=this.cycles().length;return this.imported()?`${e} ${e===1?`cycle`:`cycles`} imported.`:this.recording()?`Recording. ${e} ${e===1?`cycle`:`cycles`} so far.`:e?`${e} ${e===1?`cycle`:`cycles`} recorded.`:``});ms(e){return`${e<10?e.toFixed(2):Math.round(e)} ms`}clock(e){return dO(e)}causeText(e){return YO(e)}stopping=D(!1);stopTimer;constructor(){bc(()=>{this.stopping()&&this.livePage()?.recording!==!0&&Z(()=>this.announceStopped())}),C(Ns).onDestroy(()=>clearTimeout(this.stopTimer))}announceStopped(){clearTimeout(this.stopTimer),this.stopping.set(!1);let e=this.livePage()?.cycles.length??0;this.announce(`Recording stopped. ${e} ${e===1?`cycle`:`cycles`} recorded.`)}async toggle(){if(this.recording()){if(!await this.send({on:!1},``,()=>``,`request-change-detection-record`,{quiet:!0}))return;this.stopping.set(!0),clearTimeout(this.stopTimer),this.stopTimer=setTimeout(()=>this.announceStopped(),_j)}else await this.send({on:!0},`Starting…`,()=>`Recording started.`)}showImport(e){this.message.set(``),this.range.set(null),this.imported.set(e);let t=e.page.cycles.length;this.announce(`Imported ${e.fileName}: ${t} ${t===1?`cycle`:`cycles`}. Showing the imported recording.`)}closeImport(){this.imported.set(null),this.range.set(null),this.announce(`Showing the live recording.`)}async clear(){this.range.set(null),await this.send({clear:!0},``,()=>`Cleared the recorded cycles.`)}async setView(e,t){let n=this.views();this.views.set({...n,[e]:t});let r={flash:t?`Flash checks on.`:`Flash checks off.`,track:t?`Performance track on. Record in the Chrome Performance panel to see it.`:`Performance track off.`,angularProfiling:`Angular profiling on. It stays on until the page reloads.`}[e];await this.send({[e]:t},``,()=>r,`request-change-detection-options`)||this.views.set(n)}async send(e,t,n,r=`request-change-detection-record`,{quiet:i=!1}={}){this.message.set(t);try{if(!this.rpc())throw Error(`no client`);return await XT(this.rpc(),r,{pageId:this.pageId(),...e}),this.message.set(``),i||this.announce(n()),!0}catch{let e=`Could not reach the page.`;return this.message.set(e),this.announce(e),!1}}announce(e){this.announcement.update(t=>t===e?`${e} `:e)}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-cd-recording`]],inputs:{livePage:[1,`page`,`livePage`],pageId:[1,`pageId`],rpc:[1,`rpc`],native:[1,`native`]},outputs:{showComponent:`showComponent`},decls:22,vars:13,consts:[[`aria-labelledby`,`cd-heading`,1,`cd`],[1,`cd-head`],[`id`,`cd-heading`],[3,`imported`,`page`,`maxCycles`],[1,`status`],[`role`,`status`,1,`sr-only`],[1,`imported`],[1,`hint`],[`what`,`cycles`,`limit`,`cdCycles`,3,`dropped`,`max`],[1,`note`],[1,`empty`],[`type`,`button`,3,`click`,`disabled`],[`aria-hidden`,`true`,1,`dot`],[`type`,`button`],[`type`,`button`,3,`click`],[1,`badge`],[1,`mono`],[`capability`,`profiler`,`missing`,``,`compact`,``,3,`page`],[`role`,`group`,`aria-labelledby`,`cd-views-label`,1,`views`],[`id`,`cd-views-label`,1,`views-label`],[`type`,`button`,1,`view`,3,`click`,`disabled`],[`capability`,`angularProfiling`,`missing`,``,`compact`,``,3,`page`],[3,`rangeChange`,`cycles`,`range`],[3,`pick`,`cycles`,`names`,`scope`],[1,`spans-note`],[3,`pick`,`stats`,`scope`],[1,`cd-grid`],[`scope`,`col`],[`scope`,`col`,1,`num`],[`aria-label`,`Latest change detection cycles, newest first`,1,`cycles`],[3,`page`],[1,`num`],[`colspan`,`4`],[1,`when`],[1,`trigger`],[1,`timing`],[1,`top`]],template:function(e,t){if(e&1&&(I(0,`section`,0)(1,`div`,1)(2,`h2`,2),K(3,`Change detection`),L(),j(4,qA,4,5),I(5,`app-cd-transfer`,3),H(`imported`,function(e){return t.showImport(e)}),L(),I(6,`p`,4),K(7),L(),I(8,`p`,5),K(9),L()(),j(10,JA,7,1,`p`,6),I(11,`p`,7),K(12,` Records each change detection cycle with Angular's profiler: how long it took, how many components it checked, what started it and which checks changed nothing. Tree rows show how often each instance was checked. Times come from a development build. While it records, the page also wraps Angular's scheduler, adds a signal write hook and watches DOM updates; all of it stops with the recording. `),j(13,YA,1,0),L(),j(14,QA,2,1),j(15,tj,16,7),R(16,`app-limit-note`,8),N(17,nj,2,1,`p`,9,yg),j(19,aj,9,9),j(20,hj,27,4)(21,gj,2,0,`p`,10),L()),e&2){let e;O(4),M(t.imported()?-1:4),O(),F(`page`,t.page())(`maxCycles`,t.maxCycles()),O(2),q(t.status()),O(2),q(t.announcement()),O(),M((e=t.imported())?10:-1,e),O(3),M(t.native()?13:-1),O(),M(t.page()?.supported===!1?14:-1),O(),M(!t.imported()&&!t.native()?15:-1),O(),F(`dropped`,t.page()?.dropped??0)(`max`,t.maxCycles()),O(),P(t.capNotes()),O(2),M(t.cycles().length?19:-1),O(),M(t.page()?.components?.length?20:t.recording()?21:-1)}},dependencies:[OD,_O,AA,Hk,NA,iA,yA,WA],styles:[`[_nghost-%COMP%] { display: block; margin-top: 16px; } @@ -1811,7 +1811,7 @@ td.mono[_ngcontent-%COMP%] { .trigger[_ngcontent-%COMP%] .mono[_ngcontent-%COMP%], .top[_ngcontent-%COMP%] .mono[_ngcontent-%COMP%] { overflow-wrap: anywhere; -}`]})},xj=[`*`];function Sj(e,t){e&1&&K(0),e&2&&q(W(2).label())}function Cj(e,t){e&1&&Zg(0,0,null,Sj,1,1)}function wj(e,t){if(e&1&&(I(0,`span`,4),K(1),L()),e&2){let e=W(2);O(),q(e.message())}}function Tj(e,t){if(e&1){let e=V();I(0,`button`,2),H(`click`,function(){return w(e),T(W().open())}),Fg(1,3),L(),j(2,wj,2,1,`span`,4)}if(e&2){let e=W(),t=t_(1);F(`title`,`Open `+e.label()+` in your editor`),A(`aria-label`,`Open `+e.label()+` in your editor`),O(),F(`ngTemplateOutlet`,t),O(),M(e.message()?2:-1)}}function Ej(e,t){if(e&1&&(I(0,`span`,1),Fg(1,3),L()),e&2){let e=W(),t=t_(1);F(`title`,e.label()),O(),F(`ngTemplateOutlet`,t)}}var Dj=class e{source=D(D(null));client=X(()=>this.source()());available=X(()=>{let e=this.client();return!!e&&!$T(e)});use(e){this.source.set(e)}async open(e,t){if(!this.available())return{ok:!1,error:`No server is connected.`};try{let n=await ZT(this.client(),`open-in-editor`,{file:e,...t?{line:t}:{}});return n?.ok?{ok:!0}:{ok:!1,error:n?.error??`The server did not open it.`}}catch{return{ok:!1,error:`The server did not open it.`}}}static ɵfac=function(t){return new(t||e)};static ɵprov=Vl({token:e,factory:e.ɵfac})};function Oj(e,t){return t?`${e}:${t}`:e}var kj=class e{editor=C(Dj);file=$.required();line=$(void 0);label=X(()=>Oj(this.file(),this.line()));message=D(``);async open(){this.message.set(``);let e=await this.editor.open(this.file(),this.line()??void 0);e.ok||this.message.set(`Not opened: ${e.error}`)}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-source-link`]],inputs:{file:[1,`file`],line:[1,`line`]},ngContentSelectors:xj,decls:4,vars:1,consts:[[`text`,``],[1,`source-text`,3,`title`],[`type`,`button`,1,`source-link`,3,`click`,`title`],[3,`ngTemplateOutlet`],[`role`,`alert`,1,`message`]],template:function(e,t){e&1&&(Xg(),Zh(0,Cj,2,0,`ng-template`,null,0,pv),j(2,Tj,3,4)(3,Ej,2,2,`span`,1)),e&2&&(O(2),M(t.editor.available()?2:3))},dependencies:[my],styles:[`[_nghost-%COMP%] { +}`]})},bj=[`*`];function xj(e,t){e&1&&K(0),e&2&&q(W(2).label())}function Sj(e,t){e&1&&Xg(0,0,null,xj,1,1)}function Cj(e,t){if(e&1&&(I(0,`span`,4),K(1),L()),e&2){let e=W(2);O(),q(e.message())}}function wj(e,t){if(e&1){let e=V();I(0,`button`,2),H(`click`,function(){return w(e),T(W().open())}),Pg(1,3),L(),j(2,Cj,2,1,`span`,4)}if(e&2){let e=W(),t=e_(1);F(`title`,`Open `+e.label()+` in your editor`),A(`aria-label`,`Open `+e.label()+` in your editor`),O(),F(`ngTemplateOutlet`,t),O(),M(e.message()?2:-1)}}function Tj(e,t){if(e&1&&(I(0,`span`,1),Pg(1,3),L()),e&2){let e=W(),t=e_(1);F(`title`,e.label()),O(),F(`ngTemplateOutlet`,t)}}var Ej=class e{source=D(D(null));client=X(()=>this.source()());available=X(()=>{let e=this.client();return!!e&&!QT(e)});use(e){this.source.set(e)}async open(e,t){if(!this.available())return{ok:!1,error:`No server is connected.`};try{let n=await XT(this.client(),`open-in-editor`,{file:e,...t?{line:t}:{}});return n?.ok?{ok:!0}:{ok:!1,error:n?.error??`The server did not open it.`}}catch{return{ok:!1,error:`The server did not open it.`}}}static ɵfac=function(t){return new(t||e)};static ɵprov=Vl({token:e,factory:e.ɵfac})};function Dj(e,t){return t?`${e}:${t}`:e}var Oj=class e{editor=C(Ej);file=$.required();line=$(void 0);label=X(()=>Dj(this.file(),this.line()));message=D(``);async open(){this.message.set(``);let e=await this.editor.open(this.file(),this.line()??void 0);e.ok||this.message.set(`Not opened: ${e.error}`)}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-source-link`]],inputs:{file:[1,`file`],line:[1,`line`]},ngContentSelectors:bj,decls:4,vars:1,consts:[[`text`,``],[1,`source-text`,3,`title`],[`type`,`button`,1,`source-link`,3,`click`,`title`],[3,`ngTemplateOutlet`],[`role`,`alert`,1,`message`]],template:function(e,t){e&1&&(Yg(),Xh(0,Sj,2,0,`ng-template`,null,0,fv),j(2,wj,3,4)(3,Tj,2,2,`span`,1)),e&2&&(O(2),M(t.editor.available()?2:3))},dependencies:[py],styles:[`[_nghost-%COMP%] { display: inline; min-width: 0; } @@ -1846,7 +1846,7 @@ td.mono[_ngcontent-%COMP%] { color: var(--%NS%danger-text); font-family: var(--%NS%font-sans); font-size: 0.92em; -}`]})},Aj=[`field`],jj=[`editButton`],Mj=[`valueBox`];function Nj(e,t){if(e&1){let e=V();z(0,`div`,5)(1,`label`,6),K(2),B(),z(3,`input`,7,0),U(`input`,function(t){return w(e),T(W().draft.set(t.target.value))})(`keydown.enter`,function(t){w(e);let n=W();return t.preventDefault(),T(n.apply())})(`keydown.escape`,function(t){w(e);let n=W();return t.preventDefault(),t.stopPropagation(),T(n.cancel())}),B(),z(5,`button`,8),U(`click`,function(){return w(e),T(W().apply())}),K(6,`Apply`),B(),z(7,`button`,9),U(`click`,function(){return w(e),T(W().cancel())}),K(8,`Cancel`),B()(),z(9,`p`,10),K(10),B()}if(e&2){let e=W();O(),Lg(`htmlFor`,e.fieldId),O(),J(`New value of `,e.prop().name,`, as JSON`),O(),Lg(`id`,e.fieldId)(`value`,e.draft())(`readOnly`,e.busy()),A(`aria-busy`,e.busy()?`true`:null)(`aria-invalid`,e.error()?`true`:null)(`aria-describedby`,e.hintId+(e.error()?` `+e.errorId:``)),O(2),Lg(`disabled`,e.busy()),O(4),Lg(`id`,e.hintId),O(),J(` JSON, such as "text", 42, true or `,e.objectSample,`. Enter applies, Escape cancels. `)}}function Pj(e,t){if(e&1&&(z(0,`pre`,null,1),K(2),lv(3,`json`),B()),e&2){let e=W(2);A(`tabindex`,e.scrollable()?0:null)(`role`,e.scrollable()?`region`:null)(`aria-label`,e.scrollable()?`Value of `+e.prop().name:null),O(2),q(uv(3,4,e.prop().value))}}function Fj(e,t){if(e&1){let e=V();z(0,`button`,14,2),U(`click`,function(){return w(e),T(W(2).start())}),K(2,` Edit `),B()}if(e&2){let e=W(2);Lg(`disabled`,e.busy()),A(`aria-label`,`Edit `+e.prop().name)}}function Ij(e,t){if(e&1&&(z(0,`p`,13),K(1),B()),e&2){let e=W(2);O(),q(e.prop().locked)}}function Lj(e,t){if(e&1&&(z(0,`div`,11),j(1,Pj,4,6,`pre`),j(2,Fj,3,2,`button`,12),B(),j(3,Ij,2,1,`p`,13)),e&2){let e=W();O(),M(e.bare()?-1:1),O(),M(e.editable()?2:-1),O(),M(e.writes()&&e.prop().locked?3:-1)}}function Rj(e,t){if(e&1&&(z(0,`p`,3),K(1),B()),e&2){let e=W();Lg(`id`,e.errorId),O(),q(e.error())}}var zj=0;function Bj(e){let t=e.trim();if(!t)return{error:`Type a JSON value, such as "text", 42, true, null or [1, 2].`};try{return{value:JSON.parse(t)}}catch{return{error:`Not valid JSON. Put text in double quotes, such as "Paris".`}}}var Vj=class e{prop=$.required();componentId=$.required();pageId=$(null);rpc=$(null);writes=$(!1);bare=$(!1);readDraft=$(null);fieldId=`prop-edit-${++zj}`;hintId=`${this.fieldId}-hint`;errorId=`${this.fieldId}-error`;objectSample=`{"a": 1}`;editing=D(!1);draft=D(``);busy=D(!1);error=D(``);done=D(``);editable=X(()=>this.writes()&&!!this.prop().edit&&!!this.pageId()&&!!this.rpc());field=Dv(`field`);editButton=Dv(`editButton`);valueBox=Dv(`valueBox`);injector=C(js);scrollable=D(!1);constructor(){Pv(()=>{this.prop();let e=this.valueBox()?.nativeElement;this.scrollable.set(!!e&&e.scrollHeight>e.clientHeight+1)})}async start(){let e=this.prop().value;this.error.set(``),this.done.set(``);let t=this.readDraft();if(t){this.busy.set(!0);let n=await t();if(this.busy.set(!1),n.error!==void 0){this.error.set(n.error);return}e=n.value}this.draft.set(e===void 0?``:JSON.stringify(e)),this.editing.set(!0),dd(()=>{let e=this.field()?.nativeElement;e?.focus(),e?.select()},{injector:this.injector})}cancel(){this.editing()&&(this.editing.set(!1),this.busy.set(!1),this.error.set(``),this.focusEdit())}async apply(){if(this.busy())return;let e=Bj(this.draft());if(`error`in e){this.error.set(e.error);return}let t=this.prop(),n=this.rpc(),r=this.pageId();if(!n||!r||!t.edit)return;this.busy.set(!0),this.error.set(``);let i;try{i=await n.scope(`pangular`).rpc.call(`request-component-edit`,{pageId:r,request:{id:this.componentId(),path:t.prop,value:e.value,kind:t.edit}})??{}}catch{i={error:`The devtools server did not answer. Try again.`}}this.busy.set(!1),this.editing()&&(i.ok?(this.editing.set(!1),this.done.set(`Set ${t.name}.`),this.focusEdit()):(this.error.set(i.error??`The page did not write it.`),this.field()?.nativeElement.focus()))}focusEdit(){dd(()=>this.editButton()?.nativeElement.focus(),{injector:this.injector})}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-prop-value`]],viewQuery:function(e,t){e&1&&$g(t.field,Aj,5)(t.editButton,jj,5)(t.valueBox,Mj,5),e&2&&e_(3)},inputs:{prop:[1,`prop`],componentId:[1,`componentId`],pageId:[1,`pageId`],rpc:[1,`rpc`],writes:[1,`writes`],bare:[1,`bare`],readDraft:[1,`readDraft`]},decls:5,vars:3,consts:[[`field`,``],[`valueBox`,``],[`editButton`,``],[`role`,`alert`,1,`error`,3,`id`],[`role`,`status`,1,`sr-only`],[1,`editor`],[1,`sr-only`,3,`for`],[`type`,`text`,`autocomplete`,`off`,`spellcheck`,`false`,1,`field`,`mono`,3,`input`,`keydown.enter`,`keydown.escape`,`id`,`value`,`readOnly`],[`type`,`button`,1,`primary`,3,`click`,`disabled`],[`type`,`button`,3,`click`],[1,`hint`,3,`id`],[1,`view`],[`type`,`button`,1,`edit`,3,`disabled`],[1,`locked`],[`type`,`button`,1,`edit`,3,`click`,`disabled`]],template:function(e,t){e&1&&(j(0,Nj,11,11)(1,Lj,4,3),j(2,Rj,2,2,`p`,3),z(3,`p`,4),K(4),B()),e&2&&(M(+!t.editing()),O(2),M(t.error()?2:-1),O(2),q(t.done()))},dependencies:[by],styles:[`[_nghost-%COMP%] { +}`]})},kj=[`field`],Aj=[`editButton`],jj=[`valueBox`];function Mj(e,t){if(e&1){let e=V();z(0,`div`,5)(1,`label`,6),K(2),B(),z(3,`input`,7,0),U(`input`,function(t){return w(e),T(W().draft.set(t.target.value))})(`keydown.enter`,function(t){w(e);let n=W();return t.preventDefault(),T(n.apply())})(`keydown.escape`,function(t){w(e);let n=W();return t.preventDefault(),t.stopPropagation(),T(n.cancel())}),B(),z(5,`button`,8),U(`click`,function(){return w(e),T(W().apply())}),K(6,`Apply`),B(),z(7,`button`,9),U(`click`,function(){return w(e),T(W().cancel())}),K(8,`Cancel`),B()(),z(9,`p`,10),K(10),B()}if(e&2){let e=W();O(),Ig(`htmlFor`,e.fieldId),O(),J(`New value of `,e.prop().name,`, as JSON`),O(),Ig(`id`,e.fieldId)(`value`,e.draft())(`readOnly`,e.busy()),A(`aria-busy`,e.busy()?`true`:null)(`aria-invalid`,e.error()?`true`:null)(`aria-describedby`,e.hintId+(e.error()?` `+e.errorId:``)),O(2),Ig(`disabled`,e.busy()),O(4),Ig(`id`,e.hintId),O(),J(` JSON, such as "text", 42, true or `,e.objectSample,`. Enter applies, Escape cancels. `)}}function Nj(e,t){if(e&1&&(z(0,`pre`,null,1),K(2),cv(3,`json`),B()),e&2){let e=W(2);A(`tabindex`,e.scrollable()?0:null)(`role`,e.scrollable()?`region`:null)(`aria-label`,e.scrollable()?`Value of `+e.prop().name:null),O(2),q(lv(3,4,e.prop().value))}}function Pj(e,t){if(e&1){let e=V();z(0,`button`,14,2),U(`click`,function(){return w(e),T(W(2).start())}),K(2,` Edit `),B()}if(e&2){let e=W(2);Ig(`disabled`,e.busy()),A(`aria-label`,`Edit `+e.prop().name)}}function Fj(e,t){if(e&1&&(z(0,`p`,13),K(1),B()),e&2){let e=W(2);O(),q(e.prop().locked)}}function Ij(e,t){if(e&1&&(z(0,`div`,11),j(1,Nj,4,6,`pre`),j(2,Pj,3,2,`button`,12),B(),j(3,Fj,2,1,`p`,13)),e&2){let e=W();O(),M(e.bare()?-1:1),O(),M(e.editable()?2:-1),O(),M(e.writes()&&e.prop().locked?3:-1)}}function Lj(e,t){if(e&1&&(z(0,`p`,3),K(1),B()),e&2){let e=W();Ig(`id`,e.errorId),O(),q(e.error())}}var Rj=0;function zj(e){let t=e.trim();if(!t)return{error:`Type a JSON value, such as "text", 42, true, null or [1, 2].`};try{return{value:JSON.parse(t)}}catch{return{error:`Not valid JSON. Put text in double quotes, such as "Paris".`}}}var Bj=class e{prop=$.required();componentId=$.required();pageId=$(null);rpc=$(null);writes=$(!1);bare=$(!1);readDraft=$(null);fieldId=`prop-edit-${++Rj}`;hintId=`${this.fieldId}-hint`;errorId=`${this.fieldId}-error`;objectSample=`{"a": 1}`;editing=D(!1);draft=D(``);busy=D(!1);error=D(``);done=D(``);editable=X(()=>this.writes()&&!!this.prop().edit&&!!this.pageId()&&!!this.rpc());field=Ev(`field`);editButton=Ev(`editButton`);valueBox=Ev(`valueBox`);injector=C(js);scrollable=D(!1);constructor(){Nv(()=>{this.prop();let e=this.valueBox()?.nativeElement;this.scrollable.set(!!e&&e.scrollHeight>e.clientHeight+1)})}async start(){let e=this.prop().value;this.error.set(``),this.done.set(``);let t=this.readDraft();if(t){this.busy.set(!0);let n=await t();if(this.busy.set(!1),n.error!==void 0){this.error.set(n.error);return}e=n.value}this.draft.set(e===void 0?``:JSON.stringify(e)),this.editing.set(!0),dd(()=>{let e=this.field()?.nativeElement;e?.focus(),e?.select()},{injector:this.injector})}cancel(){this.editing()&&(this.editing.set(!1),this.busy.set(!1),this.error.set(``),this.focusEdit())}async apply(){if(this.busy())return;let e=zj(this.draft());if(`error`in e){this.error.set(e.error);return}let t=this.prop(),n=this.rpc(),r=this.pageId();if(!n||!r||!t.edit)return;this.busy.set(!0),this.error.set(``);let i;try{i=await n.scope(`pangular`).rpc.call(`request-component-edit`,{pageId:r,request:{id:this.componentId(),path:t.prop,value:e.value,kind:t.edit}})??{}}catch{i={error:`The devtools server did not answer. Try again.`}}this.busy.set(!1),this.editing()&&(i.ok?(this.editing.set(!1),this.done.set(`Set ${t.name}.`),this.focusEdit()):(this.error.set(i.error??`The page did not write it.`),this.field()?.nativeElement.focus()))}focusEdit(){dd(()=>this.editButton()?.nativeElement.focus(),{injector:this.injector})}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-prop-value`]],viewQuery:function(e,t){e&1&&Qg(t.field,kj,5)(t.editButton,Aj,5)(t.valueBox,jj,5),e&2&&$g(3)},inputs:{prop:[1,`prop`],componentId:[1,`componentId`],pageId:[1,`pageId`],rpc:[1,`rpc`],writes:[1,`writes`],bare:[1,`bare`],readDraft:[1,`readDraft`]},decls:5,vars:3,consts:[[`field`,``],[`valueBox`,``],[`editButton`,``],[`role`,`alert`,1,`error`,3,`id`],[`role`,`status`,1,`sr-only`],[1,`editor`],[1,`sr-only`,3,`for`],[`type`,`text`,`autocomplete`,`off`,`spellcheck`,`false`,1,`field`,`mono`,3,`input`,`keydown.enter`,`keydown.escape`,`id`,`value`,`readOnly`],[`type`,`button`,1,`primary`,3,`click`,`disabled`],[`type`,`button`,3,`click`],[1,`hint`,3,`id`],[1,`view`],[`type`,`button`,1,`edit`,3,`disabled`],[1,`locked`],[`type`,`button`,1,`edit`,3,`click`,`disabled`]],template:function(e,t){e&1&&(j(0,Mj,11,11)(1,Ij,4,3),j(2,Lj,2,2,`p`,3),z(3,`p`,4),K(4),B()),e&2&&(M(+!t.editing()),O(2),M(t.error()?2:-1),O(2),q(t.done()))},dependencies:[yy],styles:[`[_nghost-%COMP%] { display: block; min-width: 0; } @@ -1969,7 +1969,7 @@ button.edit[_ngcontent-%COMP%] { .error[_ngcontent-%COMP%] { color: var(--%NS%danger-text); -}`]})},Hj=1e3,Uj={depth:5,limit:100},Wj=`[redacted]`;function Gj(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Kj(e){return Gj(e)&&typeof e.$more==`number`&&Object.keys(e).length===1}function qj(e){return Gj(e)&&typeof e.$collapsed==`string`&&typeof e.size==`number`&&Object.keys(e).length===2}function Jj(e){return e===`Array`?`array`:e===`Map`?`map`:e===`Set`?`set`:`object`}function Yj(e){return e.$type===`Map`&&Array.isArray(e.entries)}function Xj(e){return e.$type===`Set`&&Array.isArray(e.values)}function Zj(e){return Object.keys(e).filter(e=>e!==`$type`&&e!==`$more`)}function Qj(e){if(!e||typeof e!=`object`)return null;if(qj(e))return e.size<=0?null:{kind:Jj(e.$collapsed),type:e.$collapsed,size:e.size,collapsed:!0};if(Kj(e))return null;if(Array.isArray(e)){let t=e.at(-1),n=Kj(t)?t.$more:0,r=e.length-+!!n+n;return r?{kind:`array`,type:`Array`,size:r,collapsed:!1}:null}let t=e;if(Yj(t)||Xj(t)){let e=typeof t.size==`number`?t.size:0,n=Yj(t)?`map`:`set`;return e?{kind:n,type:n===`map`?`Map`:`Set`,size:e,collapsed:!1}:null}let n=typeof t.$more==`number`?t.$more:0,r=Zj(t).length+n,i=typeof t.$type==`string`?t.$type:`Object`;return r?{kind:`object`,type:i,size:r,collapsed:!1}:null}function $j(e){if(typeof e==`string`)return JSON.stringify(e);let t=Qj(e);if(t)return nM(t);try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function eM(e){let t=Qj(e);if(!t||t.collapsed)return{children:[],more:0};if(Array.isArray(e)){let n=(Kj(e.at(-1))?e.slice(0,-1):e).map((e,t)=>({key:String(t),label:String(t),value:e}));return{children:n,more:t.size-n.length}}let n=e;if(t.kind===`map`){let e=n.entries.map((e,t)=>{let[n,r]=Array.isArray(e)?e:[void 0,e];return{key:String(t),label:$j(n),value:r}});return{children:e,more:Math.max(0,t.size-e.length)}}if(t.kind===`set`){let e=n.values.map((e,t)=>({key:String(t),label:String(t),value:e}));return{children:e,more:Math.max(0,t.size-e.length)}}return{children:Zj(n).map(e=>({key:e,label:e,value:n[e]})),more:typeof n.$more==`number`?n.$more:0}}function tM(e,t,n){return`${e} ${e===1?t:n}`}function nM(e){let t={array:tM(e.size,`item`,`items`),object:tM(e.size,`key`,`keys`),map:tM(e.size,`entry`,`entries`),set:tM(e.size,`value`,`values`)}[e.kind];return`${e.type} (${t})`}function rM(e,t){return JSON.stringify(t===void 0?e:[t,...e])}function iM(e,t){return e.map((e,n)=>n===0?e:(t?t[n-1]!==`object`:/^\d+$/.test(e))?`[${e}]`:`.${e}`).join(``)}function aM(e){return e.every(e=>e&&e===e.trim()&&!/[.[\]]/.test(e))?e.join(`.`):null}var oM=/^\[(Getter|Unreadable|Circular|Truncated|Function\b.*|Promise)\]$/;function sM(e){return e===null||typeof e==`boolean`?!0:typeof e==`number`?Number.isFinite(e):typeof e==`string`&&e!==Wj&&!oM.test(e)&&!e.endsWith(`…`)}function cM(e,t){return!e||t.kind===`map`||t.kind===`set`||e===`signal`&&t.kind===`object`&&t.type!==`Object`?null:e}function lM(e,t,n,r,i=500){let a=[],o=r.trim().toLowerCase();if(!o)return a;let s=new Set,c=(e,t)=>{let r=rM(e);if(!(s.has(r)||a.length>=i)){s.add(r);for(let r of eM(t).children){let t=[...e,r.key];if(r.label.toLowerCase().includes(o)&&a.push(t),!Qj(r.value))continue;let i=n(t)??(Qj(r.value)?.collapsed?void 0:r.value);i!==void 0&&c(t,i)}}};return c(e,n(e)??t),a}var uM=(e,t)=>t.id;function dM(e,t){if(e&1){let e=V();I(0,`button`,2),H(`click`,function(){w(e);let t=W().$implicit;return T(W(3).toggle(t))}),E(),I(1,`svg`,3),R(2,`path`,4),L(),Cs(),I(3,`span`,14),K(4),L(),I(5,`span`,5),K(6),L()()}if(e&2){let e=W().$implicit;A(`aria-expanded`,e.open)(`aria-label`,e.label+`: `+e.text),O(4),J(``,e.label,`:`),O(2),q(e.text)}}function fM(e,t){if(e&1&&R(0,`app-prop-value`,15),e&2){let e=W(5);F(`prop`,t)(`componentId`,e.componentId())(`pageId`,e.pageId())(`rpc`,e.rpc())(`writes`,e.writes())}}function pM(e,t){if(e&1&&(I(0,`span`,16),K(1),L()),e&2){let e=W(2).$implicit;O(),q(e.text)}}function mM(e,t){if(e&1&&(I(0,`span`,14),K(1),L(),j(2,fM,1,5,`app-prop-value`,15)(3,pM,2,1,`span`,16)),e&2){let e,t=W().$implicit;O(),J(``,t.label,`:`),O(),M((e=t.edit)?2:3,e)}}function hM(e,t){if(e&1){let e=V();I(0,`button`,17),H(`click`,function(){w(e);let t=W().$implicit;return T(W(3).more(t))}),K(1),I(2,`span`,18),K(3),L()()}if(e&2){let e=W().$implicit,t=W(3);O(),J(` Show `,t.step(e),` more `),O(2),J(`(`,e.more,` not listed)`)}}function gM(e,t){e&1&&(I(0,`span`,12),K(1,`Reading from the page…`),L())}function _M(e,t){if(e&1&&(I(0,`span`,13),K(1),L()),e&2){let e=W().$implicit;O(),q(e.text)}}function vM(e,t){if(e&1&&(I(0,`li`,9),j(1,dM,7,4,`button`,10)(2,mM,4,2)(3,hM,4,2,`button`,11)(4,gM,2,0,`span`,12)(5,_M,2,1,`span`,13),L()),e&2){let e,n=t.$implicit;S_(`padding-left`,n.depth*14,`px`),O(),M((e=n.kind)===`node`?1:e===`leaf`?2:e===`more`?3:e===`loading`?4:e===`error`?5:-1)}}function yM(e,t){if(e&1&&(I(0,`ul`,7),N(1,vM,6,3,`li`,8,uM),L()),e&2){let e=W(2);F(`id`,e.listId),A(`aria-label`,e.prop().name+` entries`),O(),P(e.rows())}}function bM(e,t){if(e&1){let e=V();I(0,`div`,1)(1,`button`,2),H(`click`,function(){return w(e),T(W().toggleRoot())}),E(),I(2,`svg`,3),R(3,`path`,4),L(),Cs(),I(4,`span`,5),K(5),L()(),R(6,`app-prop-value`,6),L(),j(7,yM,3,2,`ul`,7)}if(e&2){let e=t,n=W();O(),A(`aria-expanded`,n.rootOpen())(`aria-controls`,n.rootOpen()?n.listId:null)(`aria-label`,n.prop().name+`: `+n.summaryOf(e)),O(4),q(n.summaryOf(e)),O(),F(`bare`,!0)(`prop`,n.prop())(`componentId`,n.componentId())(`pageId`,n.pageId())(`rpc`,n.rpc())(`writes`,n.writes())(`readDraft`,n.readWhole),O(),M(n.rootOpen()?7:-1)}}function xM(e,t){if(e&1&&R(0,`app-prop-value`,0),e&2){let e=W();F(`prop`,e.prop())(`componentId`,e.componentId())(`pageId`,e.pageId())(`rpc`,e.rpc())(`writes`,e.writes())}}var SM=0;function CM(e){if(e===void 0)return`undefined`;try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function wM(e){if(Array.isArray(e))return e.every(wM);if(e&&typeof e==`object`){let t=e;return![`$collapsed`,`$more`,`$type`].some(e=>Object.hasOwn(t,e))&&Object.values(t).every(wM)}return sM(e)}var TM=class e{prop=$.required();store=$.required();componentId=$.required();pageId=$(null);rpc=$(null);writes=$(!1);directive=$(void 0);query=$(``);listId=`value-tree-${++SM}`;host=C(Wl);pendingMore=null;constructor(){Pv(()=>{let e=this.rows(),t=this.pendingMore;if(!t)return;let n=e.findIndex(e=>(e.kind===`leaf`||e.kind===`node`)&&!t.has(e.id));if(n<0)return;this.pendingMore=null;let r=document.activeElement;r&&r!==document.body&&r.isConnected||this.focusNear(n)})}rootPath=X(()=>[this.prop().prop]);rootValue=X(()=>this.store().level(this.rootPath(),this.directive())??this.prop().value);root=X(()=>Qj(this.rootValue()));needle=X(()=>this.query().trim().toLowerCase());matches=X(()=>{let e=this.needle(),t=this.prop();if(!e||[t.name,t.prop].some(t=>t.toLowerCase().includes(e)))return null;let n=this.store(),r=this.directive();return lM(this.rootPath(),this.rootValue(),e=>n.level(e,r),e)});rootOpen=X(()=>!!this.matches()?.length||this.store().isOpen(this.rootPath(),this.directive()));rows=X(()=>{let e=this.root();if(!e)return[];let t=this.store(),n=this.directive(),r=this.matches(),i=new Set,a=new Set;for(let e of r??[]){a.add(rM(e));for(let t=2;t<=e.length;t++)i.add(rM(e.slice(0,t)))}let o=this.prop(),s=this.writes()&&n===void 0,c=[],l=(e,o,d,f,p,m)=>{let{children:h,more:g}=eM(e);for(let e of h){let h=[...o,e.key],g=rM(h);if(r&&!m&&!i.has(g))continue;let _=Qj(e.value),ee=rM(h,n);if(!_){let t=p&&sM(e.value)?aM(h):null;c.push({id:ee,kind:`leaf`,depth:f,path:h,label:e.label,text:CM(e.value),edit:s&&t&&p?{name:iM(h,[...d]),prop:t,value:e.value,edit:p}:void 0});continue}let te=!!r&&!m&&i.has(g)&&!a.has(g)||t.isOpen(h,n);if(c.push({id:ee,kind:`node`,depth:f,path:h,label:e.label,text:nM(_),container:_,open:te}),!te)continue;let ne=t.level(h,n)??(_.collapsed?void 0:e.value),re=[...d,_.kind];ne===void 0?t.errors().has(ee)?c.push({...u(h,f+1,`error`),text:t.errors().get(ee)}):c.push(u(h,f+1,`loading`)):l(ne,h,re,f+1,cM(p,_),m||a.has(g))}g>0&&(!r||m)&&c.push({...u(o,f,`more`),more:g,listed:h.length})},u=(e,t,r)=>({id:`${rM(e,n)}:${r}`,kind:r,depth:t,path:e,label:``,text:``});return l(this.rootValue(),this.rootPath(),[e.kind],0,s?cM(o.editInside??null,e):null,!r),c});readWhole=async()=>{let e=await this.store().read(this.rootPath(),Uj.depth,Uj.limit);return e.ok?wM(e.value)?{value:e.value}:{error:`Too large to edit as a whole. Open it to edit the values inside.`}:{error:e.error??`The page did not read it.`}};summaryOf(e){return nM(e)}toggleRoot(){this.pendingMore=null,this.store().toggle(this.rootPath(),this.directive(),!1)}toggle(e){this.pendingMore=null,this.store().toggle(e.path,this.directive(),!!e.container?.collapsed)}more(e){this.pendingMore=new Set(this.rows().map(e=>e.id)),this.store().more(e.path,this.directive(),e.listed??0)}focusNear(e){let t=this.host.nativeElement,n=Array.from(t.querySelectorAll(`#${this.listId} > li`)),r=e=>e?.querySelector(`button:not([disabled]), input, textarea, [tabindex="0"]`);(n.slice(e).map(r).find(Boolean)??n.slice(0,e).reverse().map(r).find(Boolean)??t.querySelector(`.root > .toggle`))?.focus()}step(e){return Math.min(100,e.more??0)}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-value-tree`]],inputs:{prop:[1,`prop`],store:[1,`store`],componentId:[1,`componentId`],pageId:[1,`pageId`],rpc:[1,`rpc`],writes:[1,`writes`],directive:[1,`directive`],query:[1,`query`]},decls:2,vars:1,consts:[[3,`prop`,`componentId`,`pageId`,`rpc`,`writes`],[1,`root`],[`type`,`button`,1,`toggle`,3,`click`],[`viewBox`,`0 0 24 24`,`aria-hidden`,`true`,1,`chevron`],[`d`,`m9 6 6 6-6 6`],[1,`summary`,`mono`],[1,`whole`,3,`bare`,`prop`,`componentId`,`pageId`,`rpc`,`writes`,`readDraft`],[1,`entries`,3,`id`],[1,`entry`,3,`padding-left`],[1,`entry`],[`type`,`button`,1,`toggle`],[`type`,`button`,1,`more`],[`role`,`status`,1,`muted`],[`role`,`alert`,1,`error`],[1,`key`,`mono`],[1,`leaf-edit`,3,`prop`,`componentId`,`pageId`,`rpc`,`writes`],[1,`leaf`,`mono`],[`type`,`button`,1,`more`,3,`click`],[1,`muted`]],template:function(e,t){if(e&1&&j(0,bM,8,12)(1,xM,1,5,`app-prop-value`,0),e&2){let e;M((e=t.root())?0:1,e)}},dependencies:[Vj],styles:[`[_nghost-%COMP%] { +}`]})},Vj=1e3,Hj={depth:5,limit:100},Uj=`[redacted]`;function Wj(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Gj(e){return Wj(e)&&typeof e.$more==`number`&&Object.keys(e).length===1}function Kj(e){return Wj(e)&&typeof e.$collapsed==`string`&&typeof e.size==`number`&&Object.keys(e).length===2}function qj(e){return e===`Array`?`array`:e===`Map`?`map`:e===`Set`?`set`:`object`}function Jj(e){return e.$type===`Map`&&Array.isArray(e.entries)}function Yj(e){return e.$type===`Set`&&Array.isArray(e.values)}function Xj(e){return Object.keys(e).filter(e=>e!==`$type`&&e!==`$more`)}function Zj(e){if(!e||typeof e!=`object`)return null;if(Kj(e))return e.size<=0?null:{kind:qj(e.$collapsed),type:e.$collapsed,size:e.size,collapsed:!0};if(Gj(e))return null;if(Array.isArray(e)){let t=e.at(-1),n=Gj(t)?t.$more:0,r=e.length-+!!n+n;return r?{kind:`array`,type:`Array`,size:r,collapsed:!1}:null}let t=e;if(Jj(t)||Yj(t)){let e=typeof t.size==`number`?t.size:0,n=Jj(t)?`map`:`set`;return e?{kind:n,type:n===`map`?`Map`:`Set`,size:e,collapsed:!1}:null}let n=typeof t.$more==`number`?t.$more:0,r=Xj(t).length+n,i=typeof t.$type==`string`?t.$type:`Object`;return r?{kind:`object`,type:i,size:r,collapsed:!1}:null}function Qj(e){if(typeof e==`string`)return JSON.stringify(e);let t=Zj(e);if(t)return tM(t);try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function $j(e){let t=Zj(e);if(!t||t.collapsed)return{children:[],more:0};if(Array.isArray(e)){let n=(Gj(e.at(-1))?e.slice(0,-1):e).map((e,t)=>({key:String(t),label:String(t),value:e}));return{children:n,more:t.size-n.length}}let n=e;if(t.kind===`map`){let e=n.entries.map((e,t)=>{let[n,r]=Array.isArray(e)?e:[void 0,e];return{key:String(t),label:Qj(n),value:r}});return{children:e,more:Math.max(0,t.size-e.length)}}if(t.kind===`set`){let e=n.values.map((e,t)=>({key:String(t),label:String(t),value:e}));return{children:e,more:Math.max(0,t.size-e.length)}}return{children:Xj(n).map(e=>({key:e,label:e,value:n[e]})),more:typeof n.$more==`number`?n.$more:0}}function eM(e,t,n){return`${e} ${e===1?t:n}`}function tM(e){let t={array:eM(e.size,`item`,`items`),object:eM(e.size,`key`,`keys`),map:eM(e.size,`entry`,`entries`),set:eM(e.size,`value`,`values`)}[e.kind];return`${e.type} (${t})`}function nM(e,t){return JSON.stringify(t===void 0?e:[t,...e])}function rM(e,t){return e.map((e,n)=>n===0?e:(t?t[n-1]!==`object`:/^\d+$/.test(e))?`[${e}]`:`.${e}`).join(``)}function iM(e){return e.every(e=>e&&e===e.trim()&&!/[.[\]]/.test(e))?e.join(`.`):null}var aM=/^\[(Getter|Unreadable|Circular|Truncated|Function\b.*|Promise)\]$/;function oM(e){return e===null||typeof e==`boolean`?!0:typeof e==`number`?Number.isFinite(e):typeof e==`string`&&e!==Uj&&!aM.test(e)&&!e.endsWith(`…`)}function sM(e,t){return!e||t.kind===`map`||t.kind===`set`||e===`signal`&&t.kind===`object`&&t.type!==`Object`?null:e}function cM(e,t,n,r,i=500){let a=[],o=r.trim().toLowerCase();if(!o)return a;let s=new Set,c=(e,t)=>{let r=nM(e);if(!(s.has(r)||a.length>=i)){s.add(r);for(let r of $j(t).children){let t=[...e,r.key];if(r.label.toLowerCase().includes(o)&&a.push(t),!Zj(r.value))continue;let i=n(t)??(Zj(r.value)?.collapsed?void 0:r.value);i!==void 0&&c(t,i)}}};return c(e,n(e)??t),a}var lM=(e,t)=>t.id;function uM(e,t){if(e&1){let e=V();I(0,`button`,2),H(`click`,function(){w(e);let t=W().$implicit;return T(W(3).toggle(t))}),E(),I(1,`svg`,3),R(2,`path`,4),L(),Cs(),I(3,`span`,14),K(4),L(),I(5,`span`,5),K(6),L()()}if(e&2){let e=W().$implicit;A(`aria-expanded`,e.open)(`aria-label`,e.label+`: `+e.text),O(4),J(``,e.label,`:`),O(2),q(e.text)}}function dM(e,t){if(e&1&&R(0,`app-prop-value`,15),e&2){let e=W(5);F(`prop`,t)(`componentId`,e.componentId())(`pageId`,e.pageId())(`rpc`,e.rpc())(`writes`,e.writes())}}function fM(e,t){if(e&1&&(I(0,`span`,16),K(1),L()),e&2){let e=W(2).$implicit;O(),q(e.text)}}function pM(e,t){if(e&1&&(I(0,`span`,14),K(1),L(),j(2,dM,1,5,`app-prop-value`,15)(3,fM,2,1,`span`,16)),e&2){let e,t=W().$implicit;O(),J(``,t.label,`:`),O(),M((e=t.edit)?2:3,e)}}function mM(e,t){if(e&1){let e=V();I(0,`button`,17),H(`click`,function(){w(e);let t=W().$implicit;return T(W(3).more(t))}),K(1),I(2,`span`,18),K(3),L()()}if(e&2){let e=W().$implicit,t=W(3);O(),J(` Show `,t.step(e),` more `),O(2),J(`(`,e.more,` not listed)`)}}function hM(e,t){e&1&&(I(0,`span`,12),K(1,`Reading from the page…`),L())}function gM(e,t){if(e&1&&(I(0,`span`,13),K(1),L()),e&2){let e=W().$implicit;O(),q(e.text)}}function _M(e,t){if(e&1&&(I(0,`li`,9),j(1,uM,7,4,`button`,10)(2,pM,4,2)(3,mM,4,2,`button`,11)(4,hM,2,0,`span`,12)(5,gM,2,1,`span`,13),L()),e&2){let e,n=t.$implicit;x_(`padding-left`,n.depth*14,`px`),O(),M((e=n.kind)===`node`?1:e===`leaf`?2:e===`more`?3:e===`loading`?4:e===`error`?5:-1)}}function vM(e,t){if(e&1&&(I(0,`ul`,7),N(1,_M,6,3,`li`,8,lM),L()),e&2){let e=W(2);F(`id`,e.listId),A(`aria-label`,e.prop().name+` entries`),O(),P(e.rows())}}function yM(e,t){if(e&1){let e=V();I(0,`div`,1)(1,`button`,2),H(`click`,function(){return w(e),T(W().toggleRoot())}),E(),I(2,`svg`,3),R(3,`path`,4),L(),Cs(),I(4,`span`,5),K(5),L()(),R(6,`app-prop-value`,6),L(),j(7,vM,3,2,`ul`,7)}if(e&2){let e=t,n=W();O(),A(`aria-expanded`,n.rootOpen())(`aria-controls`,n.rootOpen()?n.listId:null)(`aria-label`,n.prop().name+`: `+n.summaryOf(e)),O(4),q(n.summaryOf(e)),O(),F(`bare`,!0)(`prop`,n.prop())(`componentId`,n.componentId())(`pageId`,n.pageId())(`rpc`,n.rpc())(`writes`,n.writes())(`readDraft`,n.readWhole),O(),M(n.rootOpen()?7:-1)}}function bM(e,t){if(e&1&&R(0,`app-prop-value`,0),e&2){let e=W();F(`prop`,e.prop())(`componentId`,e.componentId())(`pageId`,e.pageId())(`rpc`,e.rpc())(`writes`,e.writes())}}var xM=0;function SM(e){if(e===void 0)return`undefined`;try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function CM(e){if(Array.isArray(e))return e.every(CM);if(e&&typeof e==`object`){let t=e;return![`$collapsed`,`$more`,`$type`].some(e=>Object.hasOwn(t,e))&&Object.values(t).every(CM)}return oM(e)}var wM=class e{prop=$.required();store=$.required();componentId=$.required();pageId=$(null);rpc=$(null);writes=$(!1);directive=$(void 0);query=$(``);listId=`value-tree-${++xM}`;host=C(Wl);pendingMore=null;constructor(){Nv(()=>{let e=this.rows(),t=this.pendingMore;if(!t)return;let n=e.findIndex(e=>(e.kind===`leaf`||e.kind===`node`)&&!t.has(e.id));if(n<0)return;this.pendingMore=null;let r=document.activeElement;r&&r!==document.body&&r.isConnected||this.focusNear(n)})}rootPath=X(()=>[this.prop().prop]);rootValue=X(()=>this.store().level(this.rootPath(),this.directive())??this.prop().value);root=X(()=>Zj(this.rootValue()));needle=X(()=>this.query().trim().toLowerCase());matches=X(()=>{let e=this.needle(),t=this.prop();if(!e||[t.name,t.prop].some(t=>t.toLowerCase().includes(e)))return null;let n=this.store(),r=this.directive();return cM(this.rootPath(),this.rootValue(),e=>n.level(e,r),e)});rootOpen=X(()=>!!this.matches()?.length||this.store().isOpen(this.rootPath(),this.directive()));rows=X(()=>{let e=this.root();if(!e)return[];let t=this.store(),n=this.directive(),r=this.matches(),i=new Set,a=new Set;for(let e of r??[]){a.add(nM(e));for(let t=2;t<=e.length;t++)i.add(nM(e.slice(0,t)))}let o=this.prop(),s=this.writes()&&n===void 0,c=[],l=(e,o,d,f,p,m)=>{let{children:h,more:g}=$j(e);for(let e of h){let h=[...o,e.key],g=nM(h);if(r&&!m&&!i.has(g))continue;let _=Zj(e.value),ee=nM(h,n);if(!_){let t=p&&oM(e.value)?iM(h):null;c.push({id:ee,kind:`leaf`,depth:f,path:h,label:e.label,text:SM(e.value),edit:s&&t&&p?{name:rM(h,[...d]),prop:t,value:e.value,edit:p}:void 0});continue}let te=!!r&&!m&&i.has(g)&&!a.has(g)||t.isOpen(h,n);if(c.push({id:ee,kind:`node`,depth:f,path:h,label:e.label,text:tM(_),container:_,open:te}),!te)continue;let ne=t.level(h,n)??(_.collapsed?void 0:e.value),re=[...d,_.kind];ne===void 0?t.errors().has(ee)?c.push({...u(h,f+1,`error`),text:t.errors().get(ee)}):c.push(u(h,f+1,`loading`)):l(ne,h,re,f+1,sM(p,_),m||a.has(g))}g>0&&(!r||m)&&c.push({...u(o,f,`more`),more:g,listed:h.length})},u=(e,t,r)=>({id:`${nM(e,n)}:${r}`,kind:r,depth:t,path:e,label:``,text:``});return l(this.rootValue(),this.rootPath(),[e.kind],0,s?sM(o.editInside??null,e):null,!r),c});readWhole=async()=>{let e=await this.store().read(this.rootPath(),Hj.depth,Hj.limit);return e.ok?CM(e.value)?{value:e.value}:{error:`Too large to edit as a whole. Open it to edit the values inside.`}:{error:e.error??`The page did not read it.`}};summaryOf(e){return tM(e)}toggleRoot(){this.pendingMore=null,this.store().toggle(this.rootPath(),this.directive(),!1)}toggle(e){this.pendingMore=null,this.store().toggle(e.path,this.directive(),!!e.container?.collapsed)}more(e){this.pendingMore=new Set(this.rows().map(e=>e.id)),this.store().more(e.path,this.directive(),e.listed??0)}focusNear(e){let t=this.host.nativeElement,n=Array.from(t.querySelectorAll(`#${this.listId} > li`)),r=e=>e?.querySelector(`button:not([disabled]), input, textarea, [tabindex="0"]`);(n.slice(e).map(r).find(Boolean)??n.slice(0,e).reverse().map(r).find(Boolean)??t.querySelector(`.root > .toggle`))?.focus()}step(e){return Math.min(100,e.more??0)}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-value-tree`]],inputs:{prop:[1,`prop`],store:[1,`store`],componentId:[1,`componentId`],pageId:[1,`pageId`],rpc:[1,`rpc`],writes:[1,`writes`],directive:[1,`directive`],query:[1,`query`]},decls:2,vars:1,consts:[[3,`prop`,`componentId`,`pageId`,`rpc`,`writes`],[1,`root`],[`type`,`button`,1,`toggle`,3,`click`],[`viewBox`,`0 0 24 24`,`aria-hidden`,`true`,1,`chevron`],[`d`,`m9 6 6 6-6 6`],[1,`summary`,`mono`],[1,`whole`,3,`bare`,`prop`,`componentId`,`pageId`,`rpc`,`writes`,`readDraft`],[1,`entries`,3,`id`],[1,`entry`,3,`padding-left`],[1,`entry`],[`type`,`button`,1,`toggle`],[`type`,`button`,1,`more`],[`role`,`status`,1,`muted`],[`role`,`alert`,1,`error`],[1,`key`,`mono`],[1,`leaf-edit`,3,`prop`,`componentId`,`pageId`,`rpc`,`writes`],[1,`leaf`,`mono`],[`type`,`button`,1,`more`,3,`click`],[1,`muted`]],template:function(e,t){if(e&1&&j(0,yM,8,12)(1,bM,1,5,`app-prop-value`,0),e&2){let e;M((e=t.root())?0:1,e)}},dependencies:[Bj],styles:[`[_nghost-%COMP%] { display: block; min-width: 0; } @@ -2091,7 +2091,7 @@ button.edit[_ngcontent-%COMP%] { .more[_ngcontent-%COMP%] { transition: none; } -}`]})};function EM(e,t){return e.length>t.length&&e.startsWith(`${t.slice(0,-1)},`)}var DM=class{sender;target={rpc:null,pageId:null,componentId:null};fetched=D(new Map);pushed=D({});open=D(new Set);loading=D(new Set);errors=D(new Map);limits=new Map;generation=0;constructor(e){this.sender=e}follow(e,t){let n=e.componentId===this.target.componentId&&e.pageId===this.target.pageId;this.target=e,n||(this.generation++,this.fetched.set(new Map),this.open.set(new Set),this.loading.set(new Set),this.errors.set(new Map),this.limits.clear()),this.pushed.set(t??{})}level(e,t){let n=rM(e,t),r=this.pushed();return Object.hasOwn(r,n)?r[n]:this.fetched().get(n)}isOpen(e,t){return this.open().has(rM(e,t))}toggle(e,t,n){let r=rM(e,t),i=new Set(this.open());if(i.has(r)){for(let e of i)(e===r||EM(e,r))&&i.delete(e);this.open.set(i),this.send({path:e,directive:t,forget:!0});return}i.add(r),this.open.set(i),n&&this.load(e,t,this.limits.get(r)??30)}more(e,t,n){let r=rM(e,t),i=Math.min(Hj,Math.max(n,this.limits.get(r)??0)+100);this.limits.set(r,i),this.load(e,t,i)}async read(e,t,n){return this.send({path:e,depth:t,limit:n})}async load(e,t,n){let r=rM(e,t),i=this.generation;this.loading.update(e=>new Set(e).add(r));let a=await this.send({path:e,directive:t,limit:n,watch:!0});i===this.generation&&(this.loading.update(e=>{let t=new Set(e);return t.delete(r),t}),this.errors.update(e=>{let t=new Map(e);return a.ok?t.delete(r):t.set(r,a.error??`The page did not read it.`),t}),a.ok&&this.fetched.update(e=>new Map(e).set(r,a.value)))}async send(e){if(this.sender){if(e.forget)return{ok:!0};let{directive:t,watch:n,...r}=e;try{return await this.sender(r)}catch{return{error:`The devtools server did not answer. Try again.`}}}let{rpc:t,pageId:n,componentId:r}=this.target;if(!t||!n||!r)return{error:`No live page to read from.`};let{directive:i,...a}=e;try{return await t.scope(`pangular`).rpc.call(`request-component-value`,{pageId:n,request:{id:r,...a,...i===void 0?{}:{directive:i}}})??{}}catch{return{error:`The devtools server did not answer. Try again.`}}}};function OM(e,t){if(e&1&&(z(0,`span`,1),K(1),B()),e&2){let e=W(2);O(),J(`: `,e.label())}}function kM(e,t){if(e&1&&(z(0,`span`,1),K(1),B()),e&2){let e=W(3);O(),J(`: `,e.label())}}function AM(e,t){if(e&1){let e=V();z(0,`button`,4),U(`click`,function(){return w(e),T(W(2).store(`log`))}),K(1,` Log to console `),j(2,kM,2,1,`span`,1),B()}if(e&2){let e=W(2);Lg(`disabled`,e.busy()||!e.rpc()||!e.pageId()),O(2),M(e.label()?2:-1)}}function jM(e,t){if(e&1){let e=V();z(0,`button`,0),U(`click`,function(){return w(e),T(W().store())}),K(1,` Store as global `),j(2,OM,2,1,`span`,1),B(),j(3,AM,3,2,`button`,2),z(4,`span`,3),K(5),B()}if(e&2){let e=W();Lg(`disabled`,e.busy()||!e.rpc()||!e.pageId()),O(2),M(e.label()?2:-1),O(),M(e.canLog()?3:-1),O(2),q(e.message())}}var MM=class e{rpc=$(null);pageId=$(null);target=$.required();label=$(``);canLog=$(!1);staticReport=X(()=>$T(this.rpc()));busy=D(!1);message=D(``);async store(e=`store`){let t=this.rpc(),n=this.pageId();if(t&&n){this.busy.set(!0),this.message.set(``);try{let r=await t.scope(`pangular`).rpc.call(`request-console-global`,{pageId:n,target:this.target(),...e===`log`?{mode:e}:{}}),i=e===`log`?r?.ok?`Logged in the page console.`:`Not logged.`:r?.ok&&r.name?`Stored as ${r.name}.`:`Not stored.`;this.message.set(r?.message||i)}catch{this.message.set(`Could not reach the page.`)}finally{this.busy.set(!1)}}}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-store-global`]],inputs:{rpc:[1,`rpc`],pageId:[1,`pageId`],target:[1,`target`],label:[1,`label`],canLog:[1,`canLog`]},decls:1,vars:1,consts:[[`type`,`button`,1,`store`,3,`click`,`disabled`],[1,`sr-only`],[`type`,`button`,1,`store`,`log`,3,`disabled`],[`role`,`status`,1,`status`],[`type`,`button`,1,`store`,`log`,3,`click`,`disabled`]],template:function(e,t){e&1&&j(0,jM,6,4),e&2&&M(t.staticReport()?-1:0)},styles:[`[_nghost-%COMP%] { +}`]})};function TM(e,t){return e.length>t.length&&e.startsWith(`${t.slice(0,-1)},`)}var EM=class{sender;target={rpc:null,pageId:null,componentId:null};fetched=D(new Map);pushed=D({});open=D(new Set);loading=D(new Set);errors=D(new Map);limits=new Map;generation=0;constructor(e){this.sender=e}follow(e,t){let n=e.componentId===this.target.componentId&&e.pageId===this.target.pageId;this.target=e,n||(this.generation++,this.fetched.set(new Map),this.open.set(new Set),this.loading.set(new Set),this.errors.set(new Map),this.limits.clear()),this.pushed.set(t??{})}level(e,t){let n=nM(e,t),r=this.pushed();return Object.hasOwn(r,n)?r[n]:this.fetched().get(n)}isOpen(e,t){return this.open().has(nM(e,t))}toggle(e,t,n){let r=nM(e,t),i=new Set(this.open());if(i.has(r)){for(let e of i)(e===r||TM(e,r))&&i.delete(e);this.open.set(i),this.send({path:e,directive:t,forget:!0});return}i.add(r),this.open.set(i),n&&this.load(e,t,this.limits.get(r)??30)}more(e,t,n){let r=nM(e,t),i=Math.min(Vj,Math.max(n,this.limits.get(r)??0)+100);this.limits.set(r,i),this.load(e,t,i)}async read(e,t,n){return this.send({path:e,depth:t,limit:n})}async load(e,t,n){let r=nM(e,t),i=this.generation;this.loading.update(e=>new Set(e).add(r));let a=await this.send({path:e,directive:t,limit:n,watch:!0});i===this.generation&&(this.loading.update(e=>{let t=new Set(e);return t.delete(r),t}),this.errors.update(e=>{let t=new Map(e);return a.ok?t.delete(r):t.set(r,a.error??`The page did not read it.`),t}),a.ok&&this.fetched.update(e=>new Map(e).set(r,a.value)))}async send(e){if(this.sender){if(e.forget)return{ok:!0};let{directive:t,watch:n,...r}=e;try{return await this.sender(r)}catch{return{error:`The devtools server did not answer. Try again.`}}}let{rpc:t,pageId:n,componentId:r}=this.target;if(!t||!n||!r)return{error:`No live page to read from.`};let{directive:i,...a}=e;try{return await t.scope(`pangular`).rpc.call(`request-component-value`,{pageId:n,request:{id:r,...a,...i===void 0?{}:{directive:i}}})??{}}catch{return{error:`The devtools server did not answer. Try again.`}}}};function DM(e,t){if(e&1&&(z(0,`span`,1),K(1),B()),e&2){let e=W(2);O(),J(`: `,e.label())}}function OM(e,t){if(e&1&&(z(0,`span`,1),K(1),B()),e&2){let e=W(3);O(),J(`: `,e.label())}}function kM(e,t){if(e&1){let e=V();z(0,`button`,4),U(`click`,function(){return w(e),T(W(2).store(`log`))}),K(1,` Log to console `),j(2,OM,2,1,`span`,1),B()}if(e&2){let e=W(2);Ig(`disabled`,e.busy()||!e.rpc()||!e.pageId()),O(2),M(e.label()?2:-1)}}function AM(e,t){if(e&1){let e=V();z(0,`button`,0),U(`click`,function(){return w(e),T(W().store())}),K(1,` Store as global `),j(2,DM,2,1,`span`,1),B(),j(3,kM,3,2,`button`,2),z(4,`span`,3),K(5),B()}if(e&2){let e=W();Ig(`disabled`,e.busy()||!e.rpc()||!e.pageId()),O(2),M(e.label()?2:-1),O(),M(e.canLog()?3:-1),O(2),q(e.message())}}var jM=class e{rpc=$(null);pageId=$(null);target=$.required();label=$(``);canLog=$(!1);staticReport=X(()=>QT(this.rpc()));busy=D(!1);message=D(``);async store(e=`store`){let t=this.rpc(),n=this.pageId();if(t&&n){this.busy.set(!0),this.message.set(``);try{let r=await t.scope(`pangular`).rpc.call(`request-console-global`,{pageId:n,target:this.target(),...e===`log`?{mode:e}:{}}),i=e===`log`?r?.ok?`Logged in the page console.`:`Not logged.`:r?.ok&&r.name?`Stored as ${r.name}.`:`Not stored.`;this.message.set(r?.message||i)}catch{this.message.set(`Could not reach the page.`)}finally{this.busy.set(!1)}}}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-store-global`]],inputs:{rpc:[1,`rpc`],pageId:[1,`pageId`],target:[1,`target`],label:[1,`label`],canLog:[1,`canLog`]},decls:1,vars:1,consts:[[`type`,`button`,1,`store`,3,`click`,`disabled`],[1,`sr-only`],[`type`,`button`,1,`store`,`log`,3,`disabled`],[`role`,`status`,1,`status`],[`type`,`button`,1,`store`,`log`,3,`click`,`disabled`]],template:function(e,t){e&1&&j(0,AM,6,4),e&2&&M(t.staticReport()?-1:0)},styles:[`[_nghost-%COMP%] { display: inline-flex; flex-wrap: wrap; align-items: center; @@ -2140,7 +2140,7 @@ button.edit[_ngcontent-%COMP%] { .status[_ngcontent-%COMP%]:empty { display: none; -}`]})},NM=(e,t)=>t.id;function PM(e,t){if(e&1&&(I(0,`p`,4),K(1),L()),e&2){let e=W(2);O(),J(`The page has more @for blocks than the `,e.length,` listed.`)}}function FM(e,t){e&1&&(I(0,`span`,9),K(1,`@empty showing`),L())}function IM(e,t){e&1&&(I(0,`span`,10),K(1,`@empty`),L())}function LM(e,t){e&1&&(I(0,`span`,10),K(1,`renders nothing`),L())}function RM(e,t){if(e&1){let e=V();I(0,`li`)(1,`button`,6),H(`click`,function(){let t=w(e).$implicit;return T(W(3).showOwner.emit(t))})(`focus`,function(){let t=w(e).$implicit,n=W(3);return T(n.highlight.emit(n.target(t)))})(`blur`,function(){return w(e),T(W(3).highlight.emit(null))})(`mouseenter`,function(){let t=w(e).$implicit,n=W(3);return T(n.highlight.emit(n.target(t)))})(`mouseleave`,function(){return w(e),T(W(3).highlight.emit(null))}),I(2,`span`,7),K(3),L(),I(4,`span`,8),K(5),L(),j(6,FM,2,0,`span`,9)(7,IM,2,0,`span`,10)(8,LM,2,0,`span`,10),I(9,`span`,11),K(10),L()()()}if(e&2){let e=t.$implicit,n=W(3);O(),A(`aria-disabled`,e.owner?null:`true`),O(2),q(e.owner?.name??`Unknown component`),O(2),Y(` `,e.count,` `,e.count===1?`item`:`items`,` `),O(),M(e.showingEmpty?6:e.hasEmptyBlock?7:e.count===0?8:-1),O(4),q(n.trackLabel(e))}}function zM(e,t){if(e&1&&(I(0,`section`,1)(1,`h2`,2),K(2,` @for blocks `),I(3,`span`,3),K(4),L()(),j(5,PM,2,1,`p`,4),I(6,`ul`,5),N(7,RM,11,6,`li`,null,NM),L()()),e&2){let e=W(),t=W();O(4),q(t.truncated()?e.length+`+`:e.length),O(),M(t.truncated()?5:-1),O(2),P(e)}}function BM(e,t){e&1&&j(0,zM,9,2,`section`,1),e&2&&M(t.length?0:-1)}function VM(e,t){e&1&&R(0,`app-angular-unavailable`,0),e&2&&F(`page`,W().angular())}var HM={$index:`track $index`,item:`track item`,function:`track expression`},UM=class e{blocks=$(void 0);truncated=$(!1);supported=$(null);angular=$(null);showOwner=bv();highlight=bv();target(e){return e.rootIds[0]??e.owner?.id??null}trackLabel(e){return e.track?HM[e.track]:`track unknown`}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-for-blocks`]],inputs:{blocks:[1,`blocks`],truncated:[1,`truncated`],supported:[1,`supported`],angular:[1,`angular`]},outputs:{showOwner:`showOwner`,highlight:`highlight`},decls:2,vars:1,consts:[[`capability`,`forBlocks`,`missing`,``,`compact`,``,1,`for`,3,`page`],[`aria-labelledby`,`ct-for-title`,1,`for`],[`id`,`ct-for-title`,1,`for-title`],[1,`pill`],[1,`note`],[1,`for-list`],[`type`,`button`,1,`for-row`,3,`click`,`focus`,`blur`,`mouseenter`,`mouseleave`],[1,`name`,`mono`],[1,`count`],[1,`flag`,`empty`],[1,`flag`],[1,`track`,`mono`]],template:function(e,t){if(e&1&&j(0,BM,1,1)(1,VM,1,1,`app-angular-unavailable`,0),e&2){let e;M((e=t.blocks())?0:t.supported()===!1?1:-1,e)}},dependencies:[kD],styles:[`[_nghost-%COMP%] { +}`]})},MM=(e,t)=>t.id;function NM(e,t){if(e&1&&(I(0,`p`,4),K(1),L()),e&2){let e=W(2);O(),J(`The page has more @for blocks than the `,e.length,` listed.`)}}function PM(e,t){e&1&&(I(0,`span`,9),K(1,`@empty showing`),L())}function FM(e,t){e&1&&(I(0,`span`,10),K(1,`@empty`),L())}function IM(e,t){e&1&&(I(0,`span`,10),K(1,`renders nothing`),L())}function LM(e,t){if(e&1){let e=V();I(0,`li`)(1,`button`,6),H(`click`,function(){let t=w(e).$implicit;return T(W(3).showOwner.emit(t))})(`focus`,function(){let t=w(e).$implicit,n=W(3);return T(n.highlight.emit(n.target(t)))})(`blur`,function(){return w(e),T(W(3).highlight.emit(null))})(`mouseenter`,function(){let t=w(e).$implicit,n=W(3);return T(n.highlight.emit(n.target(t)))})(`mouseleave`,function(){return w(e),T(W(3).highlight.emit(null))}),I(2,`span`,7),K(3),L(),I(4,`span`,8),K(5),L(),j(6,PM,2,0,`span`,9)(7,FM,2,0,`span`,10)(8,IM,2,0,`span`,10),I(9,`span`,11),K(10),L()()()}if(e&2){let e=t.$implicit,n=W(3);O(),A(`aria-disabled`,e.owner?null:`true`),O(2),q(e.owner?.name??`Unknown component`),O(2),Y(` `,e.count,` `,e.count===1?`item`:`items`,` `),O(),M(e.showingEmpty?6:e.hasEmptyBlock?7:e.count===0?8:-1),O(4),q(n.trackLabel(e))}}function RM(e,t){if(e&1&&(I(0,`section`,1)(1,`h2`,2),K(2,` @for blocks `),I(3,`span`,3),K(4),L()(),j(5,NM,2,1,`p`,4),I(6,`ul`,5),N(7,LM,11,6,`li`,null,MM),L()()),e&2){let e=W(),t=W();O(4),q(t.truncated()?e.length+`+`:e.length),O(),M(t.truncated()?5:-1),O(2),P(e)}}function zM(e,t){e&1&&j(0,RM,9,2,`section`,1),e&2&&M(t.length?0:-1)}function BM(e,t){e&1&&R(0,`app-angular-unavailable`,0),e&2&&F(`page`,W().angular())}var VM={$index:`track $index`,item:`track item`,function:`track expression`},HM=class e{blocks=$(void 0);truncated=$(!1);supported=$(null);angular=$(null);showOwner=yv();highlight=yv();target(e){return e.rootIds[0]??e.owner?.id??null}trackLabel(e){return e.track?VM[e.track]:`track unknown`}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-for-blocks`]],inputs:{blocks:[1,`blocks`],truncated:[1,`truncated`],supported:[1,`supported`],angular:[1,`angular`]},outputs:{showOwner:`showOwner`,highlight:`highlight`},decls:2,vars:1,consts:[[`capability`,`forBlocks`,`missing`,``,`compact`,``,1,`for`,3,`page`],[`aria-labelledby`,`ct-for-title`,1,`for`],[`id`,`ct-for-title`,1,`for-title`],[1,`pill`],[1,`note`],[1,`for-list`],[`type`,`button`,1,`for-row`,3,`click`,`focus`,`blur`,`mouseenter`,`mouseleave`],[1,`name`,`mono`],[1,`count`],[1,`flag`,`empty`],[1,`flag`],[1,`track`,`mono`]],template:function(e,t){if(e&1&&j(0,zM,1,1)(1,BM,1,1,`app-angular-unavailable`,0),e&2){let e;M((e=t.blocks())?0:t.supported()===!1?1:-1,e)}},dependencies:[OD],styles:[`[_nghost-%COMP%] { display: block; } @@ -2258,7 +2258,7 @@ button.edit[_ngcontent-%COMP%] { min-width: 0; text-overflow: ellipsis; white-space: nowrap; -}`]})},WM=(e,t)=>t.id;function GM(e,t){if(e&1&&(I(0,`p`,11),K(1),L(),I(2,`h3`,7),K(3,`Still retained`),L(),I(4,`p`,6),K(5,` In a development build, Angular's DI debug data keeps every destroyed component in memory, so Pangular can't tell a leak from that. Check retainers in the Chrome DevTools Memory panel: take a heap snapshot after a few navigations, search for the class and look for a retainer other than Angular's DI debug records. Open subscriptions after destroy are still tracked below. `),L()),e&2){let e=W(),t=W();O(),q(t.plural(e.navigations,`navigation`))}}function KM(e,t){e&1&&(I(0,`p`,6),K(1,` This page cannot track destroyed components. It needs WeakRef, FinalizationRegistry and the Angular debug API of a development build. `),L())}function qM(e,t){if(e&1&&(I(0,`span`,18),K(1),L()),e&2){let e=W().$implicit,t=W(4);O(),q(t.plural(e.subscriptions,`open subscription`))}}function JM(e,t){if(e&1&&(I(0,`li`,13)(1,`span`,14),K(2),L(),I(3,`span`,15),K(4),L(),I(5,`span`,16),K(6),L(),I(7,`span`,17),K(8),L(),j(9,qM,2,1,`span`,18),L()),e&2){let e=t.$implicit,n=W(4);O(2),q(e.name),O(2),q(e.route||`/`),O(2),J(``,n.plural(e.navigations,`navigation`),` ago`),O(2),q(n.ageOf(e)),O(),M(e.subscriptions?9:-1)}}function YM(e,t){if(e&1&&(I(0,`p`,6),K(1),L(),I(2,`ul`,12),N(3,JM,10,5,`li`,13,WM),L()),e&2){let e=W(3);O(),Y(` Destroyed, yet still in memory after at least `,e.minNavigations,` navigations and `,e.minSeconds,` seconds. Take a heap snapshot, search for the class and read its retainers. `),O(2),P(e.retained().slice(0,e.shown))}}function XM(e,t){e&1&&(I(0,`p`,6),K(1,`No destroyed component is still in memory after a few navigations.`),L())}function ZM(e,t){if(e&1&&(I(0,`p`,6),K(1),I(2,`span`,19),K(3),L(),K(4,`. Navigate a few times to see whether they stay. `),L()),e&2){let e=W(3);O(),J(` `,e.plural(e.recent().length,`instance`),` destroyed recently and not collected yet: `),O(2),q(e.names(e.recent()))}}function QM(e,t){if(e&1&&(j(0,KM,2,0,`p`,6),I(1,`p`,11),K(2),L(),I(3,`h3`,7),K(4,` Still retained `),I(5,`span`,8),K(6),L()(),j(7,YM,5,2)(8,XM,2,0,`p`,6),j(9,ZM,5,2,`p`,6)),e&2){let e=W(),t=W();M(e.support.retention?-1:0),O(2),z_(` `,t.plural(e.navigations,`navigation`),` · `,t.retained().length,` still retained · `,t.plural(e.totals.collected,`instance`),` collected `),O(4),q(t.retained().length),O(),M(t.retained().length?7:8),O(2),M(t.recent().length?9:-1)}}function $M(e,t){if(e&1&&(I(0,`p`,6),K(1,` Off the page but not destroyed (detached views, such as a route reuse cache): `),I(2,`span`,19),K(3),L(),K(4,`. `),L()),e&2){let e=W(2);O(3),q(e.names(e.detached()))}}function eN(e,t){if(e&1&&(I(0,`span`,8),K(1),L()),e&2){let e=W();O(),q(e.subscriptions.length)}}function tN(e,t){if(e&1&&(I(0,`span`,15),K(1),L()),e&2){let e=W().$implicit;O(),q(e.source)}}function nN(e,t){if(e&1&&(I(0,`li`,13)(1,`span`,14),K(2),L(),I(3,`span`,16),K(4),L(),I(5,`span`,18),K(6),L(),j(7,tN,2,1,`span`,15),L()),e&2){let e=t.$implicit;O(2),q(e.name),O(2),J(``,e.count,` open`),O(2),J(` `,e.reason===`instance-destroyed`?`instance destroyed`:`no instance left`,` `),O(),M(e.source?7:-1)}}function rN(e,t){if(e&1&&(I(0,`p`,6),K(1,` Still open although the component that made them is gone. Tear them down with takeUntilDestroyed(), DestroyRef.onDestroy or the async pipe. `),L(),I(2,`ul`,12),N(3,nN,8,4,`li`,13,yg),L()),e&2){let e=W(2),t=W();O(3),P(e.subscriptions.slice(0,t.shown))}}function iN(e,t){e&1&&(I(0,`p`,6),K(1,`No subscription is still open after its component went away.`),L())}function aN(e,t){e&1&&(I(0,`p`,6),K(1,` Subscriptions are tied to component classes only; Angular 20 profiler hooks tie them to instances. `),L())}function oN(e,t){if(e&1&&(j(0,rN,5,0)(1,iN,2,0,`p`,6),j(2,aN,2,0,`p`,6)),e&2){let e=W();M(+!e.subscriptions.length),O(2),M(e.support.instances?-1:2)}}function sN(e,t){e&1&&(I(0,`p`,9),K(1,` Tracking could not start: the page has no RxJS the overlay can load. `),L())}function cN(e,t){e&1&&(I(0,`p`,6),K(1,` Off. Track subscriptions wraps Observable.prototype.subscribe on the page to record which component makes each subscription, until you stop it. Subscriptions made before you start are not seen, so reload or navigate again after starting. `),L())}function lN(e,t){e&1&&R(0,`app-angular-unavailable`,10),e&2&&F(`page`,W(2).angular())}function uN(e,t){if(e&1&&(I(0,`span`,16),K(1),L()),e&2){let e=W().$implicit,t=W(3);O(),q(t.plural(e.subscriptions,`subscription`))}}function dN(e,t){if(e&1){let e=V();I(0,`li`)(1,`button`,20),H(`click`,function(){let t=w(e).$implicit;return T(W(3).showComponent.emit(t.id))})(`focus`,function(){let t=w(e).$implicit;return T(W(3).highlight.emit(t.id))})(`blur`,function(){return w(e),T(W(3).highlight.emit(null))})(`mouseenter`,function(){let t=w(e).$implicit;return T(W(3).highlight.emit(t.id))})(`mouseleave`,function(){return w(e),T(W(3).highlight.emit(null))}),I(2,`span`,14),K(3),L(),I(4,`span`,16),K(5),L(),j(6,uN,2,1,`span`,16),L()()}if(e&2){let e=t.$implicit,n=W(2),r=W();O(3),q(e.name),O(2),q(r.effectsText(e)),O(),M(n.support.subscriptions===`on`?6:-1)}}function fN(e,t){e&1&&(I(0,`p`,6),K(1,` Angular files a component's effects under the template its host sits in, so effects of components side by side in one template show as shared. `),L())}function pN(e,t){if(e&1&&(I(0,`ul`,12),N(1,dN,7,3,`li`,null,WM),L(),j(3,fN,2,0,`p`,6)),e&2){let e=W(),t=W();O(),P(e.components.slice(0,t.shown)),O(2),M(e.components.some(t.hasShared)?3:-1)}}function mN(e,t){e&1&&(I(0,`p`,6),K(1,`No component on the page has a live effect or a tracked subscription.`),L())}function hN(e,t){if(e&1&&(j(0,GM,6,1)(1,QM,10,7),j(2,$M,5,1,`p`,6),I(3,`h3`,7),K(4,` Open subscriptions after destroy `),j(5,eN,2,1,`span`,8),L(),j(6,oN,3,2)(7,sN,2,0,`p`,9)(8,cN,2,0,`p`,6),I(9,`h3`,7),K(10,` Live effects and subscriptions `),I(11,`span`,8),K(12),L()(),j(13,lN,1,1,`app-angular-unavailable`,10),j(14,pN,4,1)(15,mN,2,0,`p`,6)),e&2){let e,n=t,r=W();M(n.support.retention===`dev-di-debug`?0:1),O(2),M(r.detached().length?2:-1),O(3),M(n.support.subscriptions===`on`?5:-1),O(),M((e=n.support.subscriptions)===`on`?6:e===`unavailable`?7:8),O(6),q(n.components.length),O(),M(n.support.effects?-1:13),O(),M(n.components.length?14:15)}}function gN(e,t){e&1&&(I(0,`p`,6),K(1,`No leak data from this page yet. It comes with the next report.`),L())}var _N=20;function vN(e){let t=Math.max(0,Math.round(e/1e3));if(t<120)return`${t} s`;let n=Math.round(t/60);return n<120?`${n} min`:`${Math.round(n/60)} h`}var yN=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,bN=class e{report=$(null);pageId=$(null);rpc=$(null);angular=$(null);now=$(()=>Date.now());showComponent=bv();highlight=bv();shown=_N;minNavigations=2;minSeconds=cT/1e3;plural=yN;busy=D(!1);announcement=D(``);tracking=X(()=>this.report()?.support.subscriptions===`on`);split=X(()=>{let e=this.report(),t=[],n=[],r=[];if(!e)return{retained:t,recent:n,detached:r};let i=e.support.retention===`dev-di-debug`;for(let a of e.destroyed)if(a.detached)r.push(a);else if(i)continue;else this.isRetained(e,a)?t.push(a):n.push(a);return{retained:t,recent:n,detached:r}});retained=X(()=>this.split().retained);recent=X(()=>this.split().recent);detached=X(()=>this.split().detached);ageMs(e,t){return Math.max(0,this.now()()-e.reportedAt+(e.at-t.destroyedAt))}isRetained(e,t){return t.navigations>=2&&this.ageMs(e,t)>=1e4}ageOf(e){let t=this.report();return t?`${vN(this.ageMs(t,e))} old`:``}names(e){let t=[...new Set(e.map(e=>e.name))];return t.length>6?`${t.slice(0,6).join(`, `)} and more`:t.join(`, `)}hasShared(e){return!!e.sharedEffects}effectsText(e){let t=yN(e.effects,`effect`);return e.sharedEffects?`${t}, ${e.sharedEffects} shared`:t}async toggle(){let e=this.pageId();if(!e||this.busy())return;let t=!this.tracking();this.busy.set(!0);try{await ZT(this.rpc(),`request-leak-tracking`,{pageId:e,on:t}),this.announcement.set(t?`Tracking subscriptions. Reload or navigate to see subscriptions made at start.`:`Stopped tracking subscriptions.`)}catch{this.announcement.set(`Could not reach the page. Try again.`)}finally{this.busy.set(!1)}}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-leaks-section`]],inputs:{report:[1,`report`],pageId:[1,`pageId`],rpc:[1,`rpc`],angular:[1,`angular`],now:[1,`now`]},outputs:{showComponent:`showComponent`,highlight:`highlight`},decls:12,vars:5,consts:[[`aria-labelledby`,`ct-leaks-title`,1,`leaks`],[1,`head`],[`id`,`ct-leaks-title`],[`type`,`button`,1,`track`,3,`click`,`disabled`],[`role`,`status`,1,`sr-only`],[1,`hint`],[1,`note`],[1,`sub`],[1,`pill`],[`role`,`status`,1,`note`],[`capability`,`signalGraph`,`missing`,``,`compact`,``,3,`page`],[1,`stats`],[1,`rows`],[1,`row`],[1,`name`,`mono`],[1,`meta`,`mono`],[1,`count`],[1,`meta`],[1,`flag`,`warn`],[1,`mono`],[`type`,`button`,1,`row`,`live`,3,`click`,`focus`,`blur`,`mouseenter`,`mouseleave`]],template:function(e,t){if(e&1&&(I(0,`section`,0)(1,`div`,1)(2,`h2`,2),K(3,`Leaks`),L(),I(4,`button`,3),H(`click`,function(){return t.toggle()}),K(5,` Track subscriptions `),L(),I(6,`p`,4),K(7),L()(),I(8,`p`,5),K(9,` Components that left the page but are still in memory, and the live effects and RxJS subscriptions of each component. The browser collects garbage when it decides, so a retained instance is a hint: check what holds it in the Chrome DevTools Memory panel. `),L(),j(10,hN,16,7)(11,gN,2,0,`p`,6),L()),e&2){let e;O(4),F(`disabled`,!t.pageId()||!t.report()),A(`aria-pressed`,t.tracking())(`aria-disabled`,t.busy()||null),O(3),q(t.announcement()),O(3),M((e=t.report())?10:11,e)}},dependencies:[kD],styles:[`[_nghost-%COMP%] { +}`]})},UM=(e,t)=>t.id;function WM(e,t){if(e&1&&(I(0,`p`,11),K(1),L(),I(2,`h3`,7),K(3,`Still retained`),L(),I(4,`p`,6),K(5,` In a development build, Angular's DI debug data keeps every destroyed component in memory, so Pangular can't tell a leak from that. Check retainers in the Chrome DevTools Memory panel: take a heap snapshot after a few navigations, search for the class and look for a retainer other than Angular's DI debug records. Open subscriptions after destroy are still tracked below. `),L()),e&2){let e=W(),t=W();O(),q(t.plural(e.navigations,`navigation`))}}function GM(e,t){e&1&&(I(0,`p`,6),K(1,` This page cannot track destroyed components. It needs WeakRef, FinalizationRegistry and the Angular debug API of a development build. `),L())}function KM(e,t){if(e&1&&(I(0,`span`,18),K(1),L()),e&2){let e=W().$implicit,t=W(4);O(),q(t.plural(e.subscriptions,`open subscription`))}}function qM(e,t){if(e&1&&(I(0,`li`,13)(1,`span`,14),K(2),L(),I(3,`span`,15),K(4),L(),I(5,`span`,16),K(6),L(),I(7,`span`,17),K(8),L(),j(9,KM,2,1,`span`,18),L()),e&2){let e=t.$implicit,n=W(4);O(2),q(e.name),O(2),q(e.route||`/`),O(2),J(``,n.plural(e.navigations,`navigation`),` ago`),O(2),q(n.ageOf(e)),O(),M(e.subscriptions?9:-1)}}function JM(e,t){if(e&1&&(I(0,`p`,6),K(1),L(),I(2,`ul`,12),N(3,qM,10,5,`li`,13,UM),L()),e&2){let e=W(3);O(),Y(` Destroyed, yet still in memory after at least `,e.minNavigations,` navigations and `,e.minSeconds,` seconds. Take a heap snapshot, search for the class and read its retainers. `),O(2),P(e.retained().slice(0,e.shown))}}function YM(e,t){e&1&&(I(0,`p`,6),K(1,`No destroyed component is still in memory after a few navigations.`),L())}function XM(e,t){if(e&1&&(I(0,`p`,6),K(1),I(2,`span`,19),K(3),L(),K(4,`. Navigate a few times to see whether they stay. `),L()),e&2){let e=W(3);O(),J(` `,e.plural(e.recent().length,`instance`),` destroyed recently and not collected yet: `),O(2),q(e.names(e.recent()))}}function ZM(e,t){if(e&1&&(j(0,GM,2,0,`p`,6),I(1,`p`,11),K(2),L(),I(3,`h3`,7),K(4,` Still retained `),I(5,`span`,8),K(6),L()(),j(7,JM,5,2)(8,YM,2,0,`p`,6),j(9,XM,5,2,`p`,6)),e&2){let e=W(),t=W();M(e.support.retention?-1:0),O(2),R_(` `,t.plural(e.navigations,`navigation`),` · `,t.retained().length,` still retained · `,t.plural(e.totals.collected,`instance`),` collected `),O(4),q(t.retained().length),O(),M(t.retained().length?7:8),O(2),M(t.recent().length?9:-1)}}function QM(e,t){if(e&1&&(I(0,`p`,6),K(1,` Off the page but not destroyed (detached views, such as a route reuse cache): `),I(2,`span`,19),K(3),L(),K(4,`. `),L()),e&2){let e=W(2);O(3),q(e.names(e.detached()))}}function $M(e,t){if(e&1&&(I(0,`span`,8),K(1),L()),e&2){let e=W();O(),q(e.subscriptions.length)}}function eN(e,t){if(e&1&&(I(0,`span`,15),K(1),L()),e&2){let e=W().$implicit;O(),q(e.source)}}function tN(e,t){if(e&1&&(I(0,`li`,13)(1,`span`,14),K(2),L(),I(3,`span`,16),K(4),L(),I(5,`span`,18),K(6),L(),j(7,eN,2,1,`span`,15),L()),e&2){let e=t.$implicit;O(2),q(e.name),O(2),J(``,e.count,` open`),O(2),J(` `,e.reason===`instance-destroyed`?`instance destroyed`:`no instance left`,` `),O(),M(e.source?7:-1)}}function nN(e,t){if(e&1&&(I(0,`p`,6),K(1,` Still open although the component that made them is gone. Tear them down with takeUntilDestroyed(), DestroyRef.onDestroy or the async pipe. `),L(),I(2,`ul`,12),N(3,tN,8,4,`li`,13,vg),L()),e&2){let e=W(2),t=W();O(3),P(e.subscriptions.slice(0,t.shown))}}function rN(e,t){e&1&&(I(0,`p`,6),K(1,`No subscription is still open after its component went away.`),L())}function iN(e,t){e&1&&(I(0,`p`,6),K(1,` Subscriptions are tied to component classes only; Angular 20 profiler hooks tie them to instances. `),L())}function aN(e,t){if(e&1&&(j(0,nN,5,0)(1,rN,2,0,`p`,6),j(2,iN,2,0,`p`,6)),e&2){let e=W();M(+!e.subscriptions.length),O(2),M(e.support.instances?-1:2)}}function oN(e,t){e&1&&(I(0,`p`,9),K(1,` Tracking could not start: the page has no RxJS the overlay can load. `),L())}function sN(e,t){e&1&&(I(0,`p`,6),K(1,` Off. Track subscriptions wraps Observable.prototype.subscribe on the page to record which component makes each subscription, until you stop it. Subscriptions made before you start are not seen, so reload or navigate again after starting. `),L())}function cN(e,t){e&1&&R(0,`app-angular-unavailable`,10),e&2&&F(`page`,W(2).angular())}function lN(e,t){if(e&1&&(I(0,`span`,16),K(1),L()),e&2){let e=W().$implicit,t=W(3);O(),q(t.plural(e.subscriptions,`subscription`))}}function uN(e,t){if(e&1){let e=V();I(0,`li`)(1,`button`,20),H(`click`,function(){let t=w(e).$implicit;return T(W(3).showComponent.emit(t.id))})(`focus`,function(){let t=w(e).$implicit;return T(W(3).highlight.emit(t.id))})(`blur`,function(){return w(e),T(W(3).highlight.emit(null))})(`mouseenter`,function(){let t=w(e).$implicit;return T(W(3).highlight.emit(t.id))})(`mouseleave`,function(){return w(e),T(W(3).highlight.emit(null))}),I(2,`span`,14),K(3),L(),I(4,`span`,16),K(5),L(),j(6,lN,2,1,`span`,16),L()()}if(e&2){let e=t.$implicit,n=W(2),r=W();O(3),q(e.name),O(2),q(r.effectsText(e)),O(),M(n.support.subscriptions===`on`?6:-1)}}function dN(e,t){e&1&&(I(0,`p`,6),K(1,` Angular files a component's effects under the template its host sits in, so effects of components side by side in one template show as shared. `),L())}function fN(e,t){if(e&1&&(I(0,`ul`,12),N(1,uN,7,3,`li`,null,UM),L(),j(3,dN,2,0,`p`,6)),e&2){let e=W(),t=W();O(),P(e.components.slice(0,t.shown)),O(2),M(e.components.some(t.hasShared)?3:-1)}}function pN(e,t){e&1&&(I(0,`p`,6),K(1,`No component on the page has a live effect or a tracked subscription.`),L())}function mN(e,t){if(e&1&&(j(0,WM,6,1)(1,ZM,10,7),j(2,QM,5,1,`p`,6),I(3,`h3`,7),K(4,` Open subscriptions after destroy `),j(5,$M,2,1,`span`,8),L(),j(6,aN,3,2)(7,oN,2,0,`p`,9)(8,sN,2,0,`p`,6),I(9,`h3`,7),K(10,` Live effects and subscriptions `),I(11,`span`,8),K(12),L()(),j(13,cN,1,1,`app-angular-unavailable`,10),j(14,fN,4,1)(15,pN,2,0,`p`,6)),e&2){let e,n=t,r=W();M(n.support.retention===`dev-di-debug`?0:1),O(2),M(r.detached().length?2:-1),O(3),M(n.support.subscriptions===`on`?5:-1),O(),M((e=n.support.subscriptions)===`on`?6:e===`unavailable`?7:8),O(6),q(n.components.length),O(),M(n.support.effects?-1:13),O(),M(n.components.length?14:15)}}function hN(e,t){e&1&&(I(0,`p`,6),K(1,`No leak data from this page yet. It comes with the next report.`),L())}var gN=20;function _N(e){let t=Math.max(0,Math.round(e/1e3));if(t<120)return`${t} s`;let n=Math.round(t/60);return n<120?`${n} min`:`${Math.round(n/60)} h`}var vN=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,yN=class e{report=$(null);pageId=$(null);rpc=$(null);angular=$(null);now=$(()=>Date.now());showComponent=yv();highlight=yv();shown=gN;minNavigations=2;minSeconds=sT/1e3;plural=vN;busy=D(!1);announcement=D(``);tracking=X(()=>this.report()?.support.subscriptions===`on`);split=X(()=>{let e=this.report(),t=[],n=[],r=[];if(!e)return{retained:t,recent:n,detached:r};let i=e.support.retention===`dev-di-debug`;for(let a of e.destroyed)if(a.detached)r.push(a);else if(i)continue;else this.isRetained(e,a)?t.push(a):n.push(a);return{retained:t,recent:n,detached:r}});retained=X(()=>this.split().retained);recent=X(()=>this.split().recent);detached=X(()=>this.split().detached);ageMs(e,t){return Math.max(0,this.now()()-e.reportedAt+(e.at-t.destroyedAt))}isRetained(e,t){return t.navigations>=2&&this.ageMs(e,t)>=1e4}ageOf(e){let t=this.report();return t?`${_N(this.ageMs(t,e))} old`:``}names(e){let t=[...new Set(e.map(e=>e.name))];return t.length>6?`${t.slice(0,6).join(`, `)} and more`:t.join(`, `)}hasShared(e){return!!e.sharedEffects}effectsText(e){let t=vN(e.effects,`effect`);return e.sharedEffects?`${t}, ${e.sharedEffects} shared`:t}async toggle(){let e=this.pageId();if(!e||this.busy())return;let t=!this.tracking();this.busy.set(!0);try{await XT(this.rpc(),`request-leak-tracking`,{pageId:e,on:t}),this.announcement.set(t?`Tracking subscriptions. Reload or navigate to see subscriptions made at start.`:`Stopped tracking subscriptions.`)}catch{this.announcement.set(`Could not reach the page. Try again.`)}finally{this.busy.set(!1)}}static ɵfac=function(t){return new(t||e)};static ɵcmp=k({type:e,selectors:[[`app-leaks-section`]],inputs:{report:[1,`report`],pageId:[1,`pageId`],rpc:[1,`rpc`],angular:[1,`angular`],now:[1,`now`]},outputs:{showComponent:`showComponent`,highlight:`highlight`},decls:12,vars:5,consts:[[`aria-labelledby`,`ct-leaks-title`,1,`leaks`],[1,`head`],[`id`,`ct-leaks-title`],[`type`,`button`,1,`track`,3,`click`,`disabled`],[`role`,`status`,1,`sr-only`],[1,`hint`],[1,`note`],[1,`sub`],[1,`pill`],[`role`,`status`,1,`note`],[`capability`,`signalGraph`,`missing`,``,`compact`,``,3,`page`],[1,`stats`],[1,`rows`],[1,`row`],[1,`name`,`mono`],[1,`meta`,`mono`],[1,`count`],[1,`meta`],[1,`flag`,`warn`],[1,`mono`],[`type`,`button`,1,`row`,`live`,3,`click`,`focus`,`blur`,`mouseenter`,`mouseleave`]],template:function(e,t){if(e&1&&(I(0,`section`,0)(1,`div`,1)(2,`h2`,2),K(3,`Leaks`),L(),I(4,`button`,3),H(`click`,function(){return t.toggle()}),K(5,` Track subscriptions `),L(),I(6,`p`,4),K(7),L()(),I(8,`p`,5),K(9,` Components that left the page but are still in memory, and the live effects and RxJS subscriptions of each component. The browser collects garbage when it decides, so a retained instance is a hint: check what holds it in the Chrome DevTools Memory panel. `),L(),j(10,mN,16,7)(11,hN,2,0,`p`,6),L()),e&2){let e;O(4),F(`disabled`,!t.pageId()||!t.report()),A(`aria-pressed`,t.tracking())(`aria-disabled`,t.busy()||null),O(3),q(t.announcement()),O(3),M((e=t.report())?10:11,e)}},dependencies:[OD],styles:[`[_nghost-%COMP%] { display: block; } @@ -2414,7 +2414,7 @@ h2[_ngcontent-%COMP%] { border-color: color-mix(in srgb, var(--%NS%warn) 30%, transparent); background: color-mix(in srgb, var(--%NS%warn) 12%, transparent); color: var(--%NS%warn-text); -}`]})},xN=12,SN=900;function CN(e){for(let t=e.parentElement;t;t=t.parentElement){let e=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(e.overflowY))return t}return null}var wN=class{options;injector=C(js);visibleTop=D(0);viewport=D(SN);rowHeight;host=null;scroller=null;detach=null;enabled;range;padTop;padBottom;constructor(e){this.options=e,this.rowHeight=D(e.estimate);let t=e.min??300;this.enabled=X(()=>e.count()>t),this.range=X(()=>{let t=e.count();if(!this.enabled())return{start:0,end:t};let n=this.rowHeight(),r=this.viewport(),i=Math.max(0,Math.min(this.visibleTop(),t*n-r)),a=Math.max(0,Math.min(t-1,Math.floor(i/n)-xN));return{start:a,end:Math.min(t,Math.max(a,Math.ceil((i+r)/n)+xN))}}),this.padTop=X(()=>this.enabled()?this.range().start*this.rowHeight():0),this.padBottom=X(()=>this.enabled()?(e.count()-this.range().end)*this.rowHeight():0),bc(()=>{e.count(),dd(()=>this.update(),{injector:this.injector})}),C(Ns).onDestroy(()=>this.detach?.())}get count(){return this.options.count()}rendered(e){let{start:t,end:n}=this.range();return e>=t&&ethis.update();n.addEventListener(`scroll`,r,{passive:!0}),window.addEventListener(`resize`,r),this.detach=()=>{n.removeEventListener(`scroll`,r),window.removeEventListener(`resize`,r)},this.update()}update(){let e=this.host;if(e){if(this.scroller===e)this.place(e.scrollTop,e.clientHeight);else{let t=this.scroller?this.scroller.getBoundingClientRect().top:0,n=this.scroller?this.scroller.clientHeight:window.innerHeight;this.place(t-e.getBoundingClientRect().top,n)}this.options.fixed||this.measure()}}place(e,t){this.visibleTop.set(e),this.viewport.set(t>0?t:SN)}measure(){let e=this.host?.querySelectorAll(`[data-vindex]`);if(!e||e.length<2)return;let t=e[0].getBoundingClientRect(),n=(e[e.length-1].getBoundingClientRect().bottom-t.top)/e.length;n>4&&Math.abs(n-this.rowHeight())>1&&this.rowHeight.set(n)}reveal(e,t){if(this.enabled()&&!this.rendered(e)){let t=e*this.rowHeight(),n=this.viewport(),r=Math.max(0,t-n/2);if(this.place(r,n),this.host&&this.scroller===this.host)this.host.scrollTop=r;else if(this.host){let e=this.scroller?this.scroller.getBoundingClientRect().top:0,t=this.host.getBoundingClientRect().top-e+r;this.scroller?this.scroller.scrollTop+=t:window.scrollBy(0,t)}}t&&dd(t,{injector:this.injector})}};function TN(e){let t=e.ownerDocument.defaultView;if(!t)return null;for(let n=e.parentElement;n&&n!==e.ownerDocument.documentElement&&n!==e.ownerDocument.body;n=n.parentElement)if(/(auto|scroll|overlay)/.test(t.getComputedStyle(n).overflowY))return n;return null}var EN=e=>{let t=parseFloat(e);return Number.isFinite(t)?t:0};function DN(e,t=8){let n=e.ownerDocument.defaultView;if(!n)return e.offsetHeight+t;let r=TN(e),i=r?n.getComputedStyle(r):null,a=i?EN(i.paddingTop):0,o=i?EN(i.scrollPaddingTop):0,s=EN(n.getComputedStyle(e).top);return Math.max(0,Math.ceil(a+s+e.offsetHeight+t-o))}function ON(e,t,n=8){let r=TN(e),i=t.getBoundingClientRect().bottom+n-e.getBoundingClientRect().top;i<=0||(r?r.scrollTop-=i:e.ownerDocument.defaultView?.scrollBy(0,-i))}var kN=[`filterInput`],AN=[`treeEl`],jN=[`propFilterInput`],MN=()=>[],NN=e=>({kind:`component`,id:e}),PN=(e,t)=>t.row.node.id,FN=(e,t)=>t.outlet+t.route,IN=(e,t)=>t+e,LN=(e,t)=>t.formId,RN=(e,t)=>t.name+t.index,zN=(e,t)=>t.name,BN=(e,t)=>t.token+e,VN=(e,t)=>t.id;function HN(e,t){return this.sourceKey(t)}function UN(e,t){if(e&1){let e=V();I(0,`span`,35),K(1,`Page`),L(),I(2,`app-select`,36),H(`valueChange`,function(t){return w(e),T(W(2).selectPage(t))}),L()}if(e&2){let e=W(2);O(2),F(`options`,e.pageOptions())(`value`,e.page()?.pageId??null)}}function WN(e,t){if(e&1){let e=V();I(0,`button`,37),H(`click`,function(){return w(e),T(W(2).toggleDirectiveHosts())}),E(),I(1,`svg`,14),R(2,`path`,38)(3,`path`,39),L(),K(4,` Directive hosts `),L()}e&2&&A(`aria-pressed`,W(2).showDirectiveHosts())}function GN(e,t){if(e&1){let e=V();I(0,`button`,40),H(`click`,function(){w(e);let t=W(2);return T(t.picking()?t.cancelPick():t.pick())}),E(),I(1,`svg`,14),R(2,`path`,41),L(),K(3),L()}if(e&2){let e=W(2);G(`on`,e.picking()),O(3),J(` `,e.picking()?`Cancel pick`:`Pick component on page`,` `)}}function KN(e,t){if(e&1&&(I(0,`p`,21),K(1),L()),e&2){let e=W(2);O(),q(e.pickMessage())}}function qN(e,t){if(e&1&&(I(0,`p`,22),K(1),L()),e&2){let e=W(2);O(),q(e.truncationText())}}function JN(e,t){e&1&&(I(0,`p`,43),K(1,`The filter only searches the components the tree lists.`),L())}function YN(e,t){e&1&&(I(0,`p`,43),K(1,`Directive hosts are hidden, so they are not searched.`),L())}function XN(e,t){if(e&1){let e=V();I(0,`div`,25)(1,`p`,42),K(2),L(),j(3,JN,2,0,`p`,43),j(4,YN,2,0,`p`,43),I(5,`button`,44),H(`click`,function(){return w(e),T(W(2).clearFilter())}),K(6,`Clear filters`),L()()}if(e&2){let e=W(2);O(2),J(`No components match “`,e.filter().trim(),`”`),O(),M(e.page().truncated?3:-1),O(),M(!e.showDirectiveHosts()&&e.page().directiveHostCount?4:-1)}}function ZN(e,t){if(e&1&&(I(0,`p`,26),K(1),L()),e&2){let e=W(2);O(),J(` `,e.rows().length,` rows. Rows render as you scroll, so the browser's find only sees the ones near view; the filter above searches them all. `)}}function QN(e,t){if(e&1){let e=V();I(0,`span`,52),H(`click`,function(t){w(e),W();let n=J_(0);return T(W(2).toggle(n.node.id,t))}),E(),I(1,`svg`,53),R(2,`path`,54),L()()}e&2&&(W(),G(`open`,J_(0).expanded))}function $N(e,t){e&1&&R(0,`span`,47)}function eP(e,t){if(e&1&&(I(0,`span`,55),K(1),L(),I(2,`span`,56),K(3),L(),I(4,`span`,24),K(5,`directive host`),L()),e&2){W();let e=J_(0),t=W(2);O(),J(`<`,e.node.tag,`>`),O(),A(`title`,e.node.directives?.join(`, `)),O(),q(t.hostLabel(e.node))}}function tP(e,t){if(e&1&&(I(0,`span`,57),K(1),L(),I(2,`span`,58),K(3),L()),e&2){W();let e=J_(0);O(),q(e.node.name),O(2),J(`<`,e.node.tag,`>`)}}function nP(e,t){if(e&1&&(I(0,`span`)(1,`span`,24),K(2,`Hydration: `),L(),K(3),L()),e&2){let e=t,n=W(3);C_(`hyd hyd-`+e),O(3),q(n.hydrationText(e))}}function rP(e,t){if(e&1&&(I(0,`span`,49),K(1),L()),e&2){let e=t.$implicit;O(),q(e.route||`/`)}}function iP(e,t){if(e&1&&(I(0,`span`,50),K(1),I(2,`span`,24),K(3),L()()),e&2){let e=t;O(),J(` `,e),O(2),J(` `,e===1?`check`:`checks`,` while recording`)}}function aP(e,t){if(e&1&&(I(0,`span`,51),K(1),I(2,`span`,24),K(3),L()()),e&2){W();let e=J_(0);A(`title`,e.node.directives.join(`, `)),O(),J(` +`,e.node.directives.length,` `),O(2),J(` `,e.node.directives.length===1?`directive`:`directives`,` `)}}function oP(e,t){if(e&1){let e=V();K_(0),I(1,`div`,45),H(`click`,function(){w(e);let t=J_(0);return T(W(2).select(t.node.id))})(`focus`,function(){w(e);let t=J_(0),n=W(2);return n.focusId.set(t.node.id),T(n.highlight(t.node.id))})(`blur`,function(){return w(e),T(W(2).highlight(null))})(`mouseenter`,function(){w(e);let t=J_(0);return T(W(2).highlight(t.node.id))})(`mouseleave`,function(){return w(e),T(W(2).highlight(null))}),j(2,QN,3,2,`span`,46)(3,$N,1,0,`span`,47),j(4,eP,6,3)(5,tP,4,2),j(6,nP,4,3,`span`,48),N(7,rP,2,1,`span`,49,FN),j(9,iP,4,2,`span`,50),j(10,aP,4,3,`span`,51),L()}if(e&2){let e,n,r=t.$implicit,i=W(2),a=q_(r.row);O(),S_(`--%NS%depth`,a.depth),G(`selected`,i.selectedId()===a.node.id)(`dir-host`,a.node.kind===`directive`),A(`aria-level`,a.depth+1)(`aria-setsize`,a.setsize)(`aria-posinset`,a.posinset)(`aria-expanded`,a.hasChildren?a.expanded:null)(`aria-selected`,i.selectedId()===a.node.id)(`tabindex`,i.tabStop()===a.node.id?0:-1)(`data-vindex`,r.index)(`data-id`,a.node.id),O(),M(a.hasChildren?2:3),O(2),M(a.node.kind===`directive`?4:5),O(2),M((e=a.node.hydration)?6:-1,e),O(),P(i.routedById().get(a.node.id)??rv(20,MN)),O(2),M((n=i.cdHosts()[a.node.id])?9:-1,n),O(),M(a.node.kind!==`directive`&&a.node.directives?.length?10:-1)}}function sP(e,t){if(e&1&&(I(0,`li`,66),K(1),L()),e&2){let e=t.$implicit;O(),q(e)}}function cP(e,t){if(e&1){let e=V();I(0,`div`,68)(1,`button`,44),H(`click`,function(){let t=w(e);return T(W(3).reveal(t.id,!0))}),K(2),L()()}e&2&&(O(2),J(` Show `,t.name,` `))}function lP(e,t){if(e&1&&(I(0,`section`,29)(1,`header`,59)(2,`span`,60),K(3,`directive host`),L(),I(4,`h2`,61),K(5),L(),I(6,`span`,62),K(7),L()(),I(8,`div`,63)(9,`h3`),K(10,` Directives `),I(11,`span`,64),K(12),L()(),I(13,`ul`,65),N(14,sP,2,1,`li`,66,IN),L()(),I(16,`div`,63)(17,`p`,67),K(18,` This element hosts directives but no component. Their inputs are bound in the template of the component that renders it. `),L(),j(19,cP,3,1,`div`,68),L()()),e&2){let e,n=t,r=W(2);O(5),J(`<`,n.tag,`>`),O(2),q(r.hostLabel(n)),O(5),q(n.directives?.length??0),O(2),P(n.directives??rv(4,MN)),O(5),M((e=r.ownerOf(n.id))?19:-1,e)}}function uP(e,t){if(e&1&&(I(0,`p`,69),R(1,`app-source-link`,73),L()),e&2){let e=t;O(),F(`file`,e.file)(`line`,e.line)}}function dP(e,t){if(e&1){let e=V();I(0,`div`,74)(1,`button`,44),H(`click`,function(){w(e);let t=W();return T(W(2).revealInElements(t))}),K(2,`Reveal in Elements`),L(),I(3,`button`,44),H(`click`,function(){w(e);let t=W();return T(W(2).openSource(t))}),K(4,`Open source`),L()(),I(5,`p`,75),K(6),L()}if(e&2){let e=W(3);O(6),q(e.actionMessage())}}function fP(e,t){if(e&1){let e=V();I(0,`button`,77),H(`click`,function(){let t=w(e).$implicit;return T(W(5).showForm.emit(t.formId))}),K(1),L()}if(e&2){let e=t.$implicit;O(),J(` Show `,e.label,` in Forms `)}}function pP(e,t){if(e&1&&(I(0,`div`,70),N(1,fP,2,1,`button`,76,LN),L()),e&2){let e=W(),t=W(3);O(),P(t.formsIn(e.file))}}function mP(e,t){e&1&&j(0,pP,3,0,`div`,70),e&2&&M(W(3).formsIn(t.file).length?0:-1)}function hP(e,t){if(e&1){let e=V();I(0,`div`,70)(1,`button`,44),H(`click`,function(){w(e);let t=W();return T(W(2).openInjector(t))}),K(2,` Show in Injectors `),I(3,`span`,24),K(4),L()()()}if(e&2){let e=W();O(4),J(`: `,e.name)}}function gP(e,t){if(e&1&&R(0,`app-store-global`,71),e&2){let e=W(),t=W(2);F(`rpc`,t.rpc())(`pageId`,t.page()?.pageId)(`target`,iv(4,NN,e.id))(`label`,e.name)}}function _P(e,t){if(e&1&&(I(0,`dt`),K(1,`Routed`),L(),I(2,`dd`,79),K(3),L()),e&2){let e=t.$implicit;O(3),Y(``,e.route||`/`,` in outlet `,e.outlet)}}function vP(e,t){if(e&1&&(I(0,`span`,11),K(1),L()),e&2){let e=W(4);O(),Y(``,e.shownValues()?.count??0,` of `,e.valueTotal())}}function yP(e,t){if(e&1){let e=V();I(0,`div`,83)(1,`p`,42),K(2),L(),I(3,`p`,43),K(4,` The filter searches names, and the nested keys of values you opened. `),L(),I(5,`button`,44),H(`click`,function(){return w(e),T(W(5).clearPropFilter())}),K(6,`Clear filters`),L()()}if(e&2){let e=W(5);O(2),J(` No inputs, outputs or properties match “`,e.propFilter().trim(),`” `)}}function bP(e,t){if(e&1&&(I(0,`span`,87),K(1),L()),e&2){let e=W().$implicit;O(),J(`(`,e.prop,`)`)}}function xP(e,t){if(e&1&&(I(0,`li`,85)(1,`span`,86),K(2),j(3,bP,2,1,`span`,87),L(),R(4,`app-value-tree`,88),L()),e&2){let e=t.$implicit,n=W(4),r=W(3);O(2),J(` `,e.name,` `),O(),M(e.prop===e.name?-1:3),O(),F(`prop`,e)(`store`,r.values)(`query`,r.propFilter())(`componentId`,n.id)(`pageId`,r.page()?.pageId??null)(`rpc`,r.rpc())(`writes`,r.canEdit())}}function SP(e,t){if(e&1&&(I(0,`ul`,84),N(1,xP,5,9,`li`,85,zN),L()),e&2){let e=W(2);O(),P(e.inputs)}}function CP(e,t){e&1&&(I(0,`p`,67),K(1,`No inputs.`),L())}function wP(e,t){if(e&1&&(I(0,`div`,63)(1,`h3`),K(2,` Inputs `),I(3,`span`,64),K(4),L()(),j(5,SP,3,0,`ul`,84)(6,CP,2,0,`p`,67),L()),e&2){let e=W();O(4),q(e.inputs.length),O(),M(e.inputs.length?5:6)}}function TP(e,t){if(e&1&&(I(0,`li`,90)(1,`span`,79),K(2),L(),I(3,`span`,91),K(4),L()()),e&2){let e=t.$implicit;G(`on`,e.listened),O(2),q(e.name),O(2),q(e.listened?`listened`:`no listener`)}}function EP(e,t){if(e&1&&(I(0,`ul`,65),N(1,TP,5,4,`li`,89,zN),L()),e&2){let e=W(2);O(),P(e.outputs)}}function DP(e,t){e&1&&(I(0,`p`,67),K(1,`No outputs.`),L())}function OP(e,t){if(e&1&&(I(0,`div`,63)(1,`h3`),K(2,` Outputs `),I(3,`span`,64),K(4),L()(),j(5,EP,3,0,`ul`,65)(6,DP,2,0,`p`,67),L()),e&2){let e=W();O(4),q(e.outputs.length),O(),M(e.outputs.length?5:6)}}function kP(e,t){if(e&1&&(I(0,`span`,92),K(1),L()),e&2){let e=W().$implicit;O(),q(e.kind)}}function AP(e,t){if(e&1&&(I(0,`li`,85)(1,`span`,86),K(2),j(3,kP,2,1,`span`,92),L(),R(4,`app-value-tree`,88),L()),e&2){let e=t.$implicit,n=W(4),r=W(3);O(2),J(` `,e.name,` `),O(),M(e.kind?3:-1),O(),F(`prop`,e)(`store`,r.values)(`query`,r.propFilter())(`componentId`,n.id)(`pageId`,r.page()?.pageId??null)(`rpc`,r.rpc())(`writes`,r.canEdit())}}function jP(e,t){if(e&1&&(I(0,`ul`,84),N(1,AP,5,9,`li`,85,zN),L()),e&2){let e=W(2);O(),P(e.properties)}}function MP(e,t){e&1&&(I(0,`p`,67),K(1,`No other properties.`),L())}function NP(e,t){if(e&1&&(I(0,`div`,63)(1,`h3`),K(2,` Properties `),I(3,`span`,64),K(4),L()(),j(5,jP,3,0,`ul`,84)(6,MP,2,0,`p`,67),L()),e&2){let e=W();O(4),q(e.properties.length),O(),M(e.properties.length?5:6)}}function PP(e,t){if(e&1&&(I(0,`li`,66),K(1),L()),e&2){let e=t.$implicit;O(),q(e)}}function FP(e,t){if(e&1&&(I(0,`div`,63)(1,`h3`),K(2,` DOM listeners `),I(3,`span`,64),K(4),L()(),I(5,`ul`,65),N(6,PP,2,1,`li`,66,bg),L()()),e&2){let e=W(2);O(4),q(e.listeners.length),O(2),P(e.listeners)}}function IP(e,t){if(e&1&&(I(0,`li`,85)(1,`span`,86),K(2),L(),R(3,`app-value-tree`,93),L()),e&2){let e=t.$implicit,n=W(2).$implicit,r=W(2),i=W(3);O(2),q(e.name),O(),F(`prop`,e)(`store`,i.values)(`query`,i.propFilter())(`directive`,n.index)(`componentId`,r.id)(`pageId`,i.page()?.pageId??null)(`rpc`,i.rpc())}}function LP(e,t){if(e&1&&(I(0,`ul`,84),N(1,IP,4,8,`li`,85,zN),L()),e&2){let e=W().$implicit;O(),P(e.inputs)}}function RP(e,t){if(e&1&&(I(0,`li`,90)(1,`span`,79),K(2),L(),I(3,`span`,91),K(4),L()()),e&2){let e=t.$implicit;G(`on`,e.listened),O(2),q(e.name),O(2),q(e.listened?`listened`:`no listener`)}}function zP(e,t){if(e&1&&(I(0,`ul`,65),N(1,RP,5,4,`li`,89,zN),L()),e&2){let e=W().$implicit;O(),P(e.outputs)}}function BP(e,t){e&1&&(I(0,`p`,67),K(1,`No inputs or outputs.`),L())}function VP(e,t){if(e&1&&(I(0,`div`,63)(1,`h3`)(2,`span`,79),K(3),L(),I(4,`span`,92),K(5,`directive on host`),L()(),j(6,LP,3,0,`ul`,84),j(7,zP,3,0,`ul`,65),j(8,BP,2,0,`p`,67),L()),e&2){let e=t.$implicit;O(3),q(e.name),O(3),M(e.inputs.length?6:-1),O(),M(e.outputs.length?7:-1),O(),M(!e.inputs.length&&!e.outputs.length?8:-1)}}function HP(e,t){if(e&1&&(j(0,yP,7,1,`div`,83),j(1,wP,7,2,`div`,63),j(2,OP,7,2,`div`,63),j(3,NP,7,2,`div`,63),j(4,FP,8,1,`div`,63),N(5,VP,9,4,`div`,63,RN)),e&2){let e=t,n=W(),r=W(3);M(r.propQuery()&&!e.count?0:-1),O(),M(!r.propQuery()||e.inputs.length?1:-1),O(),M(!r.propQuery()||e.outputs.length?2:-1),O(),M(!r.propQuery()||e.properties.length?3:-1),O(),M(!r.propQuery()&&n.listeners.length?4:-1),O(),P(e.directives)}}function UP(e,t){if(e&1&&(I(0,`span`,92),K(1),L()),e&2){let e=t.$implicit;O(),q(e)}}function WP(e,t){if(e&1&&(I(0,`span`,96),K(1,`from `),I(2,`span`,79),K(3),L()()),e&2){let e=W().$implicit;O(3),q(e.providedByName??`an injector`)}}function GP(e,t){e&1&&(I(0,`span`,97),K(1,`not provided`),L())}function KP(e,t){if(e&1&&(I(0,`li`,94)(1,`span`,95),K(2),L(),N(3,UP,2,1,`span`,92,bg),j(5,WP,4,1,`span`,96)(6,GP,2,0,`span`,97),L()),e&2){let e=t.$implicit;O(2),q(e.token),O(),P(e.flags),O(2),M(e.providedBy?5:6)}}function qP(e,t){if(e&1&&(I(0,`ul`,82),N(1,KP,7,2,`li`,94,BN),L()),e&2){let e=W();O(),P(e.dependencies)}}function JP(e,t){e&1&&(I(0,`p`,67),K(1,`Nothing is injected through the constructor or inject().`),L())}function YP(e,t){if(e&1){let e=V();I(0,`dl`,78)(1,`dt`),K(2,`Change detection`),L(),I(3,`dd`),K(4),L(),I(5,`dt`),K(6,`Encapsulation`),L(),I(7,`dd`),K(8),L(),I(9,`dt`),K(10,`Host path`),L(),I(11,`dd`,79),K(12),L(),N(13,_P,4,2,null,null,FN),L(),I(15,`div`,80)(16,`div`,5),E(),I(17,`svg`,6),R(18,`circle`,7)(19,`path`,8),L(),Cs(),I(20,`input`,81,2),H(`input`,function(t){return w(e),T(W(3).propFilter.set(t.target.value))})(`keydown.escape`,function(t){return w(e),T(W(3).clearPropFilter(t))}),L()(),j(22,vP,2,2,`span`,11),I(23,`p`,20),K(24),L()(),j(25,HP,7,5),I(26,`div`,63)(27,`h3`),K(28,` Injected `),I(29,`span`,64),K(30),L()(),j(31,qP,3,0,`ul`,82)(32,JP,2,0,`p`,67),L()}if(e&2){let e,n=t,r=W(),i=W(2);O(4),q(n.changeDetection??`Unknown`),O(4),q(n.encapsulation??`Unknown`),O(4),q(n.path),O(),P(i.routedById().get(r.id)??rv(9,MN)),O(7),F(`value`,i.propFilter()),O(2),M(i.propQuery()?22:-1),O(2),q(i.propFilterStatus()),O(),M((e=i.shownValues())?25:-1,e),O(5),q(n.dependencies.length),O(),M(n.dependencies.length?31:32)}}function XP(e,t){e&1&&(I(0,`div`,72),R(1,`span`,98),I(2,`p`,43),K(3,`Reading live values from the page…`),L()())}function ZP(e,t){if(e&1&&(I(0,`section`,29)(1,`header`,59)(2,`span`,60),K(3,`component`),L(),I(4,`h2`,61),K(5),L(),I(6,`span`,62),K(7),L(),j(8,uP,2,2,`p`,69),j(9,dP,7,1),j(10,mP,1,1),j(11,hP,5,1,`div`,70),j(12,gP,1,6,`app-store-global`,71),L(),j(13,YP,33,10)(14,XP,4,0,`div`,72),L()),e&2){let e,n,r,i=t,a=W(2);O(5),q(i.name),O(2),J(`<`,i.tag,`>`),O(),M((e=a.whereOf(i))?8:-1,e),O(),M(a.devtoolsActions()?9:-1),O(),M((n=a.sourceFor(i))?10:-1,n),O(),M(a.canShowInjector()&&!a.staticReport()?11:-1),O(),M(!a.staticReport()&&!a.native()?12:-1),O(),M((r=a.detail())?13:14,r)}}function QP(e,t){e&1&&(I(0,`p`,42),K(1,`The selected component was destroyed`),L(),I(2,`p`,43)(3,`span`,79),K(4),L(),K(5,` is no longer on the page. Select another component to see its live values. `),L()),e&2&&(O(4),q(t))}function $P(e,t){e&1&&(I(0,`p`,43),K(1,` Select a component to see its live inputs, properties, outputs, change detection and injected services. `),L())}function eF(e,t){if(e&1&&(I(0,`div`,30),j(1,QP,6,1)(2,$P,2,0,`p`,43),L()),e&2){let e,t=W(2);O(),M((e=t.destroyed())?1:2,e)}}function tF(e,t){e&1&&(I(0,`span`,92),K(1,`hydrate never`),L())}function nF(e,t){if(e&1&&(I(0,`span`,92),K(1),L()),e&2){let e=W().$implicit;O(),q(e.hydration)}}function rF(e,t){if(e&1){let e=V();I(0,`li`)(1,`button`,101),H(`click`,function(){let t=w(e).$implicit;return T(W(3).showOwner(t))})(`focus`,function(){let t=w(e).$implicit;return T(W(3).highlightBlock(t))})(`blur`,function(){return w(e),T(W(3).highlight(null))})(`mouseenter`,function(){let t=w(e).$implicit;return T(W(3).highlightBlock(t))})(`mouseleave`,function(){return w(e),T(W(3).highlight(null))}),I(2,`span`,57),K(3),L(),I(4,`span`,102),K(5),L(),j(6,tF,2,0,`span`,92)(7,nF,2,1,`span`,92),I(8,`span`,103),K(9),L()()()}if(e&2){let e=t.$implicit;O(),A(`aria-disabled`,e.owner?null:`true`),O(2),q(e.owner?.name??`Unknown component`),O(),C_(`defer-state-`+e.state),O(),q(e.state),O(),M(e.hydrateNever?6:e.hydration===`not-configured`?-1:7),O(3),q(e.triggers.join(`, `)||`no triggers`)}}function iF(e,t){if(e&1&&(I(0,`section`,31)(1,`h2`,99),K(2,` Defer blocks `),I(3,`span`,64),K(4),L()(),I(5,`ul`,100),N(6,rF,10,7,`li`,null,VN),L()()),e&2){let e=W(2);O(4),q(e.deferCount()),O(2),P(e.deferBlocks())}}function aF(e,t){e&1&&R(0,`app-angular-unavailable`,32),e&2&&F(`page`,W(2).angularPage())}function oF(e,t){if(e&1){let e=V();I(0,`app-hydration-section`,104),H(`overlay`,function(t){return w(e),T(W(2).setHydrationOverlay(t))})(`showNode`,function(t){return w(e),T(W(2).revealNode(t))})(`highlight`,function(t){return w(e),T(W(2).highlight(t))}),L()}e&2&&F(`report`,W(2).page()?.hydration)}function sF(e,t){if(e&1){let e=V();I(0,`app-cd-recording`,105),H(`showComponent`,function(t){return w(e),T(W(2).showCdComponent(t))}),L(),I(1,`app-leaks-section`,106),H(`showComponent`,function(t){return w(e),T(W(2).showLeakComponent(t))})(`highlight`,function(t){return w(e),T(W(2).highlight(t))}),L()}if(e&2){let e=W(2);F(`page`,e.cdPage())(`pageId`,e.page().pageId)(`rpc`,e.rpc())(`native`,e.native()),O(),F(`report`,e.leaksPage())(`pageId`,e.page().pageId)(`rpc`,e.rpc())(`angular`,e.angularPage())}}function cF(e,t){if(e&1){let e=V();I(0,`p`,3),K(1,` Every component instance on the page, in the order Angular rendered them. Hover a row to highlight its host in the page, and select it to read its live inputs, properties, outputs and injected services. `),L(),I(2,`div`,4)(3,`div`,5),E(),I(4,`svg`,6),R(5,`circle`,7)(6,`path`,8),L(),Cs(),I(7,`input`,9,0),H(`input`,function(t){return w(e),T(W().setFilter(t.target.value))})(`keydown.escape`,function(){return w(e),T(W().setFilter(``))}),L(),I(9,`span`,10),K(10,` Type plain text, a tag such as