@aiquants/console-ui 0.6.5 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,6 +6,7 @@ Host-agnostic UI foundation for React admin consoles: design tokens computed fro
6
6
 
7
7
  - Node.js >= 18.0.0
8
8
  - React >= 19.0.0 and React DOM >= 19.0.0 (peer dependencies; the layout components emit hoisted `<style href precedence>` elements)
9
+ - `@aiquants/auth-core` >= 0.8.0 (peer dependency): the root's presenter of access failures is its `AccessFailurePresenter`, `AccessFailureNotice` draws its `AccessFailureView`, and `accessFailureKindOfStatus` decides which failures are access failures, so the host and the package share one copy of the module
9
10
 
10
11
  ## Installation
11
12
 
@@ -19,7 +20,7 @@ pnpm add @aiquants/console-ui
19
20
  | --- | --- |
20
21
  | `@aiquants/console-ui` | Components and hooks; re-exports everything from `@aiquants/console-ui/core`. |
21
22
  | `@aiquants/console-ui/core` | React-free: the tokens with the geometry of their formulas and the contrast computation, the tone table and the CSS text of a colour of both schemes, the layout arithmetic and the figure formulas, number, zoned-time and instant formatting, the reading of a number field's text, the rule of a text with nothing to read, the label catalogs, the read contract with its keep-last-good machine, and the keyset paging machine (listed below). Server-side loaders and hosts import from here without loading React. |
22
- | `@aiquants/console-ui/testing` | DOM-only: `scanColourRoles(root, { exclude })`, the colour-role scan a console runs on its own rendered DOM, text (the markers of a `List` included) and SVG graphics alike (see Tokens and colours), and the model of the modal dialog methods a test DOM lacks, `installDialogModel()` with `openModals()` and `pressEscape(dialog)` (see Testing in jsdom). It takes elements and loads no React. |
23
+ | `@aiquants/console-ui/testing` | DOM-only: `scanColourRoles(root, { exclude })`, the colour-role scan a console runs on its own rendered DOM, text (the markers of a `List` included) and SVG graphics alike (see Tokens and colours), and the model of the modal dialog methods a test DOM lacks, `installDialogModel()` with `openModals()`, `pressEscape(dialog)` and `sendCloseRequest(dialog)` (see Testing in jsdom). It takes elements and loads no React. |
23
24
  | `@aiquants/console-ui/styles/console-ui.css` | The stylesheet: the token variables on `[data-cui-root]` and the component rules, all inside `@layer cui`. |
24
25
 
25
26
  The `/core` exports:
@@ -41,7 +42,7 @@ The `/core` exports:
41
42
  - Text with nothing to read: `isReadableText(text)` is `true` when the text holds at least one character outside Unicode's white space (`White_Space`), control (`Cc`) and format (`Cf`) characters and default-ignorable code points (`Default_Ignorable_Code_Point`): the empty string, and a text of only spaces, line breaks, U+3000, U+FEFF, U+200B, the separators U+001C–U+001F, U+0085, U+00AD, the Hangul fillers or variation selectors, is not readable.
42
43
  It covers the white space of both JavaScript (`\s`) and Python (`\s`), so a record written in either language that reads as blank in it is not readable here either.
43
44
  It is the one rule of a blank text: `Measured` refuses a `text` or `unit` it rejects, and a host decides with it whether a text is worth drawing at all.
44
- - Labels: `CONSOLE_UI_LABEL_CATALOGS`, `resolveConsoleUiLabels` (a UI language's catalog, whose `loadFailed`, `refreshFailed` and `forbiddenBecause` build the failure sentences and whose `failureSentence` is the one rule that chooses between them), `reasonAside` (a failure's reason as a parenthetical).
45
+ - Labels: `CONSOLE_UI_LABEL_CATALOGS`, `resolveConsoleUiLabels` (a UI language's catalog, whose `loadFailed` and `refreshFailed` build the sentences of failures that are not access failures, whose `failureSentence` is the one rule of those sentences (it throws for a 401 or a 403, which the root's presenter states), and whose `forbiddenBecause` builds the denied sentence a 403 hands to the presenter), `reasonAside` (a failure's reason as a parenthetical). The catalogs hold no text of an access failure: the host's presenter takes those from its own catalog (`resolveAccessFailureLabels` of `@aiquants/auth-core`).
45
46
  - Label templates: `fillLabel(template, values)` is the one filler of a label that carries a value (a count, a name) as a `{key}` placeholder (a key is ASCII letters, digits and `_`), so the label's language, not the code that draws it, decides where the value stands; a label that crosses a loader as a plain string carries its values this way.
46
47
  It scans the template once and writes every value as plain text: a `{key}` inside a value is not filled again, and `$&`, `$1` or `` $` `` in a value are not replacement patterns, so a name a user controls cannot pull another value in or forge another sentence.
47
48
  A placeholder whose key `values` does not own (an inherited key such as `{constructor}` included) stays as written, so a forgotten value shows instead of leaving a sentence with a word missing. A number is written with `String`: format a count with `formatCount` first when it should follow a locale.
@@ -98,25 +99,45 @@ Bind the variables to faces the models fit; with the generic fallback or while a
98
99
  ### Wrapping a console
99
100
 
100
101
  ```tsx
101
- import { Card, ConsoleUiRoot, Measured } from "@aiquants/console-ui"
102
-
103
- export const Console = ({ orphanCount }: { orphanCount: number | null }) => (
104
- <ConsoleUiRoot locale="ja" formatLocale="ja-JP" timeZone="Asia/Tokyo" testId="console">
105
- <Card title="Tri-Store データ整合性監査" testId="audit">
106
- <Measured value={orphanCount} unit="件" testId="orphans" />
107
- </Card>
108
- </ConsoleUiRoot>
109
- )
102
+ import { type AccessFailurePresenter, accessFailureView, resolveAccessFailureLabels } from "@aiquants/auth-core"
103
+ import { AccessFailureNotice, Card, ConsoleUiRoot, Measured } from "@aiquants/console-ui"
104
+ import { type ReactNode, useCallback } from "react"
105
+
106
+ const ACCESS_FAILURE_LABELS = resolveAccessFailureLabels("ja")
107
+
108
+ export const Console = ({ orphanCount, openSignIn }: { orphanCount: number | null; openSignIn: () => void }) => {
109
+ const accessFailure = useCallback<AccessFailurePresenter<ReactNode>>(
110
+ (occurrence) => (
111
+ <AccessFailureNotice
112
+ view={accessFailureView(occurrence, { keepsWork: true }, ACCESS_FAILURE_LABELS)}
113
+ handlers={{ "sign-in-again-in-new-window": openSignIn, ...(occurrence.retry === null ? {} : { retry: occurrence.retry }) }}
114
+ testId="access-failure"
115
+ />
116
+ ),
117
+ [openSignIn],
118
+ )
119
+ return (
120
+ <ConsoleUiRoot locale="ja" formatLocale="ja-JP" timeZone="Asia/Tokyo" accessFailure={accessFailure} testId="console">
121
+ <Card title="Tri-Store データ整合性監査" testId="audit">
122
+ <Measured value={orphanCount} unit="件" testId="orphans" />
123
+ </Card>
124
+ </ConsoleUiRoot>
125
+ )
126
+ }
110
127
  ```
111
128
 
112
129
  `ConsoleUiRoot` has no default language (`locale` is `"en"` or `"ja"`; anything else throws), validates `formatLocale` as a BCP 47 tag and `timeZone` as an IANA time zone `Intl` knows (both reach the context in canonical form), and has no default for either.
130
+ `accessFailure` is the host's presenter of access failures (`AccessFailurePresenter<ReactNode>` of `@aiquants/auth-core`), and it has no default either: a value that is not a function throws `TypeError` when the root renders, not at the first 401 or 403.
131
+ Every 401 and 403 the console shows goes through it, as one occurrence (`{ kind, place, deniedSentence, retry }`: `unauthenticated` or `forbidden`, `read` or `write`, the denied sentence of a 403 or `null`, and the retry or `null`), and the node it returns is drawn in place of a failure sentence (`FailureMessage`, `ResourceFailed`; a component of the host's own reaches it with `useAccessFailure()`).
132
+ So the host decides once, for the whole console, the texts (its own catalog, `resolveAccessFailureLabels` of `@aiquants/auth-core`), whether work in progress survives signing in again (`keepsWork`: in a new window, the screen stays as it is) and where each action leads; drawing it with `AccessFailureNotice` keeps the console's look, and the presenter passes a handler for every action the view can show at the places the console uses (a missing one throws `TypeError`).
133
+ Pass a presenter with one identity (`useCallback`, or a module constant): a new function on every render changes the root's context and re-renders every component that reads it.
113
134
  A console shows every instant with `formatInstant(iso, formatLocale, timeZone)` from the values `useConsoleUi()` returns, so every panel names the same instant with the same string and a page rendered on the server hydrates without a mismatch (the ambient time zone differs between the server and the browser).
114
135
  A console has exactly one root: a `ConsoleUiRoot` rendered inside another one throws, because a second root would add a second live region and a second token scope and could switch the language partway through the console. A view that is also used inside a console built on the package therefore takes the root from its host instead of wrapping itself in one.
115
136
 
116
137
  The root sets no font property: host content inside the root keeps its own font family, size, weight and line height, and inherits only the root's text colour (the `fg` role) and the `--cui-*` variables, drawn over the root's `surface` background. The package's body type (13/20) and sans face are declared by `Card` for what is drawn in it.
117
138
  The root declares no `color-scheme` either: every colour is a `light-dark()` pair, so the palette follows the scheme the root inherits. A host with its own light and dark modes binds them to `color-scheme` (`html { color-scheme: light; }` and `html.dark { color-scheme: dark; }`), so the console and the host never show different schemes; `color-scheme: light dark` on `:root` would follow the operating system instead and can disagree with the host's own switch.
118
139
 
119
- Every component that renders an element throws outside the root, because the token variables and the colour roles are scoped to the root's DOM and would not reach it; the hooks `useFocusRescue`, `useEscapeToClose`, `useResource` and `usePagedResource` do not need the root. For the same reason an overlay must render inside the root's DOM, not in a portal to `<body>`: a portal keeps the React context but loses every `--cui-*` variable.
140
+ Every component that renders an element throws outside the root, because the token variables and the colour roles are scoped to the root's DOM and would not reach it; the hooks `useFocusRescue`, `useEscapeToClose`, `useFailureOccurrence`, `useResource` and `usePagedResource` do not need the root. For the same reason an overlay must render inside the root's DOM, not in a portal to `<body>`: a portal keeps the React context but loses every `--cui-*` variable.
120
141
  Draw a modal as a `Dialog`: a modal `<dialog>` (`showModal()`) makes everything outside it inert, the live region of every root included, so `Dialog` holds a live region of its own, which takes the announcements of every console on the page while it is the topmost open modal (see Focus and announcements).
121
142
  Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a popover placed in the tree. A modal that is not a `Dialog` and does not contain the console, or a host's `inert` or `aria-hidden="true"` on the console, hides the announcer: a write to it then throws instead of being dropped; announce after that modal closes.
122
143
 
@@ -173,8 +194,9 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
173
194
  `tableMinInlinePx(columns) + 2 × 4`, the scroll frame's padding that keeps the cells' focus rings inside. A header or sample with nothing to read (`isReadableText`), an empty list of samples and a cluster without items throw `RangeError`, since a width measured from them is too narrow for what they stand for. The package's tests rebuild every one of these widths from the declarations the stylesheet applies to the rendered parts, so a rule that changes without the helpers fails there.
174
195
  - `MasterDetail` goes side by side when both minimums and the 24 px gap fit, the master preferring the 1 : φ share while neither pane goes below its minimum: master = min(max(masterMin, (c − 24) / (1 + φ)), c − 24 − detailMin), and the detail takes the rest. The upper clamp matters only when detailMin > φ × masterMin (a narrow list beside a wide detail).
175
196
  - Every rule that draws caller text wraps anywhere; nothing is cut with an ellipsis. A `Pill` keeps its text width + 16 px and wraps inside itself only when its text is longer than the column was sized for, instead of spilling into the next column. A `Measured` text kept whole (`keep="whole"`) is the same inline-block: it moves to the next line whole and wraps inside only when longer than its column.
176
- - Every paragraph the package draws carries the reading measure (`data-cui-measure="reading"`): its lines are at most 40ic long (40 ideographs, WCAG 1.4.8) however wide its container is. The paragraphs are `Text as="p"` (and with it the empty text of `DataTable` and `SelectableList`, a field's description, error and drawn reason, `LoadMore`'s end text and `ProgressBar`'s label and value), a `Card`'s description, a `CardSection`'s subtitle, `Notice`, `AlertMessage` (and with it the failures of `ResourceFailed` and `LoadMore`) and a `MetricTile`'s label, sublabel and value.
177
- A plain paragraph is at most `40ic` wide; a padded paragraph box (`Notice`, `AlertMessage`) is `box-sizing: border-box` and at most `calc(40ic + 2 * var(--cui-space-3))`, its inline padding on both sides, so its text lines are 40ic too. Headings, table cells and the stacked `ComparisonGrid`'s column headings (a `div` underlined across the column) are not paragraphs and keep their container's width; `Dialog` is at most 40ic plus its padding wide on its own. A host paragraph inside the root takes the measure by being a `Text as="p"`.
197
+ - Every paragraph the package draws carries the reading measure (`data-cui-measure="reading"`): its lines are at most 40ic long (40 ideographs, WCAG 1.4.8) however wide its container is.
198
+ The paragraphs are `Text as="p"` (and with it the empty text of `DataTable` and `SelectableList`, a field's description, error and drawn reason, `LoadMore`'s end text and `ProgressBar`'s label and value), a `Card`'s description, a `CardSection`'s subtitle, `Notice`, `AlertMessage` (and with it the failures of `ResourceFailed` and `LoadMore`), the tint of `AccessFailureNotice` with its title and its sentences, and a `MetricTile`'s label, sublabel and value.
199
+ A plain paragraph is at most `40ic` wide; a padded paragraph box (`Notice`, `AlertMessage`, the tint of `AccessFailureNotice`) is `box-sizing: border-box` and at most `calc(40ic + 2 * var(--cui-space-3))`, its inline padding on both sides, so its text lines are 40ic too. Headings, table cells and the stacked `ComparisonGrid`'s column headings (a `div` underlined across the column) are not paragraphs and keep their container's width; `Dialog` is at most 40ic plus its padding wide on its own. A host paragraph inside the root takes the measure by being a `Text as="p"`.
178
200
  - Every `Text` keeps its own type step's line wherever it is placed (no rule forces a line height), and every line is a multiple of 4, so a cell, a list row or a stack mixing steps stays on the lattice: an outcome over its muted `caption` reason paragraph in a table cell is 12 + 20 + 20 + 11 + 1 = 64 px.
179
201
  An inline `Text` that names a face (`face`) is aligned to the top of its line box (`vertical-align: top`, as a `span` `Cluster` is): two faces with different ascent and descent ratios, each in an inline box as high as its line, set on one baseline make the line taller than either box (a mono `body` text in a sans cell would make a 28 px `row-compact` row 30 px), while a box aligned to the top shares no baseline and never reaches beyond the taller of the two lines, both multiples of 4.
180
202
  Its baseline may sit about 1 px off the line's own; the line stays on the lattice, and its height is still the type step's. A block `Text` (`as="p"`, `as="div"`) is a line box of its own, to which `vertical-align` does not apply. An inline `Text` without a face, of a larger step than the line it sits on, stretches that line off the lattice by the difference of the faces' metrics; give it a block of its own (`as="p"`).
@@ -272,6 +294,9 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
272
294
  An `initialFocus` that holds no element or one outside the dialog throws `RangeError` before the dialog opens; one that does not take focus (a `disabled` field, a `div` without `tabindex`) closes the dialog again and throws `RangeError`. `onClose` is called when the operator closes it (the close button or Escape), not when the caller sets `open` to `false`.
273
295
  A `close` event that arrives while it is open again (it closed and reopened in one task, as `StrictMode` does to a dialog mounted open) is not the operator's, so it moves no focus and calls no `onClose`.
274
296
  Escape does not close it while an IME composes (a keydown with `isComposing` or the keyCode 229, read in the capture phase so a control inside that stops the keydown cannot hide it; the Escape cancels the composition), nor while focus is in a text field holding a value, as `useEscapeToClose`.
297
+ In a field holding a value the dialog cancels the Escape's keydown in the capture phase (without stopping it, so a control inside, such as a list that closes on Escape, still gets it), so the browser makes no close request and the dialog stays open however often Escape is pressed.
298
+ A `search` field holding a value is left to the browser: Chromium and Firefox clear the value as the keydown's default action and make no close request, so the next Escape closes the dialog.
299
+ A composing Escape, a close request that comes from no key (a phone's back gesture) and the close request of a browser that keeps a `search` field's value on Escape are refused at `cancel`: once a page has refused a close request, a browser that follows the HTML rule lets it refuse the next one only after the operator has interacted with the page (an Escape does not count), so there a second such request in a row closes the dialog.
275
300
  - A pressed `Button` (busy and unavailable ones included) or `RowButton` takes focus before its `onClick` or `onSelect` runs, without scrolling, when it does not have it: WebKit (Safari on iOS and macOS) and Firefox on macOS do not focus a button on a pointer press, so the element that had focus before the press would keep it, and a `Dialog` the press opens would return focus there when it closes. A keyboard press, which comes from the focused button, moves no focus. After a pointer press the browser draws no `:focus-visible` ring.
276
301
  - The root owns the one announcer: `useAnnounce()` returns `announce(text)`. It writes to the root's polite live region or, while a `Dialog` (of this console or of another console on the page) is the topmost open modal, to that dialog's own polite region (which the modal leaves reachable while it hides every root's).
277
302
  Calls are coalesced over a quiet window: every call restarts a timer of `ANNOUNCE_SETTLE_MS` (150 ms), and when it passes without a call (or 1 s after the first pending call, so a stream of calls cannot hold the write back) the pending sentences are written to the region once, as one string in call order.
@@ -279,6 +304,7 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
279
304
  The merge is by time, not by cause: calls less than 150 ms apart are one write unless the 1 s deadline of the pending write falls between them. The calls of one commit or one action are therefore one write when they come within the window and before that deadline; a handler that awaits longer than the window between two calls, or a commit whose passive effects run after the deadline, gives two writes. Any two writes are at least 150 ms apart, so no sentence is replaced before it is exposed.
280
305
  A `Dialog`'s region also takes the writes of the other consoles on the page, which are not spaced against each other, so a write there carries along, before its own sentence, every sentence other consoles wrote there less than 150 ms before: none is replaced before it is exposed, and one carried along may be read twice.
281
306
  The same sentence announced again later is read again. `announce` throws `RangeError` for an empty or blank sentence (a missing label or outcome text), which would otherwise clear the region or pad the merged string. `AlertMessage` (`role="alert"`, keyed by the failure's `occurrence`) is used for failures only; `Notice` has no live-region role.
307
+ `AccessFailureNotice` is read once per mount by its view's politeness: `alert` (the outcome of the operator's own navigation or write) makes its tint `role="alert"`; `status` (a read that arrives without the operator's action) gives the tint no role and writes its title and sentences through `announce`, because a polite live region inserted together with its content is not read reliably. A re-render with the same view reads nothing, and neither does the second mount `StrictMode` simulates; it never moves focus.
282
308
  A live region hidden from assistive technology drops every sentence without an error, so the write throws `Error` (from the timer, as an uncaught error that names the lost sentences) when, at that moment, the console is rendered but no region it writes to reaches assistive technology:
283
309
  an ancestor of the announcer is `inert` or `aria-hidden="true"` (in any letter case, as ARIA reads the value), or the topmost open modal `<dialog>` neither contains the console nor is a `Dialog` (everything outside the topmost modal is inert, lower modal dialogs included), or it is a `Dialog` whose region such an ancestor hides.
284
310
  The DOM does not expose which open modal is topmost, so it is told from focus, which inert content cannot hold: the candidates are the open modal dialogs that contain the focused element, or all of them while focus is in none.
@@ -295,21 +321,31 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
295
321
 
296
322
  - A host read resolves to `ResourceOutcome<T>` (`{ok: true, value}` or `{ok: false, status, reason}`) and takes an `AbortSignal` as its last argument.
297
323
  The status and the `reason`, of a command's outcome as well, carry different facts.
298
- A refusal is the status's to state (`HTTP_FORBIDDEN`), and every sentence that shows a failure states it through one rule, `labels.failureSentence(failure, refusal, failed)` (`labels` from `useConsoleUi()`, or `resolveConsoleUiLabels(locale)` outside React):
299
- a 403 is `forbiddenBecause(refusal, reason)`, the caller's own fixed refusal followed by the declared cause, and any other status, or `null` for no response, is `failed(reason)`, the caller's own failed sentence of the reason (the catalog's `loadFailed` and `refreshFailed` fit as `failed`; a screen's own sentence places the reason with `reasonAside`).
300
- `failed` is never called for a 403, so no sentence shows a refusal without stating it.
301
- `ResourceFailed` builds its sentence with it from its `forbiddenMessage`, and so does a screen whose own sentence shows a failure (its own re-read, a command):
302
-
303
- ```ts
304
- const sentence = labels.failureSentence(outcome, "最新の内容の読み込みは拒まれました。", (reason) => `最新の内容を読み込めませんでした${reasonAside(reason)}。`)
305
- // 403 and "" → 最新の内容の読み込みは拒まれました。
306
- // 403 and "閲覧の権限に行のスコープが設定されています" → 最新の内容の読み込みは拒まれました。閲覧の権限に行のスコープが設定されています。
307
- // 503 and "HTTP 503" → 最新の内容を読み込めませんでした (HTTP 503)。
324
+ An access failure is the status's to state: a 401 (`unauthenticated`) or a 403 (`forbidden`, `HTTP_FORBIDDEN`), as `accessFailureKindOfStatus(status)` of `@aiquants/auth-core` reads it, is drawn by the root's presenter (`accessFailure`, see Wrapping a console), never as a failed sentence.
325
+ `FailureMessage` is the one way to draw a failure, the one rule that branches on the status: an access failure is handed to the presenter as one occurrence of the caller's `place` (`read`, a read that arrives without the operator's action, or `write`, the outcome of the operator's command) with the caller's `retry` (or `null` when it cannot be retried) and, for a 403, the denied sentence `forbiddenBecause(deniedSentence, reason)`.
326
+ That sentence is the caller's own fixed denied sentence, ending with the UI language's full stop, followed by the declared cause, and the node the presenter returns is drawn as it is.
327
+ Any other status, or `null` for no response (a network failure is no access failure), is `labels.failureSentence(failure, failed)` in an `AlertMessage`: `failed(reason)`, the caller's own failed sentence of the reason (the catalog's `loadFailed` and `refreshFailed` fit as `failed`; a screen's own sentence places the reason with `reasonAside`; `labels` from `useConsoleUi()`, or `resolveConsoleUiLabels(locale)` outside React).
328
+ `failureSentence` throws `RangeError` for a 401 or a 403, so no failed sentence shows an access failure as a failed read; a sentence the host draws elsewhere (an announcement, a field's error) hands those to the presenter first (`useAccessFailure()`).
329
+ `ResourceFailed` draws its failure with `FailureMessage` (`read`), and so does a screen whose own sentence shows a failure (its own re-read, a command):
330
+
331
+ ```tsx
332
+ <FailureMessage failure={saveFailure} place="write" deniedSentence="この規程を変更する権限がありません。" failed={(reason) => `規程を保存できませんでした${reasonAside(reason)}。`} retry={save} testId="save-failure" />
333
+ // 403 and "" → the presenter's notice, with the denied sentence この規程を変更する権限がありません。
334
+ // 403 and "編集の権限に行のスコープが設定されています" → … この規程を変更する権限がありません。編集の権限に行のスコープが設定されています。
335
+ // 401 → the presenter's notice of signing in again, with save as its retry
336
+ // 503 and "HTTP 503" → 規程を保存できませんでした (HTTP 503)。 in an AlertMessage
308
337
  ```
309
338
 
310
- `reason` is a phrase without a closing full stop, because the sentence that shows it ends it. A 403's `reason` names only the cause the route declared (which permission or scope to fix) and states no refusal, not even as a consequence of the cause (`閲覧の権限に列のスコープが設定されています`, not `…ため、閲覧できません`), and is `""` when the route declared none, since a phrase the host makes up there (the status, "refused") only repeats the status the failure already carries; only a 403's `reason` can be `""`.
339
+ `failure` carries its `occurrence`, a number that advances with every failure shown (a `ResourceFailure` carries it; a screen counts its own command's failures), and both the presenter's node and the `AlertMessage` are keyed by it, so the same failure again is mounted and read again.
340
+ `useFailureOccurrence(failure)` counts the failures of a component that holds failure objects of its own (a loader's failure, the refusal a command answered, a failure in its own state): the number is `0` before any failure, advances in the render that brings a failure object other than the last one counted, compared by identity, so the same contents in a new object are the next failure (and so is an object counted before the last one), and stays while that object is re-rendered.
341
+ `null` (no failure) counts nothing and keeps the last number and the last object, so the last object handed again after `null` is the same failure.
342
+ The number advances before the commit, so no commit shows a new failure under the old number, and StrictMode's second render counts nothing more. The host hands a new object for each failure and the same object while it holds that failure, and the number keys what the component draws itself for the failure: the `occurrence` of a failure it hands `FailureMessage`, an `AlertMessage`, or an element around the presenter's node.
343
+ A notice can hold buttons, so a screen that keeps a failure on screen through a retry attaches its `useFocusRescue` ref to an element keyed by the same occurrence around it, as `ResourceFailed` does (below).
344
+ A blank `deniedSentence` throws `RangeError` whatever the status, so a forgotten sentence fails at the first render instead of at the first 403.
345
+
346
+ `reason` is a phrase without a closing full stop, because the sentence that shows it ends it. A 403's `reason` names only the cause the route declared (which permission or scope to fix) and states no refusal, not even as a consequence of the cause (`閲覧の権限に列のスコープが設定されています`, not `…ため、閲覧できません`), and is `""` when the route declared none, since a phrase the host makes up there (the status, "refused") only repeats the status the failure already carries; only a 403's `reason` can be `""`. A 401's `reason` is never shown: the presenter states that the session ended.
311
347
  `""` means that no cause was declared, and every sentence built from a `reason` leaves it out, the package's and a screen's alike: `loadFailed("")` is `読み込めませんでした。`, and a screen that places a `reason` in parentheses in its own sentence does so with `reasonAside(reason)` (a space and the reason in parentheses, or `""` for `""`).
312
- A sentence that does not branch on the status (`loadFailed`, `refreshFailed`) then says only that the read failed. `PageFailure` carries no status, so a host whose later page can be refused routes that 403 to a read that carries it: a re-read of the first page, whose 403 withdraws the shown list (`keepLastGood`, below) for `ResourceFailed` to state as above.
348
+ A sentence that does not branch on the status (`loadFailed`, `refreshFailed`) then says only that the read failed. `PageFailure` carries no status, so a host whose later page can fail with an access failure routes it to a read that carries the status: a re-read of the first page, whose 403 withdraws the shown list (`keepLastGood`, below) for `ResourceFailed` to state as above, and whose 401 keeps the shown list and raises `refreshFailure`, as any other failed re-read does.
313
349
  Adapt a host read to the shape a hook reads with `mapOutcome(outcome, map)`, which maps a success's value and passes a failure through as the same object (its `status` and `reason`, so a 403 stays a 403 for `ResourceFailed`).
314
350
  When a host success is not always a success of that shape (a later page the host answers as not measured, which the list shows as a failed page), use `flatMapOutcome(outcome, map)`: `map` returns an outcome, a success or a failure, and a failure of the host read still passes through as the same object without calling `map`.
315
351
  - A command the host can refuse with a structured body (a code, the current row of a stale command, field errors) resolves to `CommandOutcome<T, R>`: `{ok: true, value}` or `{ok: false, status, reason, rejection}`, where `rejection` is the refusal body the host parsed with its own schema (`R`), and `null` when there was no response or the body was not one the schema reads (a network failure, a status the command does not declare, an unreadable body).
@@ -317,7 +353,7 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
317
353
  - `key` holds every input that selects the target or the list. Encode several inputs injectively with `JSON.stringify([...inputs])` (for a findings list, the run and the cell: `JSON.stringify([runUid, store, scopeKey, itemClass])`): joining free text with a separator is not injective (category `A` with query `x|y` and category `A|x` with query `y` give the same `A|x|y`).
318
354
  The read functions are read through a ref, so changing them alone never re-reads, and a key that leaves out a selecting input, or encodes two inputs to the same key, keeps showing the first target's data without an error.
319
355
  - `useResource(key, load, revision)` is `idle` for a `null` key, starts a new key from `loading`, re-reads the same key on a `revision` change, `refresh()` or `reload()` while keeping the shown value (`beginReload`, `keepLastGood`), aborts the read in flight on every re-read and discards its answer. A failure stays on screen while it is re-read; only a `reload()` marks it `retrying` (its reload button busy), a `revision` or `refresh()` re-read leaves it as it is. A rejection that is not the abort of a superseded read is rethrown to the nearest error boundary.
320
- A failed re-read keeps the shown value and raises `refreshFailure`, all but a 403: the operator may no longer read the value, so `keepLastGood` withdraws it and the resource is `failed` with `occurrence` 1, exactly as a first read answered 403 is (`ResourceFailed` then states the refusal and its cause, with no reload).
356
+ A failed re-read keeps the shown value and raises `refreshFailure`, all but a 403: the operator may no longer read the value, so `keepLastGood` withdraws it and the resource is `failed` with `occurrence` 1, exactly as a first read answered 403 is (`ResourceFailed` then hands it to the presenter with the denied sentence and its cause, with no reload).
321
357
  A 403 failure then stays as it is, its reason and its `occurrence` included, through every later answer that carries no value (another failure such as a 503, a re-read in flight, another 403): none of them says anything about the permission the 403 revoked, so the refusal is announced once and no later failure brings the value back. Only a value read again for the key (a read's success, or `put`) or another key ends it.
322
358
  `reload()` is the operator's re-read (the `Reload` button of `ResourceFailed`); `refresh()` is the screen's own re-read of the same target, the same as a `revision` change, for a re-read a screen starts after a command (a count after a decision) without a prop of its host's.
323
359
  `put(key, value)` shows the value a write's reply carries (the decided detail, or the current detail a 409 returns) as the success of a read, only while `key` is still the shown key (pass the key the command started on); a read of that key in flight is aborted and started again, because its answer may predate the write.
@@ -345,15 +381,16 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
345
381
  }))
346
382
  ```
347
383
 
348
- - `ResourceFailed` is the one way to draw a failed read: `labels.failureSentence(failure, forbiddenMessage, failed)` in an `AlertMessage`, where `failed` is `loadFailed` or the section's own sentence (`failureMessage`), and a `Reload` button that stays busy while re-reading.
349
- A 403, a first read's or a re-read's that withdrew the shown value, draws no reload, and `labels.forbiddenBecause(forbiddenMessage, reason)`: the caller's fixed message, a complete sentence ending with the UI language's full stop (`。` or `.`), followed by the declared cause as a second sentence (`閲覧する権限がありません。` and `ファイルの閲覧権限に列のスコープが設定されています` give `閲覧する権限がありません。ファイルの閲覧権限に列のスコープが設定されています。`; English adds `Reason: <reason>.`). A 403 never reaches the section's own sentence (`failureMessage`).
350
- The caller's `useFocusRescue` ref (`rescueRef`) is attached to the `Reload` button, so focus on it moves to the section heading both when the reload succeeds (the block goes) and when it comes back 403 (the button goes).
384
+ - `ResourceFailed` is the one way to draw a failed read, built on `FailureMessage` (`read`): a failure that is not an access failure is `labels.failureSentence(failure, failed)` in an `AlertMessage`, where `failed` is `loadFailed` or the section's own sentence (`failureMessage`), and a `Reload` button that stays busy while re-reading.
385
+ An access failure draws no reload: it is the presenter's notice. A 403, a first read's or a re-read's that withdrew the shown value, hands the presenter `labels.forbiddenBecause(deniedSentence, reason)`: the caller's fixed denied sentence, a complete sentence ending with the UI language's full stop (`。` or `.`), followed by the declared cause as a second sentence (`閲覧する権限がありません。` and `ファイルの閲覧権限に列のスコープが設定されています` give `閲覧する権限がありません。ファイルの閲覧権限に列のスコープが設定されています。`; English adds `Reason: <reason>.`).
386
+ A 401 hands it `onReload` as the retry after signing in again (the presenter's own action, a `retry` button of `AccessFailureNotice`). An access failure never reaches the section's own sentence (`failureMessage`).
387
+ The caller's `useFocusRescue` ref (`rescueRef`) is attached to the element that leaves, so focus on it moves to the section heading instead of falling to `<body>`: to the `Reload` button of a failure that is not an access failure, which goes when the reload succeeds (the block goes) or comes back with an access failure (the button goes), and to the block around the presenter's notice for an access failure, keyed by the failure's `occurrence`, which goes when the retry succeeds and is replaced when the failure occurs again.
351
388
 
352
389
  ## Components
353
390
 
354
391
  | Component / hook | Contract |
355
392
  | --- | --- |
356
- | `ConsoleUiRoot`, `useConsoleUi`, `useAnnounce`, `ANNOUNCE_SETTLE_MS` | Root, token scope, language, format locale, time zone, announcer and its quiet window. |
393
+ | `ConsoleUiRoot`, `useConsoleUi`, `useAnnounce`, `ANNOUNCE_SETTLE_MS`, `useAccessFailure` | Root, token scope, language, format locale, time zone, announcer and its quiet window, and the host's presenter of access failures (`accessFailure`; `useAccessFailure()` returns it, see Wrapping a console). |
357
394
  | `Text`, `VisuallyHidden` | Text in a role, a type step and optionally a face (`face="mono"` for identifiers; an inline text that names a face is aligned to the top of its line, so the line stays on the lattice, see Layout); `space="preserve"` keeps the spaces and line breaks as written (`white-space: pre-wrap`, `data-cui-space="preserve"`) for a multi-line value such as a JSON document in a table cell or a line of a diff, whose kept lines still wrap at the column (unlike `CodeBlock`, no scroll frame and no focus stop); a paragraph (`as="p"`) carries the reading measure. Text read by assistive technology but not drawn. |
358
395
  | `Card`, `CardSection` | `h2` card (a named region that draws its content in the body type and the sans face) and flat `h3` section (a landmark only with `region`, for a non-modal region such as an inspector; `level={4}` draws an `h4` in the same step and weight for a section inside a section, so the outline does not skip a level); `headingRef` makes the heading a programmatic focus target (`tabIndex={-1}`). `onEscape` closes a card or a region section on Escape (only a region takes it; see Focus and announcements). A card or section that another control expands takes that control's `aria-controls` target as its `id` (the detail of a `SelectableList` is `<CardSection id={detailId} …>`), so the reference resolves. |
359
396
  | `Stack`, `Cluster` | Vertical and wrapping horizontal layout with a spacing token; `Cluster as="span"` is the phrasing form a control's content may hold (an inline-flex `span`, same gap tokens). |
@@ -361,6 +398,8 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
361
398
  | `Button`, `Link`, `FragmentLink` | Buttons that keep focus when they cannot act (a pressed `Button` takes focus; see Focus and announcements); an in-document move drawn as a link (no `href`); a real link to a place in the same document (`href="#<targetId>"`, drawn like `Link`, with an optional `onFollow` called with the click event; the browser moves unless it calls `event.preventDefault()`, as a caller that moves the focus itself must, since the browser's move drops the focus when the target cannot take it), for a jump list whose entries assistive technology should list with the links. |
362
399
  | `Pill` | A text status label, 28 px high (a body line it sits on stays 20 px), text width + 16 px wide, `vertical-align: top`; as a line of a `RowButton` it keeps that width. A line mixing a `Pill` and text is one `Text` span containing the `Pill`. |
363
400
  | `Notice`, `AlertMessage` | Quiet note; failure message read once per occurrence. Both are paragraphs with the reading measure. |
401
+ | `AccessFailureNotice` | The in-place notice of an access failure, drawing the `AccessFailureView` `accessFailureView` of `@aiquants/auth-core` builds and deciding nothing the view does not say: the title (bold) and one paragraph per sentence on a `warning-tint` with the reading measure, then one `Button` per action in the view's order on the surface below the tint (the `warning-tint` has no border or focus pair), signing in (`sign-in`, `sign-in-again`, `sign-in-again-in-new-window`) primary and every other action (`retry`, `back`, `top`) secondary; a view without actions draws no row. `handlers` (`AccessFailureHandlers`) holds one function per action the view shows: an action without one throws `TypeError`. Read by the view's politeness (see Focus and announcements); `data-cui-access-failure` carries the kind. |
402
+ | `FailureMessage` | The one way to draw a failure (see Reads): an access failure is the presenter's node, with the caller's `place` (`read` or `write`), `retry` and, for a 403, `deniedSentence` followed by the declared cause; any other failure is the caller's `failed(reason)` in an `AlertMessage` with `testId`. Both are keyed by the failure's `occurrence`; a blank `deniedSentence` throws `RangeError`. |
364
403
  | `Measured` | A measured value in tabular figures, or the `unmeasured` label for `null` (never `0` or an empty slot), marked `data-measured`: a count (`value`, in the root's format locale, with an optional `unit` after a space) or a text the caller formatted (`text`, such as a byte size, an instant, a version or a rate), never both. A text says how it breaks (`keep`, `data-cui-keep` in both states): `"whole"` for a figure read as one unit (`1.0 MiB`, `2026/09/24 01:00:00`), an inline-block like `Pill` that moves to the next line whole and breaks inside only when it is longer than its column (no `nowrap`, so it never overflows), or `"wrap"` for a text that wraps with its container (an identifier, a version). A `text` or `unit` with nothing to read (`isReadableText`) throws `RangeError` naming `testId`; pass `null` for a value that was not measured. |
365
404
  | `InlineChange` | A changed fragment inside a line of text (`children` a string; an empty one throws): `kind="removed"` draws a `<del>` on `danger-tint`, `kind="added"` an `<ins>` on `success-tint`, both in `fg` (16.3 and 16.93 : 1 light, 15.45 and 14.51 : 1 dark), marked `data-cui-change`. The browser's line-through and underline are kept, so the change is not told by colour alone and survives forced colours. Draw it inside the line's `Text` (`space="preserve"` when the line's spaces matter). |
366
405
  | `MetricTile`, `TileGrid` | Metric tiles (100 px high) and the divisor grid. A tile's value is a `Measured` count (`value`, optionally with `unit`) or text (`text`), `null` while not measured, when it must be `neutral`; its label, sublabel and value are paragraphs with the reading measure. `count` is checked against the element children: a Fragment's children count one by one, a condition that renders no tile (`false`, `null`) does not count, a text child throws, and a component child counts as one tile whatever it renders (a wrapper returning `null` or two tiles is still one), so render `MetricTile` elements directly. |
@@ -373,7 +412,7 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
373
412
  | `Meter` | A value at its place in a fixed range (a score in [0, 1], a share of a quota), not progress: `role="meter"` named by `label` (no visible label; the row or field around it says what it measures), its fill in `info-accent` on a `sunken` track as long as the value's place in the range, beside the value text in `fg` (hidden from assistive technology, which reads it once as the meter's `aria-valuetext`). It is phrasing content that fits one `body` line, so it can be a line of a `RowButton`: it takes its parent's whole width even where the parent aligns its lines to the start (a `RowButton`), and the 8 px track is centred on the value text's 20 px line and takes the width left after the text, never less than 48 px. Refuses a range that is not finite or whose `min` is not below `max`, and a value outside the range. |
374
413
  | `MasterDetail` | Master–detail layout by container width; side by side, neither pane goes below its minimum. |
375
414
  | `Heading` | A page or region heading outside a `Card`: `h1` to `h3` in a heading step (`title`, `heading`, `display`, `display-lg`), bold, without margins; with `headingRef` a programmatic focus target (`tabIndex={-1}`) for the focus a host moves after a navigation. |
376
- | `Tabs` | The tab row of a console whose tabs are routes: a named `nav` of real links (not an ARIA `tablist`), the current one `aria-current="page"` with an `info-accent` marker and the medium weight. A plain click hands the tab's `href` to `onNavigate` (the host's router); a click with a modifier key or another button keeps the link's own behaviour. With `collapsible`, a container narrower than 48rem (an inline-size container query on the tab row's own width) folds the links into a full-width 44 px button naming the current tab and a popup of every tab below it (opened on press, closed on choosing a tab, Escape or a press outside); a wider container is the ordinary wrapping row, so a caller that does not set it is unchanged. |
415
+ | `Tabs` | The tab row of a console whose tabs are routes: a named `nav` of real links (not an ARIA `tablist`), the current one `aria-current="page"` with an `info-accent` marker and the medium weight. A plain click hands the tab's `href` to `onNavigate` (the host's router); a click with a modifier key or another button keeps the link's own behaviour. With `collapsible`, a container narrower than 48rem (an inline-size container query on the tab row's own width) folds the links into a full-width 44 px button naming the current tab and a popup of every tab below it (opened on press, closed on choosing a tab, Escape, a press outside or focus moving to an element outside the row, which keeps that focus where it went so the popup never covers it; focus lost to nothing, such as another window, leaves it open); a wider container is the ordinary wrapping row, so a caller that does not set it is unchanged. |
377
416
  | `Breadcrumb` | The trail to the current page: a `nav` named by the UI language's `breadcrumb` label around an ordered list of the ancestors' links (drawn like `Link`) and the current page's name as `aria-current="page"` text; separators are hidden from assistive technology. Clicks as `Tabs`. |
378
417
  | `Toolbar` | `role="toolbar"` with a roving tabindex over its buttons (see Focus and announcements), laid out like a `Cluster` with an 8 px gap. |
379
418
  | `Dialog` | A modal `<dialog>` named by its title, with its close button and its own live region (see Focus and announcements); at most 40 ideographs plus its padding wide (WCAG 1.4.8), never wider than the viewport less 24 px on each side. `description` (a confirmation's sentence) is drawn under the header as a paragraph with the reading measure and is the dialog's `aria-describedby`, so it is read with the dialog's name when the dialog opens; without it the dialog has no description. `initialFocus` names the element focus moves to when it opens (the first field of a form; see Focus and announcements). |
@@ -386,7 +425,7 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
386
425
  | `DescriptionList` | A `dl` of name–value rows (`dt` and `dd` grouped in a `div`), the term a third of the row in `fg-secondary`. |
387
426
  | `Stepper` | A job's steps as a named ordered list: the current step `aria-current="step"`, the others followed by the hidden `stepDone` or `stepPending` word; a finished step's marker is a check mark on `success-solid`, the current one its number on `info-solid`. The states must run done, at most one current, then pending. |
388
427
  | `JobCard` | One job in a `Card`: its state pill in a live region of its own, an optional `ProgressBar` and an optional cancel button in the card's actions that is busy while the cancel is under way. |
389
- | `useEscapeToClose`, `useFocusRescue`, `usePendingPress`, `useResource`, `usePagedResource`, `ResourceFailed` | See above. |
428
+ | `useEscapeToClose`, `useFocusRescue`, `useFailureOccurrence`, `usePendingPress`, `useResource`, `usePagedResource`, `ResourceFailed` | See above. |
390
429
 
391
430
  Every component except `Text` requires `testId`, exposes its state as `data-*` attributes, takes no `className`, and accepts caller `data-*` attributes through `dataAttributes` where a host needs to mark it (`data-cui-*` and `data-testid` are reserved and rejected there). The one `data-cui-*` attribute a host writes itself is the row-focus hook `data-cui-row-focus`, on the row elements of its own row list (see Focus and announcements).
392
431
 
@@ -413,7 +452,8 @@ The test ids a component derives from its `testId` are public test hooks:
413
452
  | `DataTable` | `<testId>-frame` (the scroll frame), `<testId>-empty` (the `empty` text), `<rowTestId>-detail` (each record row's detail row, with `rowDetail`) |
414
453
  | `SelectableList` | `<testId>-empty` (the `empty` text) |
415
454
  | `LoadMore` | `<testId>-button`, `<testId>-failure`, `<testId>-end` |
416
- | `ResourceFailed` | `<testId>-alert`, `<testId>-reload` |
455
+ | `AccessFailureNotice` | `<testId>-message` (the tint), `<testId>-title`, `<testId>-actions` (the row of buttons), `<testId>-<action>` (each action's button, such as `<testId>-retry`) |
456
+ | `ResourceFailed` | `<testId>-alert` (the `AlertMessage` of a failure that is not an access failure; an access failure carries the test ids its presenter gives), `<testId>-reload` |
417
457
  | `TextInput`, `PasswordInput`, `TextArea`, `Select` | `<testId>-field` (the field root; `testId` itself is on the control), `<testId>-description`, `<testId>-error`; `TextInput` also `<testId>-prefix` (the `prefix` text); `Select` also `<testId>-reason` (the `unavailable` reason it draws) |
418
458
  | `Field`, `RadioGroup`, `CheckboxGroup` | `<testId>-description`, `<testId>-error`; `RadioGroup` and `CheckboxGroup` also `<testId>-option-<value>` (each option's input) |
419
459
  | `ProgressBar` | `<testId>-bar` (the `progressbar`), `<testId>-fill`, `<testId>-value` (the visible value text) |
@@ -444,7 +484,9 @@ Announcements are written once the quiet window passes (`ANNOUNCE_SETTLE_MS`, 15
444
484
  `ConsoleUiRoot` needs a test DOM that parses the `:modal` selector (see Focus and announcements): jsdom 27 or later. On jsdom 26 and earlier the root throws when it mounts (`ConsoleUiRoot requires the :modal selector …`). jsdom 27 and later, and happy-dom, parse `:modal` but never match it, even after `showModal()`, so a test of an announcement under a modal dialog answers `document.querySelectorAll("dialog:modal")` itself with the dialogs a browser would return, and moves focus as the browser would (into the topmost modal).
445
485
 
446
486
  jsdom 27 reflects a dialog's `open` but implements neither `showModal()` nor `close()`, which `Dialog` calls, so a test of a `Dialog` installs both on `HTMLDialogElement.prototype` first with `installDialogModel()` from `@aiquants/console-ui/testing`, once in the test setup (it installs only where `showModal()` is missing): a model that sets and removes `open`, focuses the dialog's first focusable descendant, returns focus on close to the element that had it at the open, and fires `close` in a later task (the browser's order). It cannot make the rest of the document inert.
447
- `openModals()` returns the dialogs a browser would match with `dialog:modal`, in the order they opened (answer `document.querySelectorAll("dialog:modal")` with it), and `pressEscape(dialog)` plays the browser's Escape: a cancelable `cancel`, then `close()` unless it was cancelled. The package's own tests read the model through the same entry.
487
+ `openModals()` returns the dialogs a browser would match with `dialog:modal`, in the order they opened (answer `document.querySelectorAll("dialog:modal")` with it).
488
+ `pressEscape(dialog)` plays the browser's Escape: a cancelable, bubbling Escape `keydown` on the focused element and, unless it was cancelled, the close request it makes; `sendCloseRequest(dialog)` plays a close request that comes from no key (a phone's back gesture, or the close request a browser makes after a composing Escape's keydown, which a test fires itself): a cancelable `cancel`, then `close()` unless it was cancelled.
489
+ Every close request the model plays can be cancelled: it does not model the browser's rule that lets a page cancel one only when the operator has interacted with the page since the last cancelled one. The package's own tests read the model through the same entry.
448
490
 
449
491
  jsdom does not evaluate container queries, so only the layout components' default rules apply there. For `ComparisonGrid` that is the stacked layout: the column groups and the `stack` copy of every cell are shown and reachable by role, while the table is `display: none` and therefore not in the accessibility tree. Query the stacked copy (for example a cell test id `tie-stack`, or `getByRole("group", { name })`), and pass `hidden: true` to reach the table (`getByRole("table", { name, hidden: true })`); `toBeVisible()` is false for the table and its cells.
450
492
 
@@ -0,0 +1 @@
1
+ var Ee=[{name:"B",power:0,fractionDigits:0},{name:"KiB",power:1,fractionDigits:1},{name:"MiB",power:2,fractionDigits:1},{name:"GiB",power:3,fractionDigits:2},{name:"TiB",power:4,fractionDigits:2}],j=new Map,K=e=>Number.isSafeInteger(e)&&e>=0,V=(e,t,n)=>{let r=`${n} ${t}`,o=j.get(r);return o===void 0&&(o=new Intl.NumberFormat(t,{minimumFractionDigits:n,maximumFractionDigits:n,useGrouping:!0}),j.set(r,o)),o.format(e===0?0:e)},w=(e,t)=>{if(!K(e))throw new RangeError(`A count must be a non-negative safe integer: ${e}`);return V(e,t,0)},Y=(e,t)=>Number((e/1024**t.power).toFixed(t.fractionDigits)),Se=(e,t)=>{if(!K(e))throw new RangeError(`A byte size must be a non-negative safe integer: ${e}`);let[n,...r]=Ee,o=n,i=Y(e,o);for(let d of r){if(i<1024)break;o=d,i=Y(e,o)}return`${V(i,t,o.fractionDigits)} ${o.name}`},J=(e,t)=>t===void 0?e:`${e} ${t}`;var Ce=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/,Pe=/[!-~]/g;var _e=/^[^eE]*[1-9]/,q=e=>{let t=e.replace(Pe,r=>String.fromCharCode(r.charCodeAt(0)-65248)).trim();if(!Ce.test(t))return null;let n=Number(t);return Number.isFinite(n)?n===0?_e.test(t)?null:0:n:null},we=e=>{let t=q(e);return t!==null&&Number.isSafeInteger(t)?t:null};var Oe=/[^\p{White_Space}\p{Cc}\p{Cf}\p{Default_Ignorable_Code_Point}]/u,f=e=>Oe.test(e);var l=class extends RangeError{reason;constructor(t,n){super(n),this.name="ZonedTimeError",this.reason=t}},Ie=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?$/,Ne=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(?:(Z)|([+-])(\d{2}):(\d{2}))$/,Me=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(?:(Z)|([+-])(\d{2}):?(\d{2}))$/,Z=864e5,I=6e4,E={min:1,max:9999},Q=new Map,ee=new Map,Le=e=>{let t=Q.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Q.set(e,t)),t},te=e=>{let t=new Date(0);return t.setUTCFullYear(e.year,e.month-1,e.day),t.setUTCHours(e.hour,e.minute,e.second,0),t.getUTCFullYear()===e.year&&t.getUTCMonth()===e.month-1&&t.getUTCDate()===e.day&&t.getUTCHours()===e.hour&&t.getUTCMinutes()===e.minute&&t.getUTCSeconds()===e.second?t.getTime():null},N=(e,t)=>{let[n,r,o,i,d,s,R]=t;if(R!==void 0&&/[1-9]/.test(R))throw new l("subsecond",`Fractions of a second cannot be kept: ${e}`);let p={year:Number(n),month:Number(r),day:Number(o),hour:Number(i),minute:Number(d),second:s===void 0?0:Number(s)},X=p.year>=E.min?te(p):null;if(X===null)throw new l("malformed",`Not a calendar date and time: ${e}`);return{fields:p,millis:X}},M=(e,t)=>{let n=new Map(Le(t).formatToParts(new Date(e)).map(o=>[o.type,o.value])),r={year:Number(n.get("year")),month:Number(n.get("month")),day:Number(n.get("day")),hour:Number(n.get("hour")),minute:Number(n.get("minute")),second:Number(n.get("second"))};if(n.get("era")!=="AD"||r.year>E.max)throw new l("malformed",`The wall clock falls outside years ${E.min}-${E.max}: ${new Date(e).toISOString()}`);return r},O=(e,t)=>te(M(e,t))-e,g=e=>String(e).padStart(2,"0"),ne=(e,t)=>{let n=`${String(e.year).padStart(4,"0")}-${g(e.month)}-${g(e.day)}T${g(e.hour)}:${g(e.minute)}`;return t||e.second!==0?`${n}:${g(e.second)}`:n},Fe=e=>{if(e%I!==0)throw new l("malformed",`The zone's offset is not a whole number of minutes: ${e} ms`);let t=Math.abs(e)/I;return`${e<0?"-":"+"}${g(Math.floor(t/60))}:${g(t%60)}`},$e=(e,t)=>{let n=Ie.exec(e);if(n===null)throw new l("malformed",`Not a wall time (YYYY-MM-DDTHH:mm[:ss]): ${e}`);let{fields:r,millis:o}=N(e,n.slice(1)),d=[...new Set([O(o-Z,t),O(o+Z,t)])].filter(s=>O(o-s,t)===s);if(d.length===0)throw new l("nonexistent",`${e} does not exist in ${t}`);if(d.length>1)throw new l("ambiguous",`${e} occurs twice in ${t}`);return`${ne(r,!0)}${Fe(d[0])}`},re=(e,t)=>{let[n,r,o,i]=t;if(n!==void 0)return 0;if(Number(o)>23||Number(i)>59)throw new l("malformed",`Not a valid offset: ${e}`);return(r==="-"?-1:1)*(Number(o)*60+Number(i))*I},Ae=(e,t)=>{let n=Ne.exec(e);if(n===null)throw new l("malformed",`Not an ISO 8601 instant with an offset: ${e}`);let{millis:r}=N(e,n.slice(1,8));return ne(M(r-re(e,n.slice(8)),t),!1)},De=(e,t)=>{let n=JSON.stringify([e,t]),r=ee.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}),ee.set(n,r)),r},L=(e,t,n)=>{let r=Me.exec(e);if(r===null)throw new l("malformed",`Not an ISO 8601 instant with an offset: ${e}`);let{millis:o}=N(e,[...r.slice(1,7),void 0]),i=o-re(e,r.slice(7));return M(i,n),De(t,n).format(i)};function ve(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>Object.hasOwn(t,r)?String(t[r]):n)}import{accessFailureKindOfStatus as Ue}from"@aiquants/auth-core";var T=e=>e===""?"":` (${e})`,oe=(e,t)=>{if(e.status!==null&&Ue(e.status)!==null)throw new RangeError(`failureSentence: a ${e.status} is an access failure, which the root's presenter states (draw it with FailureMessage or ResourceFailed)`);return t(e.reason)},Be=(e,t)=>t===""?e:`${e} Reason: ${t}.`,He=(e,t)=>t===""?e:`${e}${t}\u3002`,S={en:{unmeasured:"Not measured",loading:"Loading",loadFailed:e=>`Could not load${T(e)}.`,refreshFailed:e=>`Could not refresh${T(e)}.`,forbiddenBecause:Be,failureSentence:oe,loadMore:e=>`Show ${e} more`,endOfRecords:"No more records",close:"Close",cancel:"Cancel",reload:"Reload",breadcrumb:"Breadcrumb",stepDone:"Done",stepPending:"Not started"},ja:{unmeasured:"\u672A\u6E2C\u5B9A",loading:"\u8AAD\u307F\u8FBC\u307F\u4E2D",loadFailed:e=>`\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F${T(e)}\u3002`,refreshFailed:e=>`\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F${T(e)}\u3002`,forbiddenBecause:He,failureSentence:oe,loadMore:e=>`\u3055\u3089\u306B ${e} \u4EF6\u3092\u8868\u793A`,endOfRecords:"\u3053\u308C\u4EE5\u4E0A\u306E\u8A18\u9332\u306F\u3042\u308A\u307E\u305B\u3093",close:"\u9589\u3058\u308B",cancel:"\u3084\u3081\u308B",reload:"\u518D\u8AAD\u307F\u8FBC\u307F",breadcrumb:"\u30D1\u30F3\u304F\u305A",stepDone:"\u5B8C\u4E86",stepPending:"\u672A\u7740\u624B"}},We=e=>{if(!Object.hasOwn(S,e))throw new RangeError(`No console UI labels for locale "${e}"; supported: ${Object.keys(S).join(", ")}`);return S[e]};var ze=4,Ge=[1,2,3,4,6,8,12,16,24],Xe=16,je=5/4,$={caption:-2,body:-1,"body-lg":0,title:0,heading:1,display:2,"display-lg":3},Ye=11,ae=3/2,Ke=7/4,Ve=7/4,Je=120,qe=3/2,Ze=[1,2,3],ie=e=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`A length must be a finite number of px at or above 0: ${e}`);return Math.ceil(e/4)*4},A=e=>{if(!Number.isInteger(e))throw new RangeError(`A type step must be an integer: ${e}`);return Math.max(Ye,Math.round(Xe*je**e))},D=(e,t)=>ie(e*t),se=D(A($.body),ae),b=se+24,le=b+8,de=se+8,F={weight:{regular:400,medium:500,bold:700},radius:{"radius-control":4,"radius-item":8,"radius-container":12,"radius-pill":9999},stroke:{"border-width":1,"focus-width":2,"focus-offset":2,"marker-width":2}},Qe=()=>Object.fromEntries(Ge.map(e=>[`space-${e}`,e*4])),et=()=>{let e=Object.fromEntries(Object.entries($).map(([n,r])=>{let o=A(r);return[n,{size:o,lineHeight:D(o,n==="title"?Ve:ae)}]})),t=A($.body);return{...e,prose:{size:t,lineHeight:D(t,Ke)}}},tt=()=>Object.fromEntries(Ze.map(e=>[`motion-${e}`,Je*qe**(e-1)])),ce=e=>Object.freeze({space:Object.freeze(Qe()),type:Object.freeze(et()),weight:F.weight,radius:F.radius,size:Object.freeze({"size-target":b,"size-control":b,"size-row":b,"size-row-control":le,"size-row-compact":de}),stroke:F.stroke,motion:Object.freeze(tt()),color:Object.freeze({...e})});var nt={fg:{light:"#0f172b",dark:"#f8fafc"},"fg-secondary":{light:"#314158",dark:"#e2e8f0"},"fg-muted":{light:"#44536a",dark:"#cad5e2"},"danger-fg":{light:"#9f0712",dark:"#ffc9c9"},"warning-fg":{light:"#7b3306",dark:"#fee685"},"success-fg":{light:"#006045",dark:"#a4f4cf"},"info-fg":{light:"#193cb8",dark:"#bedbff"},"on-solid":{light:"#ffffff",dark:"#0f172b"},surface:{light:"#ffffff",dark:"#0f172b"},subtle:{light:"#f8fafc",dark:"#1d293d"},sunken:{light:"#f1f5f9",dark:"#020618"},"danger-tint":{light:"#fef2f2",dark:"#460809"},"warning-tint":{light:"#fffbeb",dark:"#461901"},"success-tint":{light:"#ecfdf5",dark:"#002c22"},"info-tint":{light:"#eff6ff",dark:"#162456"},"neutral-solid":{light:"#314158",dark:"#cad5e2"},"danger-solid":{light:"#9f0712",dark:"#ffa2a2"},"success-solid":{light:"#006045",dark:"#5ee9b5"},"info-solid":{light:"#193cb8",dark:"#8ec5ff"},"warning-solid":{light:"#7b3306",dark:"#ffd230"},"danger-accent":{light:"#e7000b",dark:"#ff6467"},"warning-accent":{light:"#bb4d00",dark:"#fcbb00"},"success-accent":{light:"#009966",dark:"#00d492"},"info-accent":{light:"#155dfc",dark:"#51a2ff"},focus:{light:"#155dfc",dark:"#51a2ff"},"border-control":{light:"#62748e",dark:"#90a1b9"},"border-subtle":{light:"#e2e8f0",dark:"#314158"}},a=ce(nt),rt="--cui-",ot=e=>`var(${rt}${e})`;var at=e=>e>=32&&e<=126||e>=65377&&e<=65500||e>=65512&&e<=65518,ue=(e,t)=>{let n=0,r=0;for(let o of e)at(o.codePointAt(0))?r+=1:n+=1;return n*1+r*t},h=e=>ue(e,.55),x=e=>ue(e,.6),u=e=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`Length must be a finite px value >= 0: ${e}`);return Math.max(0,Math.ceil((e-1e-9)/8))*8};var me="caption",B="body",H=2*a.space["space-3"],fe={type:"caption",paddingInlinePx:2*a.space["space-2"]},v={type:"body",paddingInlinePx:2*a.space["space-3"]+2*a.stroke["border-width"],minInlinePx:a.size["size-control"]},ge={type:"body",minInlinePx:a.size["size-target"]},C={trackInlinePx:2*a.type.body.lineHeight+3*a.space["space-1"],labelGapPx:a.space["space-2"],type:"body"},U={captionType:"caption",valueType:"heading",paddingInlinePx:2*a.space["space-3"]},it=10,st="2000-01-01T00:00:00Z",lt=9999999,pe=(e,t,n)=>(t==="mono"?x(e):h(e))*a.type[n].size,dt=(e,t)=>{if(e.length===0)throw new RangeError(`A ${t} needs at least one text to be measured with`);for(let n of e)if(!f(n))throw new RangeError(`A ${t} sample must hold a readable character: ${JSON.stringify(n)}`);return e},c=(e,t,n,r)=>Math.max(...dt(e,t).map(o=>pe(o,n,r))),W=e=>{switch(e.kind){case"text":return c(e.texts,"text",e.face,e.type);case"measured":return c(e.texts,"measured value","sans",B);case"pill":return c(e.labels,"pill","sans",fe.type)+fe.paddingInlinePx;case"button":return Math.max(v.minInlinePx,c(e.labels,"button","sans",v.type)+v.paddingInlinePx);case"link":return Math.max(ge.minInlinePx,c(e.labels,"link","sans",ge.type));case"switch":return e.labelHidden?C.trackInlinePx:C.trackInlinePx+C.labelGapPx+c(e.labels,"switch","sans",C.type);case"cluster":{if(e.items.length===0)throw new RangeError("A cluster needs at least one item to be measured with");return e.items.reduce((t,n)=>t+W(n),0)+(e.items.length-1)*a.space[e.gap]}}},ct=(e,t)=>{let n=c([e.header],"column header","sans",me),r=e.note===void 0?0:c(e.note,"column header note","sans",me);return u(Math.max(n,r,...t.map(W))+H)},ut=u(pe("\u3042".repeat(it),"sans",B)+H),mt=e=>u(c(e,"comparison attribute","sans",B)+H),ft=(e,t)=>L(st,e,t),gt=(e,t)=>{if(t!==void 0&&!f(t))throw new RangeError(`A count sample's unit must hold a readable character: ${JSON.stringify(t)}`);return J(w(lt,e),t)},pt=(e,t)=>u(Math.max(c(e,"tile caption","sans",U.captionType),c(t,"tile value","sans",U.valueType))+U.paddingInlinePx);var yt=.12,Tt=.16,bt=/[\u0020\u00a0\u1361\u{10100}\u{10101}\u{1039f}\u{1091f}]/u,k=a.space["space-3"],P=(e,t)=>{let n=0,r=0;for(let i of e)n+=1,bt.test(i)&&(r+=1);return(t==="mono"?x(e):h(e))+yt*n+Tt*r},ht=e=>{for(let n of[e.name,...e.notes])if(!f(n))throw new RangeError(`A figure node's name and notes must hold a readable character: ${JSON.stringify(n)}`);let t=Math.max(P(e.name,"sans")*a.type.body.size,...e.notes.map(n=>P(n,"sans")*a.type.caption.size));return{minWidthPx:u(t)+2*k,heightPx:2*k+a.type.body.lineHeight+e.notes.length*a.type.caption.lineHeight}},cn=e=>{let t=k+a.type.body.lineHeight;return{insetPx:k,namePx:k+a.type.body.lineHeight/2,notesPx:Array.from({length:e},(n,r)=>t+r*a.type.caption.lineHeight+a.type.caption.lineHeight/2)}},xt=(e,t)=>{if(e!==null&&!f(e))throw new RangeError(`A disc's name must hold a readable character: ${JSON.stringify(e)}`);if(!(Number.isFinite(t)&&t>0))throw new RangeError(`A disc's radius must be a positive finite px value: ${t}`);return e===null?{widthPx:0,extentBelowPx:t+ye}:{widthPx:u(P(e,"sans")*a.type.caption.size),extentBelowPx:t+a.space["space-1"]+a.type.caption.lineHeight}},ye=a.stroke["focus-offset"]+a.stroke["focus-width"],un=a.stroke["focus-offset"]+a.stroke["focus-width"]/2;var _=(1+Math.sqrt(5))/2,kt=(e,t)=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`A length must be a finite number of px at or above 0: ${e}`);if(!(Number.isInteger(t)&&t>=0))throw new RangeError(`A golden section step must be an integer at or above 0: ${t}`);return e/_**t};var Rt=e=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`Length must be a finite px value >= 0: ${e}`);return e},m=e=>`${Rt(e)/16}rem`;var Te=({masterMinPx:e,detailMinPx:t,gapPx:n})=>{for(let r of[e,t])if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Pane minimum must be a positive px value: ${r}`);if(!(Number.isFinite(n)&&n>=0))throw new RangeError(`Gap must be a px value >= 0: ${n}`);return e+n+t},Et=(e,t)=>{let n=Te(t);if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`Container width must be a px value >= 0: ${e}`);if(e<n)return{sideBySide:!1,sideBySideFromPx:n,masterInlinePx:e,detailInlinePx:e};let r=(e-t.gapPx)/(1+_),o=Math.min(Math.max(t.masterMinPx,r),e-t.gapPx-t.detailMinPx);return{sideBySide:!0,sideBySideFromPx:n,masterInlinePx:o,detailInlinePx:e-t.gapPx-o}},Tn=e=>{let t=Te(e),n=`cui-master-detail-m${e.masterMinPx}-d${e.detailMinPx}-g${e.gapPx}`,r=`[data-cui-master-detail="${n}"]`,o=m(e.gapPx),i=`${r}{grid-template-columns:minmax(0,1fr);gap:${o}}`,d=`clamp(${m(e.masterMinPx)},calc((100% - ${o}) / ${1+_}),calc(100% - ${o} - ${m(e.detailMinPx)}))`,s=`@container (min-width:${m(t)}){${r}{grid-template-columns:${d} minmax(0,1fr)}}`;return{key:n,css:i+s}};var St=2*a.space["space-1"],be=e=>{if(!(Number.isFinite(e)&&e>0))throw new RangeError(`Column width must be a positive px value: ${e}`);return e},he=e=>{if(e.length===0)throw new RangeError("A table needs at least one column");let t=0,n=null;for(let{width:r}of e){if(r.fixedPx!==void 0){t+=be(r.fixedPx);continue}let o=be(r.minPx);if(n!==null&&n!==o)throw new RangeError(`Flexible columns share the remaining width equally, so their minimums must be equal: ${n} and ${o}`);n=o,t+=o}return t},Ct=e=>he(e)+St;var Pt=(e,t,n)=>{if(!(Number.isSafeInteger(e)&&e>0))throw new RangeError(`Tile count must be a positive integer: ${e}`);if(!(Number.isFinite(t)&&t>0))throw new RangeError(`Tile minimum width must be a positive px value: ${t}`);if(!(Number.isFinite(n)&&n>=0))throw new RangeError(`Tile gap must be a px value >= 0: ${n}`);let r=[];for(let s=1;s<=e;s+=1)e%s===0&&r.push({columns:s,minContainerPx:s*t+(s-1)*n});let o=`cui-tiles-n${e}-m${t}-g${n}`,i=`[data-cui-tile-grid="${o}"]`,d=r.map(({columns:s,minContainerPx:R})=>{let p=`${i}{grid-template-columns:repeat(${s},minmax(0,1fr))}`;return s===1?p:`@container (min-width:${m(R)}){${p}}`});return{key:o,steps:r,css:d.join("")}};var _t=403,wt=(e,t)=>e.ok?{ok:!0,value:t(e.value)}:e,Ot=(e,t)=>e.ok?t(e.value):e,En={kind:"idle"},It={kind:"loading"},z=(e,t)=>e.kind==="ready"?{...e,refreshing:!0}:e.kind==="failed"?t==="reload"?{...e,retrying:!0}:e:It,G=(e,t)=>t.ok?{kind:"ready",value:t.value,refreshing:!1,refreshFailure:null}:e.kind==="failed"&&e.status===403?e.retrying?{...e,retrying:!1}:e:e.kind==="ready"&&t.status!==403?{kind:"ready",value:e.value,refreshing:!1,refreshFailure:{status:t.status,reason:t.reason}}:{kind:"failed",status:t.status,reason:t.reason,occurrence:e.kind==="failed"?e.occurrence+1:1,retrying:!1};var Nt=(e,t)=>{let n=z(e,t);return n.kind==="ready"?{...n,value:{...n.value,loadingMore:!1}}:n},Mt=(e,t)=>G(e,t.ok?{ok:!0,value:{rows:t.value.rows,next:t.value.next,meta:t.value.meta,loadingMore:!1,moreFailure:null}}:t),Lt=e=>e.kind==="ready"&&!e.refreshing&&e.value.next!==null&&!e.value.loadingMore?{...e,value:{...e.value,loadingMore:!0}}:e,Ft=(e,t,n)=>{if(!(e.kind==="ready"&&e.value.loadingMore&&Object.is(e.value.next,t)))return e;if(n.ok)return{...e,value:{...e.value,rows:[...e.value.rows,...n.value.rows],next:n.value.next,loadingMore:!1,moreFailure:null}};let r=e.value.moreFailure===null?1:e.value.moreFailure.occurrence+1;return{...e,value:{...e.value,loadingMore:!1,moreFailure:{reason:n.reason,occurrence:r}}}},$t=(e,t)=>{if(e.kind!=="ready")return e;let{rows:n,meta:r}=t({rows:e.value.rows,meta:e.value.meta});return{...e,value:{...e.value,rows:n,meta:r}}};var At=/^#[0-9a-f]{6}$/i,Dt=/^[a-z][a-z0-9-]*$/,xe=e=>{if(!At.test(e))throw new RangeError(`A palette colour must be #rrggbb: ${e}`);return e},ke=({light:e,dark:t})=>`light-dark(${xe(e)}, ${xe(t)})`,vt=e=>{if(!Dt.test(e))throw new RangeError(`A root attribute must be lowercase letters, digits and hyphens, starting with a letter: ${e}`);return`[${e}] ::placeholder { color: ${ke(a.color["fg-muted"])}; opacity: 1; }`};var Re=["indigo","violet","purple","fuchsia","pink","rose","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue"],Ut=["fg","tint","accent","line","solid","solid-hover"],Bt={indigo:{fg:{light:"#372aac",dark:"#c6d2ff"},tint:{light:"#eff3ff",dark:"#1e1a4d"},accent:{light:"#4f39f6",dark:"#7c86ff"}},violet:{fg:{light:"#5d0ec0",dark:"#ddd6ff"},tint:{light:"#f5f3ff",dark:"#2f0d68"},accent:{light:"#7f22fe",dark:"#a684ff"}},purple:{fg:{light:"#6e11b0",dark:"#e9d4ff"},tint:{light:"#faf5ff",dark:"#3c0366"},accent:{light:"#9810fa",dark:"#c27aff"}},fuchsia:{fg:{light:"#8a0194",dark:"#f6cfff"},tint:{light:"#fdf4ff",dark:"#4b004f"},accent:{light:"#c800de",dark:"#ed6aff"}},pink:{fg:{light:"#a3004c",dark:"#fccee8"},tint:{light:"#fdf2f8",dark:"#510424"},accent:{light:"#e60076",dark:"#fb64b6"}},rose:{fg:{light:"#a50036",dark:"#ffccd3"},tint:{light:"#fff1f2",dark:"#4d0218"},accent:{light:"#ec003f",dark:"#ff637e"}},red:{fg:{light:"#9f0712",dark:"#ffc9c9"},tint:{light:"#fef2f2",dark:"#460809"},accent:{light:"#e7000b",dark:"#ff6467"}},orange:{fg:{light:"#7e2a0c",dark:"#ffd6a7"},tint:{light:"#fff7ed",dark:"#441306"},accent:{light:"#f54900",dark:"#ff8904"}},amber:{fg:{light:"#7b3306",dark:"#fee685"},tint:{light:"#fffbeb",dark:"#461901"},accent:{light:"#bb4d00",dark:"#fcbb00"}},yellow:{fg:{light:"#733e0a",dark:"#fff085"},tint:{light:"#fefce8",dark:"#432004"},accent:{light:"#a65f00",dark:"#fdc700"}},lime:{fg:{light:"#35530e",dark:"#d8f999"},tint:{light:"#f7fee7",dark:"#192e03"},accent:{light:"#497d00",dark:"#9ae600"}},green:{fg:{light:"#0d542b",dark:"#b9f8cf"},tint:{light:"#f0fdf4",dark:"#032e15"},accent:{light:"#008236",dark:"#05df72"}},emerald:{fg:{light:"#004f3b",dark:"#a4f4cf"},tint:{light:"#ecfdf5",dark:"#002c22"},accent:{light:"#009966",dark:"#00d492"}},teal:{fg:{light:"#0b4f4a",dark:"#96f7e4"},tint:{light:"#f0fdfa",dark:"#022f2e"},accent:{light:"#009689",dark:"#00d5be"}},cyan:{fg:{light:"#104e64",dark:"#a2f4fd"},tint:{light:"#ecfeff",dark:"#053345"},accent:{light:"#0092b8",dark:"#00d3f2"}},sky:{fg:{light:"#024a70",dark:"#b8e6fe"},tint:{light:"#f0f9ff",dark:"#052f4a"},accent:{light:"#0084d1",dark:"#00bcff"}},blue:{fg:{light:"#193cb8",dark:"#bedbff"},tint:{light:"#eff6ff",dark:"#162456"},accent:{light:"#155dfc",dark:"#51a2ff"}}},y=({light:e,dark:t})=>Object.freeze({light:e,dark:t}),Ht=({fg:e,tint:t,accent:n})=>Object.freeze({fg:y(e),tint:y(t),accent:y(n),line:y({light:e.dark,dark:e.light}),solid:y(e),"solid-hover":y({light:t.dark,dark:t.light})}),Wt=Object.freeze(Object.fromEntries(Re.map(e=>[e,Ht(Bt[e])])));export{w as a,Se as b,J as c,q as d,we as e,f,l as g,$e as h,Ae as i,L as j,ve as k,T as l,S as m,We as n,ze as o,ie as p,b as q,le as r,de as s,a as t,ot as u,h as v,x as w,u as x,W as y,ct as z,ut as A,mt as B,ft as C,gt as D,pt as E,P as F,ht as G,cn as H,xt as I,ye as J,un as K,kt as L,m as M,Et as N,Tn as O,he as P,Ct as Q,Pt as R,_t as S,wt as T,Ot as U,En as V,It as W,z as X,G as Y,Nt as Z,Mt as _,Lt as $,Ft as aa,$t as ba,ke as ca,vt as da,Re as ea,Ut as fa,Wt as ga};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var Ee=[{name:"B",power:0,fractionDigits:0},{name:"KiB",power:1,fractionDigits:1},{name:"MiB",power:2,fractionDigits:1},{name:"GiB",power:3,fractionDigits:2},{name:"TiB",power:4,fractionDigits:2}],j=new Map,K=e=>Number.isSafeInteger(e)&&e>=0,V=(e,t,n)=>{let r=`${n} ${t}`,o=j.get(r);return o===void 0&&(o=new Intl.NumberFormat(t,{minimumFractionDigits:n,maximumFractionDigits:n,useGrouping:!0}),j.set(r,o)),o.format(e===0?0:e)},w= exports.a =(e,t)=>{if(!K(e))throw new RangeError(`A count must be a non-negative safe integer: ${e}`);return V(e,t,0)},Y=(e,t)=>Number((e/1024**t.power).toFixed(t.fractionDigits)),Se= exports.b =(e,t)=>{if(!K(e))throw new RangeError(`A byte size must be a non-negative safe integer: ${e}`);let[n,...r]=Ee,o=n,i=Y(e,o);for(let d of r){if(i<1024)break;o=d,i=Y(e,o)}return`${V(i,t,o.fractionDigits)} ${o.name}`},J= exports.c =(e,t)=>t===void 0?e:`${e} ${t}`;var Ce=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/,Pe=/[!-~]/g;var _e=/^[^eE]*[1-9]/,q= exports.d =e=>{let t=e.replace(Pe,r=>String.fromCharCode(r.charCodeAt(0)-65248)).trim();if(!Ce.test(t))return null;let n=Number(t);return Number.isFinite(n)?n===0?_e.test(t)?null:0:n:null},we= exports.e =e=>{let t=q(e);return t!==null&&Number.isSafeInteger(t)?t:null};var Oe=/[^\p{White_Space}\p{Cc}\p{Cf}\p{Default_Ignorable_Code_Point}]/u,f= exports.f =e=>Oe.test(e);var l=class extends RangeError{constructor(t,n){super(n),this.name="ZonedTimeError",this.reason=t}},Ie=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?$/,Ne=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(?:(Z)|([+-])(\d{2}):(\d{2}))$/,Me=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(?:(Z)|([+-])(\d{2}):?(\d{2}))$/,Z=864e5,I=6e4,E={min:1,max:9999},Q=new Map,ee=new Map,Le=e=>{let t=Q.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Q.set(e,t)),t},te=e=>{let t=new Date(0);return t.setUTCFullYear(e.year,e.month-1,e.day),t.setUTCHours(e.hour,e.minute,e.second,0),t.getUTCFullYear()===e.year&&t.getUTCMonth()===e.month-1&&t.getUTCDate()===e.day&&t.getUTCHours()===e.hour&&t.getUTCMinutes()===e.minute&&t.getUTCSeconds()===e.second?t.getTime():null},N=(e,t)=>{let[n,r,o,i,d,s,R]=t;if(R!==void 0&&/[1-9]/.test(R))throw new l("subsecond",`Fractions of a second cannot be kept: ${e}`);let p={year:Number(n),month:Number(r),day:Number(o),hour:Number(i),minute:Number(d),second:s===void 0?0:Number(s)},X=p.year>=E.min?te(p):null;if(X===null)throw new l("malformed",`Not a calendar date and time: ${e}`);return{fields:p,millis:X}},M=(e,t)=>{let n=new Map(Le(t).formatToParts(new Date(e)).map(o=>[o.type,o.value])),r={year:Number(n.get("year")),month:Number(n.get("month")),day:Number(n.get("day")),hour:Number(n.get("hour")),minute:Number(n.get("minute")),second:Number(n.get("second"))};if(n.get("era")!=="AD"||r.year>E.max)throw new l("malformed",`The wall clock falls outside years ${E.min}-${E.max}: ${new Date(e).toISOString()}`);return r},O=(e,t)=>te(M(e,t))-e,g=e=>String(e).padStart(2,"0"),ne=(e,t)=>{let n=`${String(e.year).padStart(4,"0")}-${g(e.month)}-${g(e.day)}T${g(e.hour)}:${g(e.minute)}`;return t||e.second!==0?`${n}:${g(e.second)}`:n},Fe=e=>{if(e%I!==0)throw new l("malformed",`The zone's offset is not a whole number of minutes: ${e} ms`);let t=Math.abs(e)/I;return`${e<0?"-":"+"}${g(Math.floor(t/60))}:${g(t%60)}`},$e= exports.h =(e,t)=>{let n=Ie.exec(e);if(n===null)throw new l("malformed",`Not a wall time (YYYY-MM-DDTHH:mm[:ss]): ${e}`);let{fields:r,millis:o}=N(e,n.slice(1)),d=[...new Set([O(o-Z,t),O(o+Z,t)])].filter(s=>O(o-s,t)===s);if(d.length===0)throw new l("nonexistent",`${e} does not exist in ${t}`);if(d.length>1)throw new l("ambiguous",`${e} occurs twice in ${t}`);return`${ne(r,!0)}${Fe(d[0])}`},re=(e,t)=>{let[n,r,o,i]=t;if(n!==void 0)return 0;if(Number(o)>23||Number(i)>59)throw new l("malformed",`Not a valid offset: ${e}`);return(r==="-"?-1:1)*(Number(o)*60+Number(i))*I},Ae= exports.i =(e,t)=>{let n=Ne.exec(e);if(n===null)throw new l("malformed",`Not an ISO 8601 instant with an offset: ${e}`);let{millis:r}=N(e,n.slice(1,8));return ne(M(r-re(e,n.slice(8)),t),!1)},De=(e,t)=>{let n=JSON.stringify([e,t]),r=ee.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}),ee.set(n,r)),r},L= exports.j =(e,t,n)=>{let r=Me.exec(e);if(r===null)throw new l("malformed",`Not an ISO 8601 instant with an offset: ${e}`);let{millis:o}=N(e,[...r.slice(1,7),void 0]),i=o-re(e,r.slice(7));return M(i,n),De(t,n).format(i)};function ve(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>Object.hasOwn(t,r)?String(t[r]):n)}var _authcore = require('@aiquants/auth-core');var T=e=>e===""?"":` (${e})`,oe=(e,t)=>{if(e.status!==null&&_authcore.accessFailureKindOfStatus.call(void 0, e.status)!==null)throw new RangeError(`failureSentence: a ${e.status} is an access failure, which the root's presenter states (draw it with FailureMessage or ResourceFailed)`);return t(e.reason)},Be=(e,t)=>t===""?e:`${e} Reason: ${t}.`,He=(e,t)=>t===""?e:`${e}${t}\u3002`,S= exports.m ={en:{unmeasured:"Not measured",loading:"Loading",loadFailed:e=>`Could not load${T(e)}.`,refreshFailed:e=>`Could not refresh${T(e)}.`,forbiddenBecause:Be,failureSentence:oe,loadMore:e=>`Show ${e} more`,endOfRecords:"No more records",close:"Close",cancel:"Cancel",reload:"Reload",breadcrumb:"Breadcrumb",stepDone:"Done",stepPending:"Not started"},ja:{unmeasured:"\u672A\u6E2C\u5B9A",loading:"\u8AAD\u307F\u8FBC\u307F\u4E2D",loadFailed:e=>`\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F${T(e)}\u3002`,refreshFailed:e=>`\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F${T(e)}\u3002`,forbiddenBecause:He,failureSentence:oe,loadMore:e=>`\u3055\u3089\u306B ${e} \u4EF6\u3092\u8868\u793A`,endOfRecords:"\u3053\u308C\u4EE5\u4E0A\u306E\u8A18\u9332\u306F\u3042\u308A\u307E\u305B\u3093",close:"\u9589\u3058\u308B",cancel:"\u3084\u3081\u308B",reload:"\u518D\u8AAD\u307F\u8FBC\u307F",breadcrumb:"\u30D1\u30F3\u304F\u305A",stepDone:"\u5B8C\u4E86",stepPending:"\u672A\u7740\u624B"}},We= exports.n =e=>{if(!Object.hasOwn(S,e))throw new RangeError(`No console UI labels for locale "${e}"; supported: ${Object.keys(S).join(", ")}`);return S[e]};var ze=4,Ge=[1,2,3,4,6,8,12,16,24],Xe=16,je=5/4,$={caption:-2,body:-1,"body-lg":0,title:0,heading:1,display:2,"display-lg":3},Ye=11,ae=3/2,Ke=7/4,Ve=7/4,Je=120,qe=3/2,Ze=[1,2,3],ie= exports.p =e=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`A length must be a finite number of px at or above 0: ${e}`);return Math.ceil(e/4)*4},A=e=>{if(!Number.isInteger(e))throw new RangeError(`A type step must be an integer: ${e}`);return Math.max(Ye,Math.round(Xe*je**e))},D=(e,t)=>ie(e*t),se=D(A($.body),ae),b= exports.q =se+24,le= exports.r =b+8,de= exports.s =se+8,F={weight:{regular:400,medium:500,bold:700},radius:{"radius-control":4,"radius-item":8,"radius-container":12,"radius-pill":9999},stroke:{"border-width":1,"focus-width":2,"focus-offset":2,"marker-width":2}},Qe=()=>Object.fromEntries(Ge.map(e=>[`space-${e}`,e*4])),et=()=>{let e=Object.fromEntries(Object.entries($).map(([n,r])=>{let o=A(r);return[n,{size:o,lineHeight:D(o,n==="title"?Ve:ae)}]})),t=A($.body);return{...e,prose:{size:t,lineHeight:D(t,Ke)}}},tt=()=>Object.fromEntries(Ze.map(e=>[`motion-${e}`,Je*qe**(e-1)])),ce=e=>Object.freeze({space:Object.freeze(Qe()),type:Object.freeze(et()),weight:F.weight,radius:F.radius,size:Object.freeze({"size-target":b,"size-control":b,"size-row":b,"size-row-control":le,"size-row-compact":de}),stroke:F.stroke,motion:Object.freeze(tt()),color:Object.freeze({...e})});var nt={fg:{light:"#0f172b",dark:"#f8fafc"},"fg-secondary":{light:"#314158",dark:"#e2e8f0"},"fg-muted":{light:"#44536a",dark:"#cad5e2"},"danger-fg":{light:"#9f0712",dark:"#ffc9c9"},"warning-fg":{light:"#7b3306",dark:"#fee685"},"success-fg":{light:"#006045",dark:"#a4f4cf"},"info-fg":{light:"#193cb8",dark:"#bedbff"},"on-solid":{light:"#ffffff",dark:"#0f172b"},surface:{light:"#ffffff",dark:"#0f172b"},subtle:{light:"#f8fafc",dark:"#1d293d"},sunken:{light:"#f1f5f9",dark:"#020618"},"danger-tint":{light:"#fef2f2",dark:"#460809"},"warning-tint":{light:"#fffbeb",dark:"#461901"},"success-tint":{light:"#ecfdf5",dark:"#002c22"},"info-tint":{light:"#eff6ff",dark:"#162456"},"neutral-solid":{light:"#314158",dark:"#cad5e2"},"danger-solid":{light:"#9f0712",dark:"#ffa2a2"},"success-solid":{light:"#006045",dark:"#5ee9b5"},"info-solid":{light:"#193cb8",dark:"#8ec5ff"},"warning-solid":{light:"#7b3306",dark:"#ffd230"},"danger-accent":{light:"#e7000b",dark:"#ff6467"},"warning-accent":{light:"#bb4d00",dark:"#fcbb00"},"success-accent":{light:"#009966",dark:"#00d492"},"info-accent":{light:"#155dfc",dark:"#51a2ff"},focus:{light:"#155dfc",dark:"#51a2ff"},"border-control":{light:"#62748e",dark:"#90a1b9"},"border-subtle":{light:"#e2e8f0",dark:"#314158"}},a= exports.t =ce(nt),rt="--cui-",ot= exports.u =e=>`var(${rt}${e})`;var at=e=>e>=32&&e<=126||e>=65377&&e<=65500||e>=65512&&e<=65518,ue=(e,t)=>{let n=0,r=0;for(let o of e)at(o.codePointAt(0))?r+=1:n+=1;return n*1+r*t},h= exports.v =e=>ue(e,.55),x= exports.w =e=>ue(e,.6),u= exports.x =e=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`Length must be a finite px value >= 0: ${e}`);return Math.max(0,Math.ceil((e-1e-9)/8))*8};var me="caption",B="body",H=2*a.space["space-3"],fe={type:"caption",paddingInlinePx:2*a.space["space-2"]},v={type:"body",paddingInlinePx:2*a.space["space-3"]+2*a.stroke["border-width"],minInlinePx:a.size["size-control"]},ge={type:"body",minInlinePx:a.size["size-target"]},C={trackInlinePx:2*a.type.body.lineHeight+3*a.space["space-1"],labelGapPx:a.space["space-2"],type:"body"},U={captionType:"caption",valueType:"heading",paddingInlinePx:2*a.space["space-3"]},it=10,st="2000-01-01T00:00:00Z",lt=9999999,pe=(e,t,n)=>(t==="mono"?x(e):h(e))*a.type[n].size,dt=(e,t)=>{if(e.length===0)throw new RangeError(`A ${t} needs at least one text to be measured with`);for(let n of e)if(!f(n))throw new RangeError(`A ${t} sample must hold a readable character: ${JSON.stringify(n)}`);return e},c=(e,t,n,r)=>Math.max(...dt(e,t).map(o=>pe(o,n,r))),W= exports.y =e=>{switch(e.kind){case"text":return c(e.texts,"text",e.face,e.type);case"measured":return c(e.texts,"measured value","sans",B);case"pill":return c(e.labels,"pill","sans",fe.type)+fe.paddingInlinePx;case"button":return Math.max(v.minInlinePx,c(e.labels,"button","sans",v.type)+v.paddingInlinePx);case"link":return Math.max(ge.minInlinePx,c(e.labels,"link","sans",ge.type));case"switch":return e.labelHidden?C.trackInlinePx:C.trackInlinePx+C.labelGapPx+c(e.labels,"switch","sans",C.type);case"cluster":{if(e.items.length===0)throw new RangeError("A cluster needs at least one item to be measured with");return e.items.reduce((t,n)=>t+W(n),0)+(e.items.length-1)*a.space[e.gap]}}},ct= exports.z =(e,t)=>{let n=c([e.header],"column header","sans",me),r=e.note===void 0?0:c(e.note,"column header note","sans",me);return u(Math.max(n,r,...t.map(W))+H)},ut= exports.A =u(pe("\u3042".repeat(it),"sans",B)+H),mt= exports.B =e=>u(c(e,"comparison attribute","sans",B)+H),ft= exports.C =(e,t)=>L(st,e,t),gt= exports.D =(e,t)=>{if(t!==void 0&&!f(t))throw new RangeError(`A count sample's unit must hold a readable character: ${JSON.stringify(t)}`);return J(w(lt,e),t)},pt= exports.E =(e,t)=>u(Math.max(c(e,"tile caption","sans",U.captionType),c(t,"tile value","sans",U.valueType))+U.paddingInlinePx);var yt=.12,Tt=.16,bt=/[\u0020\u00a0\u1361\u{10100}\u{10101}\u{1039f}\u{1091f}]/u,k=a.space["space-3"],P= exports.F =(e,t)=>{let n=0,r=0;for(let i of e)n+=1,bt.test(i)&&(r+=1);return(t==="mono"?x(e):h(e))+yt*n+Tt*r},ht= exports.G =e=>{for(let n of[e.name,...e.notes])if(!f(n))throw new RangeError(`A figure node's name and notes must hold a readable character: ${JSON.stringify(n)}`);let t=Math.max(P(e.name,"sans")*a.type.body.size,...e.notes.map(n=>P(n,"sans")*a.type.caption.size));return{minWidthPx:u(t)+2*k,heightPx:2*k+a.type.body.lineHeight+e.notes.length*a.type.caption.lineHeight}},cn= exports.H =e=>{let t=k+a.type.body.lineHeight;return{insetPx:k,namePx:k+a.type.body.lineHeight/2,notesPx:Array.from({length:e},(n,r)=>t+r*a.type.caption.lineHeight+a.type.caption.lineHeight/2)}},xt= exports.I =(e,t)=>{if(e!==null&&!f(e))throw new RangeError(`A disc's name must hold a readable character: ${JSON.stringify(e)}`);if(!(Number.isFinite(t)&&t>0))throw new RangeError(`A disc's radius must be a positive finite px value: ${t}`);return e===null?{widthPx:0,extentBelowPx:t+ye}:{widthPx:u(P(e,"sans")*a.type.caption.size),extentBelowPx:t+a.space["space-1"]+a.type.caption.lineHeight}},ye= exports.J =a.stroke["focus-offset"]+a.stroke["focus-width"],un= exports.K =a.stroke["focus-offset"]+a.stroke["focus-width"]/2;var _=(1+Math.sqrt(5))/2,kt= exports.L =(e,t)=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`A length must be a finite number of px at or above 0: ${e}`);if(!(Number.isInteger(t)&&t>=0))throw new RangeError(`A golden section step must be an integer at or above 0: ${t}`);return e/_**t};var Rt=e=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`Length must be a finite px value >= 0: ${e}`);return e},m= exports.M =e=>`${Rt(e)/16}rem`;var Te=({masterMinPx:e,detailMinPx:t,gapPx:n})=>{for(let r of[e,t])if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Pane minimum must be a positive px value: ${r}`);if(!(Number.isFinite(n)&&n>=0))throw new RangeError(`Gap must be a px value >= 0: ${n}`);return e+n+t},Et= exports.N =(e,t)=>{let n=Te(t);if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`Container width must be a px value >= 0: ${e}`);if(e<n)return{sideBySide:!1,sideBySideFromPx:n,masterInlinePx:e,detailInlinePx:e};let r=(e-t.gapPx)/(1+_),o=Math.min(Math.max(t.masterMinPx,r),e-t.gapPx-t.detailMinPx);return{sideBySide:!0,sideBySideFromPx:n,masterInlinePx:o,detailInlinePx:e-t.gapPx-o}},Tn= exports.O =e=>{let t=Te(e),n=`cui-master-detail-m${e.masterMinPx}-d${e.detailMinPx}-g${e.gapPx}`,r=`[data-cui-master-detail="${n}"]`,o=m(e.gapPx),i=`${r}{grid-template-columns:minmax(0,1fr);gap:${o}}`,d=`clamp(${m(e.masterMinPx)},calc((100% - ${o}) / ${1+_}),calc(100% - ${o} - ${m(e.detailMinPx)}))`,s=`@container (min-width:${m(t)}){${r}{grid-template-columns:${d} minmax(0,1fr)}}`;return{key:n,css:i+s}};var St=2*a.space["space-1"],be=e=>{if(!(Number.isFinite(e)&&e>0))throw new RangeError(`Column width must be a positive px value: ${e}`);return e},he= exports.P =e=>{if(e.length===0)throw new RangeError("A table needs at least one column");let t=0,n=null;for(let{width:r}of e){if(r.fixedPx!==void 0){t+=be(r.fixedPx);continue}let o=be(r.minPx);if(n!==null&&n!==o)throw new RangeError(`Flexible columns share the remaining width equally, so their minimums must be equal: ${n} and ${o}`);n=o,t+=o}return t},Ct= exports.Q =e=>he(e)+St;var Pt=(e,t,n)=>{if(!(Number.isSafeInteger(e)&&e>0))throw new RangeError(`Tile count must be a positive integer: ${e}`);if(!(Number.isFinite(t)&&t>0))throw new RangeError(`Tile minimum width must be a positive px value: ${t}`);if(!(Number.isFinite(n)&&n>=0))throw new RangeError(`Tile gap must be a px value >= 0: ${n}`);let r=[];for(let s=1;s<=e;s+=1)e%s===0&&r.push({columns:s,minContainerPx:s*t+(s-1)*n});let o=`cui-tiles-n${e}-m${t}-g${n}`,i=`[data-cui-tile-grid="${o}"]`,d=r.map(({columns:s,minContainerPx:R})=>{let p=`${i}{grid-template-columns:repeat(${s},minmax(0,1fr))}`;return s===1?p:`@container (min-width:${m(R)}){${p}}`});return{key:o,steps:r,css:d.join("")}};var _t=403,wt= exports.T =(e,t)=>e.ok?{ok:!0,value:t(e.value)}:e,Ot= exports.U =(e,t)=>e.ok?t(e.value):e,En= exports.V ={kind:"idle"},It= exports.W ={kind:"loading"},z= exports.X =(e,t)=>e.kind==="ready"?{...e,refreshing:!0}:e.kind==="failed"?t==="reload"?{...e,retrying:!0}:e:It,G= exports.Y =(e,t)=>t.ok?{kind:"ready",value:t.value,refreshing:!1,refreshFailure:null}:e.kind==="failed"&&e.status===403?e.retrying?{...e,retrying:!1}:e:e.kind==="ready"&&t.status!==403?{kind:"ready",value:e.value,refreshing:!1,refreshFailure:{status:t.status,reason:t.reason}}:{kind:"failed",status:t.status,reason:t.reason,occurrence:e.kind==="failed"?e.occurrence+1:1,retrying:!1};var Nt=(e,t)=>{let n=z(e,t);return n.kind==="ready"?{...n,value:{...n.value,loadingMore:!1}}:n},Mt= exports._ =(e,t)=>G(e,t.ok?{ok:!0,value:{rows:t.value.rows,next:t.value.next,meta:t.value.meta,loadingMore:!1,moreFailure:null}}:t),Lt= exports.$ =e=>e.kind==="ready"&&!e.refreshing&&e.value.next!==null&&!e.value.loadingMore?{...e,value:{...e.value,loadingMore:!0}}:e,Ft= exports.aa =(e,t,n)=>{if(!(e.kind==="ready"&&e.value.loadingMore&&Object.is(e.value.next,t)))return e;if(n.ok)return{...e,value:{...e.value,rows:[...e.value.rows,...n.value.rows],next:n.value.next,loadingMore:!1,moreFailure:null}};let r=e.value.moreFailure===null?1:e.value.moreFailure.occurrence+1;return{...e,value:{...e.value,loadingMore:!1,moreFailure:{reason:n.reason,occurrence:r}}}},$t= exports.ba =(e,t)=>{if(e.kind!=="ready")return e;let{rows:n,meta:r}=t({rows:e.value.rows,meta:e.value.meta});return{...e,value:{...e.value,rows:n,meta:r}}};var At=/^#[0-9a-f]{6}$/i,Dt=/^[a-z][a-z0-9-]*$/,xe=e=>{if(!At.test(e))throw new RangeError(`A palette colour must be #rrggbb: ${e}`);return e},ke= exports.ca =({light:e,dark:t})=>`light-dark(${xe(e)}, ${xe(t)})`,vt= exports.da =e=>{if(!Dt.test(e))throw new RangeError(`A root attribute must be lowercase letters, digits and hyphens, starting with a letter: ${e}`);return`[${e}] ::placeholder { color: ${ke(a.color["fg-muted"])}; opacity: 1; }`};var Re=["indigo","violet","purple","fuchsia","pink","rose","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue"],Ut= exports.fa =["fg","tint","accent","line","solid","solid-hover"],Bt={indigo:{fg:{light:"#372aac",dark:"#c6d2ff"},tint:{light:"#eff3ff",dark:"#1e1a4d"},accent:{light:"#4f39f6",dark:"#7c86ff"}},violet:{fg:{light:"#5d0ec0",dark:"#ddd6ff"},tint:{light:"#f5f3ff",dark:"#2f0d68"},accent:{light:"#7f22fe",dark:"#a684ff"}},purple:{fg:{light:"#6e11b0",dark:"#e9d4ff"},tint:{light:"#faf5ff",dark:"#3c0366"},accent:{light:"#9810fa",dark:"#c27aff"}},fuchsia:{fg:{light:"#8a0194",dark:"#f6cfff"},tint:{light:"#fdf4ff",dark:"#4b004f"},accent:{light:"#c800de",dark:"#ed6aff"}},pink:{fg:{light:"#a3004c",dark:"#fccee8"},tint:{light:"#fdf2f8",dark:"#510424"},accent:{light:"#e60076",dark:"#fb64b6"}},rose:{fg:{light:"#a50036",dark:"#ffccd3"},tint:{light:"#fff1f2",dark:"#4d0218"},accent:{light:"#ec003f",dark:"#ff637e"}},red:{fg:{light:"#9f0712",dark:"#ffc9c9"},tint:{light:"#fef2f2",dark:"#460809"},accent:{light:"#e7000b",dark:"#ff6467"}},orange:{fg:{light:"#7e2a0c",dark:"#ffd6a7"},tint:{light:"#fff7ed",dark:"#441306"},accent:{light:"#f54900",dark:"#ff8904"}},amber:{fg:{light:"#7b3306",dark:"#fee685"},tint:{light:"#fffbeb",dark:"#461901"},accent:{light:"#bb4d00",dark:"#fcbb00"}},yellow:{fg:{light:"#733e0a",dark:"#fff085"},tint:{light:"#fefce8",dark:"#432004"},accent:{light:"#a65f00",dark:"#fdc700"}},lime:{fg:{light:"#35530e",dark:"#d8f999"},tint:{light:"#f7fee7",dark:"#192e03"},accent:{light:"#497d00",dark:"#9ae600"}},green:{fg:{light:"#0d542b",dark:"#b9f8cf"},tint:{light:"#f0fdf4",dark:"#032e15"},accent:{light:"#008236",dark:"#05df72"}},emerald:{fg:{light:"#004f3b",dark:"#a4f4cf"},tint:{light:"#ecfdf5",dark:"#002c22"},accent:{light:"#009966",dark:"#00d492"}},teal:{fg:{light:"#0b4f4a",dark:"#96f7e4"},tint:{light:"#f0fdfa",dark:"#022f2e"},accent:{light:"#009689",dark:"#00d5be"}},cyan:{fg:{light:"#104e64",dark:"#a2f4fd"},tint:{light:"#ecfeff",dark:"#053345"},accent:{light:"#0092b8",dark:"#00d3f2"}},sky:{fg:{light:"#024a70",dark:"#b8e6fe"},tint:{light:"#f0f9ff",dark:"#052f4a"},accent:{light:"#0084d1",dark:"#00bcff"}},blue:{fg:{light:"#193cb8",dark:"#bedbff"},tint:{light:"#eff6ff",dark:"#162456"},accent:{light:"#155dfc",dark:"#51a2ff"}}},y=({light:e,dark:t})=>Object.freeze({light:e,dark:t}),Ht=({fg:e,tint:t,accent:n})=>Object.freeze({fg:y(e),tint:y(t),accent:y(n),line:y({light:e.dark,dark:e.light}),solid:y(e),"solid-hover":y({light:t.dark,dark:t.light})}),Wt= exports.ga =Object.freeze(Object.fromEntries(Re.map(e=>[e,Ht(Bt[e])])));exports.a = w; exports.b = Se; exports.c = J; exports.d = q; exports.e = we; exports.f = f; exports.g = l; exports.h = $e; exports.i = Ae; exports.j = L; exports.k = ve; exports.l = T; exports.m = S; exports.n = We; exports.o = ze; exports.p = ie; exports.q = b; exports.r = le; exports.s = de; exports.t = a; exports.u = ot; exports.v = h; exports.w = x; exports.x = u; exports.y = W; exports.z = ct; exports.A = ut; exports.B = mt; exports.C = ft; exports.D = gt; exports.E = pt; exports.F = P; exports.G = ht; exports.H = cn; exports.I = xt; exports.J = ye; exports.K = un; exports.L = kt; exports.M = m; exports.N = Et; exports.O = Tn; exports.P = he; exports.Q = Ct; exports.R = Pt; exports.S = _t; exports.T = wt; exports.U = Ot; exports.V = En; exports.W = It; exports.X = z; exports.Y = G; exports.Z = Nt; exports._ = Mt; exports.$ = Lt; exports.aa = Ft; exports.ba = $t; exports.ca = ke; exports.da = vt; exports.ea = Re; exports.fa = Ut; exports.ga = Wt;
package/dist/core.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkK7BETTSLcjs = require('./chunk-K7BETTSL.cjs');var _chunk7M4I26BScjs = require('./chunk-7M4I26BS.cjs');exports.COMPACT_ROW_PX = _chunkK7BETTSLcjs.z; exports.CONSOLE_UI_LABEL_CATALOGS = _chunkK7BETTSLcjs.t; exports.CONTRAST_MINIMUM = _chunk7M4I26BScjs.c; exports.CONTRAST_PAIRS = _chunk7M4I26BScjs.d; exports.FIGURE_RING_REACH_PX = _chunkK7BETTSLcjs.Q; exports.FLEXIBLE_COLUMN_MIN_PX = _chunkK7BETTSLcjs.H; exports.HTTP_FORBIDDEN = _chunkK7BETTSLcjs.l; exports.LATTICE_PX = _chunkK7BETTSLcjs.v; exports.ROW_WITH_CONTROL_PX = _chunkK7BETTSLcjs.y; exports.TARGET_PX = _chunkK7BETTSLcjs.x; exports.TOKENS = _chunkK7BETTSLcjs.A; exports.TONES = _chunkK7BETTSLcjs.ga; exports.TONE_HUES = _chunkK7BETTSLcjs.ea; exports.TONE_ROLES = _chunkK7BETTSLcjs.fa; exports.ZonedTimeError = _chunkK7BETTSLcjs.g; exports.beginPage = _chunkK7BETTSLcjs.$; exports.beginPagedReload = _chunkK7BETTSLcjs.Z; exports.beginReload = _chunkK7BETTSLcjs.q; exports.ceil8 = _chunkK7BETTSLcjs.E; exports.ceilToLattice = _chunkK7BETTSLcjs.w; exports.cellContentInlinePx = _chunkK7BETTSLcjs.F; exports.comparisonAttributePx = _chunkK7BETTSLcjs.I; exports.contrastRatio = _chunk7M4I26BScjs.b; exports.countSampleText = _chunkK7BETTSLcjs.K; exports.cssVar = _chunkK7BETTSLcjs.B; exports.figureBoxPlan = _chunkK7BETTSLcjs.N; exports.figureDiscLabelPlan = _chunkK7BETTSLcjs.P; exports.fillLabel = _chunkK7BETTSLcjs.k; exports.fixedColumnPx = _chunkK7BETTSLcjs.G; exports.flatMapOutcome = _chunkK7BETTSLcjs.n; exports.formatByteSize = _chunkK7BETTSLcjs.b; exports.formatCount = _chunkK7BETTSLcjs.a; exports.formatInstant = _chunkK7BETTSLcjs.j; exports.goldenSectionPx = _chunkK7BETTSLcjs.S; exports.hexToSrgb = _chunk7M4I26BScjs.a; exports.instantSampleText = _chunkK7BETTSLcjs.J; exports.isReadableText = _chunkK7BETTSLcjs.f; exports.keepLastGood = _chunkK7BETTSLcjs.r; exports.lightDark = _chunkK7BETTSLcjs.ca; exports.mapOutcome = _chunkK7BETTSLcjs.m; exports.mapPagedList = _chunkK7BETTSLcjs.ba; exports.masterDetailPlan = _chunkK7BETTSLcjs.U; exports.monoTextWidthEm = _chunkK7BETTSLcjs.D; exports.placeholderRule = _chunkK7BETTSLcjs.da; exports.pxToRem = _chunkK7BETTSLcjs.T; exports.readDecimalText = _chunkK7BETTSLcjs.d; exports.readIntegerText = _chunkK7BETTSLcjs.e; exports.reasonAside = _chunkK7BETTSLcjs.s; exports.resolveConsoleUiLabels = _chunkK7BETTSLcjs.u; exports.settleFirstPage = _chunkK7BETTSLcjs._; exports.settlePage = _chunkK7BETTSLcjs.aa; exports.spacedTextWidthEm = _chunkK7BETTSLcjs.M; exports.tableFrameMinInlinePx = _chunkK7BETTSLcjs.X; exports.tableMinInlinePx = _chunkK7BETTSLcjs.W; exports.textWidthEm = _chunkK7BETTSLcjs.C; exports.tileGridPlan = _chunkK7BETTSLcjs.Y; exports.tileMinInlinePx = _chunkK7BETTSLcjs.L; exports.toOffsetIso = _chunkK7BETTSLcjs.h; exports.toWallTime = _chunkK7BETTSLcjs.i;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWUST5VT6cjs = require('./chunk-WUST5VT6.cjs');var _chunk7M4I26BScjs = require('./chunk-7M4I26BS.cjs');exports.COMPACT_ROW_PX = _chunkWUST5VT6cjs.s; exports.CONSOLE_UI_LABEL_CATALOGS = _chunkWUST5VT6cjs.m; exports.CONTRAST_MINIMUM = _chunk7M4I26BScjs.c; exports.CONTRAST_PAIRS = _chunk7M4I26BScjs.d; exports.FIGURE_RING_REACH_PX = _chunkWUST5VT6cjs.J; exports.FLEXIBLE_COLUMN_MIN_PX = _chunkWUST5VT6cjs.A; exports.HTTP_FORBIDDEN = _chunkWUST5VT6cjs.S; exports.LATTICE_PX = _chunkWUST5VT6cjs.o; exports.ROW_WITH_CONTROL_PX = _chunkWUST5VT6cjs.r; exports.TARGET_PX = _chunkWUST5VT6cjs.q; exports.TOKENS = _chunkWUST5VT6cjs.t; exports.TONES = _chunkWUST5VT6cjs.ga; exports.TONE_HUES = _chunkWUST5VT6cjs.ea; exports.TONE_ROLES = _chunkWUST5VT6cjs.fa; exports.ZonedTimeError = _chunkWUST5VT6cjs.g; exports.beginPage = _chunkWUST5VT6cjs.$; exports.beginPagedReload = _chunkWUST5VT6cjs.Z; exports.beginReload = _chunkWUST5VT6cjs.X; exports.ceil8 = _chunkWUST5VT6cjs.x; exports.ceilToLattice = _chunkWUST5VT6cjs.p; exports.cellContentInlinePx = _chunkWUST5VT6cjs.y; exports.comparisonAttributePx = _chunkWUST5VT6cjs.B; exports.contrastRatio = _chunk7M4I26BScjs.b; exports.countSampleText = _chunkWUST5VT6cjs.D; exports.cssVar = _chunkWUST5VT6cjs.u; exports.figureBoxPlan = _chunkWUST5VT6cjs.G; exports.figureDiscLabelPlan = _chunkWUST5VT6cjs.I; exports.fillLabel = _chunkWUST5VT6cjs.k; exports.fixedColumnPx = _chunkWUST5VT6cjs.z; exports.flatMapOutcome = _chunkWUST5VT6cjs.U; exports.formatByteSize = _chunkWUST5VT6cjs.b; exports.formatCount = _chunkWUST5VT6cjs.a; exports.formatInstant = _chunkWUST5VT6cjs.j; exports.goldenSectionPx = _chunkWUST5VT6cjs.L; exports.hexToSrgb = _chunk7M4I26BScjs.a; exports.instantSampleText = _chunkWUST5VT6cjs.C; exports.isReadableText = _chunkWUST5VT6cjs.f; exports.keepLastGood = _chunkWUST5VT6cjs.Y; exports.lightDark = _chunkWUST5VT6cjs.ca; exports.mapOutcome = _chunkWUST5VT6cjs.T; exports.mapPagedList = _chunkWUST5VT6cjs.ba; exports.masterDetailPlan = _chunkWUST5VT6cjs.N; exports.monoTextWidthEm = _chunkWUST5VT6cjs.w; exports.placeholderRule = _chunkWUST5VT6cjs.da; exports.pxToRem = _chunkWUST5VT6cjs.M; exports.readDecimalText = _chunkWUST5VT6cjs.d; exports.readIntegerText = _chunkWUST5VT6cjs.e; exports.reasonAside = _chunkWUST5VT6cjs.l; exports.resolveConsoleUiLabels = _chunkWUST5VT6cjs.n; exports.settleFirstPage = _chunkWUST5VT6cjs._; exports.settlePage = _chunkWUST5VT6cjs.aa; exports.spacedTextWidthEm = _chunkWUST5VT6cjs.F; exports.tableFrameMinInlinePx = _chunkWUST5VT6cjs.Q; exports.tableMinInlinePx = _chunkWUST5VT6cjs.P; exports.textWidthEm = _chunkWUST5VT6cjs.v; exports.tileGridPlan = _chunkWUST5VT6cjs.R; exports.tileMinInlinePx = _chunkWUST5VT6cjs.E; exports.toOffsetIso = _chunkWUST5VT6cjs.h; exports.toWallTime = _chunkWUST5VT6cjs.i;
package/dist/core.d.cts CHANGED
@@ -22,7 +22,7 @@ type ConsoleUiLabels = {
22
22
  readonly failureSentence: (failure: {
23
23
  readonly status: number | null;
24
24
  readonly reason: string;
25
- }, refusal: string, failed: (reason: string) => string) => string;
25
+ }, failed: (reason: string) => string) => string;
26
26
  readonly loadMore: (limit: string) => string;
27
27
  readonly endOfRecords: string;
28
28
  readonly close: string;
package/dist/core.d.ts CHANGED
@@ -22,7 +22,7 @@ type ConsoleUiLabels = {
22
22
  readonly failureSentence: (failure: {
23
23
  readonly status: number | null;
24
24
  readonly reason: string;
25
- }, refusal: string, failed: (reason: string) => string) => string;
25
+ }, failed: (reason: string) => string) => string;
26
26
  readonly loadMore: (limit: string) => string;
27
27
  readonly endOfRecords: string;
28
28
  readonly close: string;
package/dist/core.js CHANGED
@@ -1 +1 @@
1
- import{$ as V,A as x,B as y,C as z,D as A,E as B,F as C,G as D,H as E,I as F,J as G,K as H,L as I,M as J,N as K,P as L,Q as M,S as N,T as O,U as P,W as Q,X as R,Y as S,Z as T,_ as U,a,aa as W,b,ba as X,ca as aa,d as c,da as ba,e as d,ea as ca,f as e,fa as da,g as f,ga as ea,h as g,i as h,j as i,k as j,l as k,m as l,n as m,q as n,r as o,s as p,t as q,u as r,v as s,w as t,x as u,y as v,z as w}from"./chunk-5TR7VUZM.js";import{a as Y,b as Z,c as _,d as $}from"./chunk-FXEGLGL7.js";export{w as COMPACT_ROW_PX,q as CONSOLE_UI_LABEL_CATALOGS,_ as CONTRAST_MINIMUM,$ as CONTRAST_PAIRS,M as FIGURE_RING_REACH_PX,E as FLEXIBLE_COLUMN_MIN_PX,k as HTTP_FORBIDDEN,s as LATTICE_PX,v as ROW_WITH_CONTROL_PX,u as TARGET_PX,x as TOKENS,ea as TONES,ca as TONE_HUES,da as TONE_ROLES,f as ZonedTimeError,V as beginPage,T as beginPagedReload,n as beginReload,B as ceil8,t as ceilToLattice,C as cellContentInlinePx,F as comparisonAttributePx,Z as contrastRatio,H as countSampleText,y as cssVar,K as figureBoxPlan,L as figureDiscLabelPlan,j as fillLabel,D as fixedColumnPx,m as flatMapOutcome,b as formatByteSize,a as formatCount,i as formatInstant,N as goldenSectionPx,Y as hexToSrgb,G as instantSampleText,e as isReadableText,o as keepLastGood,aa as lightDark,l as mapOutcome,X as mapPagedList,P as masterDetailPlan,A as monoTextWidthEm,ba as placeholderRule,O as pxToRem,c as readDecimalText,d as readIntegerText,p as reasonAside,r as resolveConsoleUiLabels,U as settleFirstPage,W as settlePage,J as spacedTextWidthEm,R as tableFrameMinInlinePx,Q as tableMinInlinePx,z as textWidthEm,S as tileGridPlan,I as tileMinInlinePx,g as toOffsetIso,h as toWallTime};
1
+ import{$ as V,A as z,B as A,C as B,D as C,E as D,F as E,G as F,I as G,J as H,L as I,M as J,N as K,P as L,Q as M,R as N,S as O,T as P,U as Q,X as R,Y as S,Z as T,_ as U,a,aa as W,b,ba as X,ca as aa,d as c,da as ba,e as d,ea as ca,f as e,fa as da,g as f,ga as ea,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t,v as u,w as v,x as w,y as x,z as y}from"./chunk-H4DAGEIG.js";import{a as Y,b as Z,c as _,d as $}from"./chunk-FXEGLGL7.js";export{r as COMPACT_ROW_PX,l as CONSOLE_UI_LABEL_CATALOGS,_ as CONTRAST_MINIMUM,$ as CONTRAST_PAIRS,H as FIGURE_RING_REACH_PX,z as FLEXIBLE_COLUMN_MIN_PX,O as HTTP_FORBIDDEN,n as LATTICE_PX,q as ROW_WITH_CONTROL_PX,p as TARGET_PX,s as TOKENS,ea as TONES,ca as TONE_HUES,da as TONE_ROLES,f as ZonedTimeError,V as beginPage,T as beginPagedReload,R as beginReload,w as ceil8,o as ceilToLattice,x as cellContentInlinePx,A as comparisonAttributePx,Z as contrastRatio,C as countSampleText,t as cssVar,F as figureBoxPlan,G as figureDiscLabelPlan,j as fillLabel,y as fixedColumnPx,Q as flatMapOutcome,b as formatByteSize,a as formatCount,i as formatInstant,I as goldenSectionPx,Y as hexToSrgb,B as instantSampleText,e as isReadableText,S as keepLastGood,aa as lightDark,P as mapOutcome,X as mapPagedList,K as masterDetailPlan,v as monoTextWidthEm,ba as placeholderRule,J as pxToRem,c as readDecimalText,d as readIntegerText,k as reasonAside,m as resolveConsoleUiLabels,U as settleFirstPage,W as settlePage,E as spacedTextWidthEm,M as tableFrameMinInlinePx,L as tableMinInlinePx,u as textWidthEm,N as tileGridPlan,D as tileMinInlinePx,g as toOffsetIso,h as toWallTime};