@aiquants/console-ui 0.7.2 → 0.8.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
@@ -19,13 +19,14 @@ pnpm add @aiquants/console-ui
19
19
  | Import path | Contents |
20
20
  | --- | --- |
21
21
  | `@aiquants/console-ui` | Components and hooks; re-exports everything from `@aiquants/console-ui/core`. |
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/core` | React-free: the tokens with the geometry of their formulas and the contrast computation, the topmost open modal dialog of a document, 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. |
23
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. |
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
+ | `@aiquants/console-ui/styles/console-ui.css` | The stylesheet: the token variables on `[data-cui-root]` (and their more-contrast colours on `[data-cui-root][data-cui-contrast="more"]`) and the component rules, all inside `@layer cui`. |
25
25
 
26
26
  The `/core` exports:
27
27
 
28
- - Tokens and contrast: `TOKENS`, `cssVar`, `contrastRatio`, `hexToSrgb`, `CONTRAST_PAIRS`, `CONTRAST_MINIMUM`, and the types `ColorScheme`, `SchemeColor` and `MotionToken` beside the other token names.
28
+ - Tokens and contrast: `TOKENS` (its `moreContrastColor` is the more-contrast palette), `cssVar`, `contrastRatio`, `hexToSrgb`, `CONTRAST_PAIRS`, `CONTRAST_MINIMUM`, `MORE_CONTRAST_MINIMUM`, and the types `ColorScheme`, `ContrastLevel`, `PaletteName`, `SchemeColor`, `Measure`, `MeasureToken` and `MotionToken` beside the other token names.
29
+ - The topmost modal dialog (see Focus and announcements): `topmostModalOf(document)` and the type `TopmostModal`.
29
30
  - Tones and the CSS text of a colour (see Tokens and colours): `TONES`, `TONE_HUES`, `TONE_ROLES` and the types `Tone`, `ToneHue` and `ToneRole`; `lightDark(color)` and `placeholderRule(rootAttribute)`.
30
31
  - The geometry the tokens are computed on: `LATTICE_PX` (4), `TARGET_PX` (44), `ROW_WITH_CONTROL_PX` (52), `COMPACT_ROW_PX` (28) and `ceilToLattice(px)` (the smallest lattice multiple at or above a length).
31
32
  - Layout arithmetic: `textWidthEm`, `monoTextWidthEm` (the type `TextFace` names the face each model sizes), `ceil8`, `tileGridPlan`, `tableMinInlinePx`, `tableFrameMinInlinePx` (the narrowest a `DataTable` is while its table shows without scrolling: the table's minimum and the scroll frame's 4 px inline padding on both sides), `masterDetailPlan`.
@@ -109,7 +110,7 @@ export const Console = ({ orphanCount, openSignIn }: { orphanCount: number | nul
109
110
  const accessFailure = useCallback<AccessFailurePresenter<ReactNode>>(
110
111
  (occurrence) => (
111
112
  <AccessFailureNotice
112
- view={accessFailureView(occurrence, { keepsWork: true }, ACCESS_FAILURE_LABELS)}
113
+ view={accessFailureView(occurrence, { signedIn: true, keepsWork: true }, ACCESS_FAILURE_LABELS)}
113
114
  handlers={{ "sign-in-again-in-new-window": openSignIn, ...(occurrence.retry === null ? {} : { retry: occurrence.retry }) }}
114
115
  testId="access-failure"
115
116
  />
@@ -129,10 +130,13 @@ export const Console = ({ orphanCount, openSignIn }: { orphanCount: number | nul
129
130
  `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
131
  `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
132
  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
+ So the host decides once, for the whole console, the texts (its own catalog, `resolveAccessFailureLabels` of `@aiquants/auth-core`), whether it knows the reader is signed in (`signedIn`: a console behind a sign-in passes `true`, so a 401 of a read or a write reads as an expired sign-in; with `false` it asks the reader to sign in), whether work in progress survives signing in again (`keepsWork`: in a new window, the screen stays as it is; only with `signedIn: true`) and where each action leads.
134
+ 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
135
  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.
134
136
  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).
135
137
  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.
138
+ `contrast` picks the contrast of the palette: `"standard"` (the default) or `"more"`, the more-contrast palette (see Tokens and colours). It is written to the root's `data-cui-contrast`, and any other value throws `RangeError` when the root renders instead of drawing the standard palette silently.
139
+ A host with a contrast setting of its own maps that setting here; a host that follows the operating system passes `"more"` while `prefers-contrast: more` matches. Forced-colors mode (Windows high contrast) is not this setting: there the browser replaces the palette with system colours whatever `contrast` is (see Tokens and colours).
136
140
 
137
141
  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.
138
142
  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.
@@ -147,13 +151,19 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
147
151
  - a 4 px lattice (`LATTICE_PX`) and the spaces 4, 8, 12, 16, 24, 32, 48, 64 and 96 (`space-1` … `space-24`, multipliers whose prime factors are 2 and 3);
148
152
  - type steps of round(16 × 1.25^k) px, never below 11 px, each line the smallest lattice multiple at or above 1.5 times its size (WCAG 1.4.8; `title`, beside controls, and `prose`, the reading line, at 1.75): `caption` 11/20, `body` 13/20, `prose` 13/24, `body-lg` 16/24 (the body of a surface read at length, such as a conversation or an article: the 16 px base step with the 1.5 line), `title` 16/28, `heading` 20/32, `display` 25/40, `display-lg` 31/48;
149
153
  - the 44 px target (`TARGET_PX`: a `body` line with 12 px above and below), which is also the height of a control and of a table row (`size-target`, `size-control`, `size-row`), the 52 px row that holds a control (`ROW_WITH_CONTROL_PX`: the target with one lattice unit above and below, `size-row-control`) and the 28 px compact row of a read-only line table (`COMPACT_ROW_PX`: a `body` line with one lattice unit above and below, `size-row-compact`);
150
- - motion of 120, 180 and 270 ms (`motion-1` … `motion-3`, 120 × 1.5^(k − 1)).
154
+ - motion of 120, 180 and 270 ms (`motion-1` … `motion-3`, 120 × 1.5^(k − 1));
155
+ - the dialog's measure `measure-dialog`, `calc(40ic + 2 * var(--cui-space-6))`: a paragraph of 40 ideographs (WCAG 1.4.8 keeps a CJK line at or below 40 characters; `ic` is the font's own ideograph advance) and the dialog's inset of 24 on both sides, its border included. It is the width of a `Dialog`, and a host that draws a box of the same outer width (an empty state's card) reads the same variable instead of copying the formula.
151
156
  Only the 20 px lines (`caption` and `body`) and the 28 px `title` line, whose difference from 44 is a multiple of 8, can be centred in a 44 px box on the lattice, and every control draws its text in `body` or `title`, except a compact `SegmentedControl` (a band of supplementary controls), whose 28 px faces draw `caption` text inside 44 px targets.
152
157
  - The token variables are declared on `[data-cui-root]` (never `:root`) with lengths in rem, the strokes (`border-width` 1, `focus-width` 2, `focus-offset` 2, `marker-width` 2) in px and the durations in ms. A browser snaps a used border width down to whole device pixels, so a rem stroke would leave the paddings that compensate for the border (`calc(… - var(--cui-border-width))`) off the lattice for a reader who enlarges the root font size; in px every lattice measure scales exactly with the root font size around a 1 px border.
153
158
  - Every duration is read from the `--cui-motion-*` variables, which are `0ms` while the reader prefers reduced motion (`prefers-reduced-motion: reduce`), so a component that moves stops without a rule of its own; no rule writes a duration by hand, and the indeterminate progress segment sweeps only for a reader who allows motion.
154
159
  - Text and surface colours are applied through role attributes only. `data-cui-fg` paints text, `data-cui-surface` paints the surface text sits on, `data-cui-accent` paints non-text graphics, `data-cui-fill` paints the surface of a figure's shape (always the surface of the shape's group, which its text is measured on) and `data-cui-stroke` a figure's lines. Every role has a light and a dark value, written as `light-dark(<light>, <dark>)` (see Wrapping a console for the scheme). `CONTRAST_PAIRS.light` and `CONTRAST_PAIRS.dark` list the same pairs: for every role,
155
160
  the surfaces it may be drawn on with the WCAG 2 ratio on each in that scheme.
156
161
  Every pair meets AAA (`CONTRAST_MINIMUM`: 7 for text, 4.5 for large text, 3 for non-text; the lowest text and non-text ratios are 7.12 and 3.47 in the light scheme, 9.29 and 5.54 in the dark one), and a pair not in the table is never drawn. `Text` is the only component that paints caller text, and it paints only through a text role.
162
+ - `TOKENS.moreContrastColor` is the more-contrast palette, which a root with `contrast="more"` draws: the rule `[data-cui-root][data-cui-contrast="more"]` gives every colour variable its more-contrast value, so every component takes it with no rule of its own. It is not a second choice but derived from the palette by one rule.
163
+ The surfaces keep their colours. Every role drawn on them moves along its own hue toward black or white, whichever is farther from its surfaces, until its ratio on the surface it stands out from least is the geometric mean of its standard ratio there and the ratio of black or white there: half the way, on the logarithmic scale of the ratio, to the strongest colour it could have on that surface. The move is a mix in OKLab, which keeps the hue angle (a mix in linear sRGB toward white turns an amber into a pink), and a colour already at its end (white text on the light scheme's solid fills) stays.
164
+ `CONTRAST_PAIRS.contrastLight` and `CONTRAST_PAIRS.contrastDark` list the same pairs as the standard tables, every one at `MORE_CONTRAST_MINIMUM` (7 for text, 4.5 for large text and for non-text) and none below its standard ratio; the lowest text ratio is 7.61 in the light scheme and 10.09 in the dark one, and the lowest non-text ratios are 8.35 and 9.
165
+ The light scheme's 7.61 is white `on-solid` text on `success-solid`, the same pair as in the standard palette: white is already at its end and the solid fills are surfaces, which keep their colours. Every other text role of the light scheme reaches 11.64 at least.
166
+ The decorative `border-subtle` is raised too, to at least 4.67 (light) and 4.53 (dark) on `surface`, `subtle` and `sunken`, so every edge of a card, a table or a dialog stands out.
157
167
  - The remaining colours are fixed non-text graphics, each drawn against listed surfaces of `CONTRAST_PAIRS`: the control border (`border-control`) of inputs, secondary buttons, segments (a compact segment's face) and the switch's track, the slider's rail and a pending step's ring, the invalid border (`danger-accent`), the selected-row band, the radio mark, the current tab's marker and the slider's thumb (`info-accent`), and the focus ring (`focus`).
158
168
  A figure's lines are the same roles (see Figures): a node's plate line on both the figure's `surface` and its own face (`border-control` on `surface` 4.76 / 6.78; `info-accent` 5.25 / 6.76 and 4.82 / 5.6 on `info-tint`; `success-accent` 3.65 / 9.2 and 3.47 / 7.83; `warning-accent` 5.03 / 10.4 and 4.85 / 8.75; `danger-accent` 4.77 / 6.17 and 4.36 / 5.6, light / dark), an edge and its arrowhead (`border-control`, or `info-accent` when strong) and a node's focus ring (`focus`, 5.25 / 6.76) on `surface`. A figure's text takes its text role's colour as its fill (`currentColor`,
159
169
  in that one declaration only).
@@ -311,6 +321,7 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
311
321
  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.
312
322
  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.
313
323
  The write lands in the root's region when every candidate contains the console. Otherwise the topmost is the innermost candidate (the one inside all the others): when it is a `Dialog`, of this console or of another console on the page, the write lands in that dialog's region; when it is any other modal, the write throws. When no candidate lies inside all the others (focus is in none of the open modal dialogs and they do not nest), which one is topmost cannot be told, and the write throws as well.
324
+ `topmostModalOf(document)` of `@aiquants/console-ui/core` is that rule: it returns `{ kind: "none" }` while no modal dialog is open, `{ kind: "topmost", dialog }` with the topmost one, or `{ kind: "undecidable" }`, and reads only the document it is given. A host that routes announcements or focus of its own by the topmost modal calls it instead of keeping a copy of the rule.
314
325
  The check runs at the write, not at the call, so a handler may announce its outcome and close the modal in the same task, or let an effect close it, as long as the modal is closed when the quiet window passes: an outcome announced inside a `Dialog` that then closes is heard in the root's region.
315
326
  `JobCard`'s state line is a live region of its own (polite and atomic, holding the job's hidden name and its state pill), so a changed state is read as `<name> <state>` without moving focus or interrupting (WCAG 2.2.4), exactly as drawn.
316
327
  The check needs the `:modal` selector (Chrome 105, Firefox 103, Safari 15.6): `ConsoleUiRoot` probes it once when it mounts and throws there, naming the requirement, in a document without it.
@@ -0,0 +1 @@
1
+ import{a as P,b as te,c as ne,d as F,i as A}from"./chunk-RA33TN5N.js";var Be="dialog:modal",He=e=>{let t=[...e.querySelectorAll(Be)];if(t.length===0)return{kind:"none"};let n=e.activeElement,r=t.filter(l=>l.contains(n)),o=r.length>0?r:t,a=o.find(l=>o.every(s=>s.contains(l)));return a===void 0?{kind:"undecidable"}:{kind:"topmost",dialog:a}};var ze=[{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}],re=new Map,ae=e=>Number.isSafeInteger(e)&&e>=0,ie=(e,t,n)=>{let r=`${n} ${t}`,o=re.get(r);return o===void 0&&(o=new Intl.NumberFormat(t,{minimumFractionDigits:n,maximumFractionDigits:n,useGrouping:!0}),re.set(r,o)),o.format(e===0?0:e)},$=(e,t)=>{if(!ae(e))throw new RangeError(`A count must be a non-negative safe integer: ${e}`);return ie(e,t,0)},oe=(e,t)=>Number((e/1024**t.power).toFixed(t.fractionDigits)),We=(e,t)=>{if(!ae(e))throw new RangeError(`A byte size must be a non-negative safe integer: ${e}`);let[n,...r]=ze,o=n,a=oe(e,o);for(let l of r){if(a<1024)break;o=l,a=oe(e,o)}return`${ie(a,t,o.fractionDigits)} ${o.name}`},se=(e,t)=>t===void 0?e:`${e} ${t}`;var je=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/,Ge=/[!-~]/g;var Xe=/^[^eE]*[1-9]/,le=e=>{let t=e.replace(Ge,r=>String.fromCharCode(r.charCodeAt(0)-65248)).trim();if(!je.test(t))return null;let n=Number(t);return Number.isFinite(n)?n===0?Xe.test(t)?null:0:n:null},Ye=e=>{let t=le(e);return t!==null&&Number.isSafeInteger(t)?t:null};var Ke=/[^\p{White_Space}\p{Cc}\p{Cf}\p{Default_Ignorable_Code_Point}]/u,T=e=>Ke.test(e);var c=class extends RangeError{reason;constructor(t,n){super(n),this.name="ZonedTimeError",this.reason=t}},Ve=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?$/,qe=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(?:(Z)|([+-])(\d{2}):(\d{2}))$/,Je=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(?:(Z)|([+-])(\d{2}):?(\d{2}))$/,de=864e5,v=6e4,O={min:1,max:9999},ce=new Map,ue=new Map,Ze=e=>{let t=ce.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"}),ce.set(e,t)),t},me=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},U=(e,t)=>{let[n,r,o,a,l,s,f]=t;if(f!==void 0&&/[1-9]/.test(f))throw new c("subsecond",`Fractions of a second cannot be kept: ${e}`);let u={year:Number(n),month:Number(r),day:Number(o),hour:Number(a),minute:Number(l),second:s===void 0?0:Number(s)},E=u.year>=O.min?me(u):null;if(E===null)throw new c("malformed",`Not a calendar date and time: ${e}`);return{fields:u,millis:E}},B=(e,t)=>{let n=new Map(Ze(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>O.max)throw new c("malformed",`The wall clock falls outside years ${O.min}-${O.max}: ${new Date(e).toISOString()}`);return r},D=(e,t)=>me(B(e,t))-e,b=e=>String(e).padStart(2,"0"),fe=(e,t)=>{let n=`${String(e.year).padStart(4,"0")}-${b(e.month)}-${b(e.day)}T${b(e.hour)}:${b(e.minute)}`;return t||e.second!==0?`${n}:${b(e.second)}`:n},Qe=e=>{if(e%v!==0)throw new c("malformed",`The zone's offset is not a whole number of minutes: ${e} ms`);let t=Math.abs(e)/v;return`${e<0?"-":"+"}${b(Math.floor(t/60))}:${b(t%60)}`},et=(e,t)=>{let n=Ve.exec(e);if(n===null)throw new c("malformed",`Not a wall time (YYYY-MM-DDTHH:mm[:ss]): ${e}`);let{fields:r,millis:o}=U(e,n.slice(1)),l=[...new Set([D(o-de,t),D(o+de,t)])].filter(s=>D(o-s,t)===s);if(l.length===0)throw new c("nonexistent",`${e} does not exist in ${t}`);if(l.length>1)throw new c("ambiguous",`${e} occurs twice in ${t}`);return`${fe(r,!0)}${Qe(l[0])}`},ge=(e,t)=>{let[n,r,o,a]=t;if(n!==void 0)return 0;if(Number(o)>23||Number(a)>59)throw new c("malformed",`Not a valid offset: ${e}`);return(r==="-"?-1:1)*(Number(o)*60+Number(a))*v},tt=(e,t)=>{let n=qe.exec(e);if(n===null)throw new c("malformed",`Not an ISO 8601 instant with an offset: ${e}`);let{millis:r}=U(e,n.slice(1,8));return fe(B(r-ge(e,n.slice(8)),t),!1)},nt=(e,t)=>{let n=JSON.stringify([e,t]),r=ue.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"}),ue.set(n,r)),r},H=(e,t,n)=>{let r=Je.exec(e);if(r===null)throw new c("malformed",`Not an ISO 8601 instant with an offset: ${e}`);let{millis:o}=U(e,[...r.slice(1,7),void 0]),a=o-ge(e,r.slice(7));return B(a,n),nt(t,n).format(a)};function rt(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>Object.hasOwn(t,r)?String(t[r]):n)}import{accessFailureKindOfStatus as ot}from"@aiquants/auth-core";var x=e=>e===""?"":` (${e})`,pe=(e,t)=>{if(e.status!==null&&ot(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)},at=(e,t)=>t===""?e:`${e} Reason: ${t}.`,it=(e,t)=>t===""?e:`${e}${t}\u3002`,w={en:{unmeasured:"Not measured",loading:"Loading",loadFailed:e=>`Could not load${x(e)}.`,refreshFailed:e=>`Could not refresh${x(e)}.`,forbiddenBecause:at,failureSentence:pe,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${x(e)}\u3002`,refreshFailed:e=>`\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F${x(e)}\u3002`,forbiddenBecause:it,failureSentence:pe,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"}},st=e=>{if(!Object.hasOwn(w,e))throw new RangeError(`No console UI labels for locale "${e}"; supported: ${Object.keys(w).join(", ")}`);return w[e]};var dt=64,ct=255,ye=([e,t,n])=>{let r=Math.cbrt(.4122214708*e+.5363325363*t+.0514459929*n),o=Math.cbrt(.2119034982*e+.6806995451*t+.1073969566*n),a=Math.cbrt(.0883024619*e+.2817188376*t+.6299787005*n);return[.2104542553*r+.793617785*o-.0040720468*a,1.9779984951*r-2.428592205*o+.4505937099*a,.0259040371*r+.7827717662*o-.808675766*a]},ut=([e,t,n])=>{let r=(e+.3963377774*t+.2158037573*n)**3,o=(e-.1055613458*t-.0638541728*n)**3,a=(e-.0894841775*t-1.291485548*n)**3,l=s=>Math.min(1,Math.max(0,s));return[l(4.0767416621*r-3.3077115913*o+.2309699292*a),l(-1.2684380046*r+2.6097574011*o-.3413193965*a),l(-.0041960863*r-.7034186147*o+1.707614701*a)]},mt=e=>`#${e.map(t=>Math.round(ne(t)*ct).toString(16).padStart(2,"0")).join("")}`,Te=(e,t)=>{let n=P(e);if(t.length===0)throw new RangeError(`A more-contrast colour needs the surfaces it is drawn on: ${e}`);let r=F(n),o=t.map(d=>F(P(d))),a=o.every(d=>d>r);if(!(a||o.every(d=>d<r)))throw new RangeError(`The surfaces of a more-contrast colour must all be lighter or all be darker than it: ${e} on ${t.join(", ")}`);let l=a?Math.min(...o):Math.max(...o),s=a?0:1,f=d=>(Math.max(d,l)+.05)/(Math.min(d,l)+.05),u=Math.sqrt(f(r)*f(s));if(r===s)return e.toLowerCase();let E=ye(n.map(te)),ve=ye([s,s,s]),Q=d=>ut(E.map((p,L)=>p+d*(ve[L]-p))),Ue=([d,p,L])=>.2126*d+.7152*p+.0722*L,ee=0,N=1;for(let d=0;d<dt;d+=1){let p=(ee+N)/2;f(Ue(Q(p)))>=u?N=p:ee=p}return mt(Q(N))},be=(e,t)=>{let n=o=>{if(!Object.hasOwn(e,o))throw new RangeError(`Not a role of the palette: ${o}`);return e[o]};for(let o of Object.keys(t))n(o);let r=Object.fromEntries(Object.keys(e).map(o=>{let a=t[o];if(a===void 0)return[o,e[o]];let l=a.map(n),{light:s,dark:f}=e[o];return[o,Object.freeze({light:Te(s,l.map(u=>u.light)),dark:Te(f,l.map(u=>u.dark))})]}));return Object.freeze(r)};var ft=4,gt=[1,2,3,4,6,8,12,16,24],pt=16,yt=5/4,W={caption:-2,body:-1,"body-lg":0,title:0,heading:1,display:2,"display-lg":3},Tt=11,he=3/2,bt=7/4,ht=7/4,xt=120,kt=3/2,Rt=[1,2,3],Ct=40,St="space-6",xe=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},j=e=>{if(!Number.isInteger(e))throw new RangeError(`A type step must be an integer: ${e}`);return Math.max(Tt,Math.round(pt*yt**e))},G=(e,t)=>xe(e*t),ke=G(j(W.body),he),k=ke+24,Re=k+8,Ce=ke+8,z={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}},Et=()=>Object.fromEntries(gt.map(e=>[`space-${e}`,e*4])),Pt=()=>{let e=Object.fromEntries(Object.entries(W).map(([n,r])=>{let o=j(r);return[n,{size:o,lineHeight:G(o,n==="title"?ht:he)}]})),t=j(W.body);return{...e,prose:{size:t,lineHeight:G(t,bt)}}},Ot=()=>Object.fromEntries(Rt.map(e=>[`motion-${e}`,xt*kt**(e-1)])),Se=(e,t)=>{let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length||!n.every(o=>Object.hasOwn(t,o)))throw new RangeError(`The more-contrast palette must hold the roles of the standard one: ${n.join(", ")} / ${r.join(", ")}`);return Object.freeze({space:Object.freeze(Et()),type:Object.freeze(Pt()),weight:z.weight,radius:z.radius,size:Object.freeze({"size-target":k,"size-control":k,"size-row":k,"size-row-control":Re,"size-row-compact":Ce}),stroke:z.stroke,motion:Object.freeze(Ot()),measure:Object.freeze({"measure-dialog":Object.freeze({ic:Ct,inset:St})}),color:Object.freeze({...e}),moreContrastColor:Object.freeze({...t})})};var Ee={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"}},wt=Object.freeze({...Object.fromEntries(Object.entries(A.light).map(([e,t])=>[e,Object.freeze(Object.keys(t))])),"border-subtle":Object.freeze(["surface","subtle","sunken"])}),i=Se(Ee,be(Ee,wt)),_t="--cui-",Mt=e=>`var(${_t}${e})`;var It=e=>e>=32&&e<=126||e>=65377&&e<=65500||e>=65512&&e<=65518,Pe=(e,t)=>{let n=0,r=0;for(let o of e)It(o.codePointAt(0))?r+=1:n+=1;return n*1+r*t},R=e=>Pe(e,.55),C=e=>Pe(e,.6),g=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 Oe="caption",K="body",V=2*i.space["space-3"],we={type:"caption",paddingInlinePx:2*i.space["space-2"]},X={type:"body",paddingInlinePx:2*i.space["space-3"]+2*i.stroke["border-width"],minInlinePx:i.size["size-control"]},_e={type:"body",minInlinePx:i.size["size-target"]},_={trackInlinePx:2*i.type.body.lineHeight+3*i.space["space-1"],labelGapPx:i.space["space-2"],type:"body"},Y={captionType:"caption",valueType:"heading",paddingInlinePx:2*i.space["space-3"]},Nt=10,Lt="2000-01-01T00:00:00Z",Ft=9999999,Me=(e,t,n)=>(t==="mono"?C(e):R(e))*i.type[n].size,At=(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(!T(n))throw new RangeError(`A ${t} sample must hold a readable character: ${JSON.stringify(n)}`);return e},m=(e,t,n,r)=>Math.max(...At(e,t).map(o=>Me(o,n,r))),q=e=>{switch(e.kind){case"text":return m(e.texts,"text",e.face,e.type);case"measured":return m(e.texts,"measured value","sans",K);case"pill":return m(e.labels,"pill","sans",we.type)+we.paddingInlinePx;case"button":return Math.max(X.minInlinePx,m(e.labels,"button","sans",X.type)+X.paddingInlinePx);case"link":return Math.max(_e.minInlinePx,m(e.labels,"link","sans",_e.type));case"switch":return e.labelHidden?_.trackInlinePx:_.trackInlinePx+_.labelGapPx+m(e.labels,"switch","sans",_.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+q(n),0)+(e.items.length-1)*i.space[e.gap]}}},$t=(e,t)=>{let n=m([e.header],"column header","sans",Oe),r=e.note===void 0?0:m(e.note,"column header note","sans",Oe);return g(Math.max(n,r,...t.map(q))+V)},Dt=g(Me("\u3042".repeat(Nt),"sans",K)+V),vt=e=>g(m(e,"comparison attribute","sans",K)+V),Ut=(e,t)=>H(Lt,e,t),Bt=(e,t)=>{if(t!==void 0&&!T(t))throw new RangeError(`A count sample's unit must hold a readable character: ${JSON.stringify(t)}`);return se($(Ft,e),t)},Ht=(e,t)=>g(Math.max(m(e,"tile caption","sans",Y.captionType),m(t,"tile value","sans",Y.valueType))+Y.paddingInlinePx);var zt=.12,Wt=.16,jt=/[\u0020\u00a0\u1361\u{10100}\u{10101}\u{1039f}\u{1091f}]/u,S=i.space["space-3"],M=(e,t)=>{let n=0,r=0;for(let a of e)n+=1,jt.test(a)&&(r+=1);return(t==="mono"?C(e):R(e))+zt*n+Wt*r},Gt=e=>{for(let n of[e.name,...e.notes])if(!T(n))throw new RangeError(`A figure node's name and notes must hold a readable character: ${JSON.stringify(n)}`);let t=Math.max(M(e.name,"sans")*i.type.body.size,...e.notes.map(n=>M(n,"sans")*i.type.caption.size));return{minWidthPx:g(t)+2*S,heightPx:2*S+i.type.body.lineHeight+e.notes.length*i.type.caption.lineHeight}},Hn=e=>{let t=S+i.type.body.lineHeight;return{insetPx:S,namePx:S+i.type.body.lineHeight/2,notesPx:Array.from({length:e},(n,r)=>t+r*i.type.caption.lineHeight+i.type.caption.lineHeight/2)}},Xt=(e,t)=>{if(e!==null&&!T(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+Ie}:{widthPx:g(M(e,"sans")*i.type.caption.size),extentBelowPx:t+i.space["space-1"]+i.type.caption.lineHeight}},Ie=i.stroke["focus-offset"]+i.stroke["focus-width"],zn=i.stroke["focus-offset"]+i.stroke["focus-width"]/2;var I=(1+Math.sqrt(5))/2,Yt=(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/I**t};var Kt=e=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`Length must be a finite px value >= 0: ${e}`);return e},y=e=>`${Kt(e)/16}rem`;var Ne=({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},Vt=(e,t)=>{let n=Ne(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+I),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}},Kn=e=>{let t=Ne(e),n=`cui-master-detail-m${e.masterMinPx}-d${e.detailMinPx}-g${e.gapPx}`,r=`[data-cui-master-detail="${n}"]`,o=y(e.gapPx),a=`${r}{grid-template-columns:minmax(0,1fr);gap:${o}}`,l=`clamp(${y(e.masterMinPx)},calc((100% - ${o}) / ${1+I}),calc(100% - ${o} - ${y(e.detailMinPx)}))`,s=`@container (min-width:${y(t)}){${r}{grid-template-columns:${l} minmax(0,1fr)}}`;return{key:n,css:a+s}};var qt=2*i.space["space-1"],Le=e=>{if(!(Number.isFinite(e)&&e>0))throw new RangeError(`Column width must be a positive px value: ${e}`);return e},Fe=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+=Le(r.fixedPx);continue}let o=Le(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},Jt=e=>Fe(e)+qt;var Zt=(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}`,a=`[data-cui-tile-grid="${o}"]`,l=r.map(({columns:s,minContainerPx:f})=>{let u=`${a}{grid-template-columns:repeat(${s},minmax(0,1fr))}`;return s===1?u:`@container (min-width:${y(f)}){${u}}`});return{key:o,steps:r,css:l.join("")}};var Qt=403,en=(e,t)=>e.ok?{ok:!0,value:t(e.value)}:e,tn=(e,t)=>e.ok?t(e.value):e,er={kind:"idle"},nn={kind:"loading"},J=(e,t)=>e.kind==="ready"?{...e,refreshing:!0}:e.kind==="failed"?t==="reload"?{...e,retrying:!0}:e:nn,Z=(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 rn=(e,t)=>{let n=J(e,t);return n.kind==="ready"?{...n,value:{...n.value,loadingMore:!1}}:n},on=(e,t)=>Z(e,t.ok?{ok:!0,value:{rows:t.value.rows,next:t.value.next,meta:t.value.meta,loadingMore:!1,moreFailure:null}}:t),an=e=>e.kind==="ready"&&!e.refreshing&&e.value.next!==null&&!e.value.loadingMore?{...e,value:{...e.value,loadingMore:!0}}:e,sn=(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}}}},ln=(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 dn=/^#[0-9a-f]{6}$/i,cn=/^[a-z][a-z0-9-]*$/,Ae=e=>{if(!dn.test(e))throw new RangeError(`A palette colour must be #rrggbb: ${e}`);return e},$e=({light:e,dark:t})=>`light-dark(${Ae(e)}, ${Ae(t)})`,un=e=>{if(!cn.test(e))throw new RangeError(`A root attribute must be lowercase letters, digits and hyphens, starting with a letter: ${e}`);return`[${e}] ::placeholder { color: ${$e(i.color["fg-muted"])}; opacity: 1; }`};var De=["indigo","violet","purple","fuchsia","pink","rose","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue"],mn=["fg","tint","accent","line","solid","solid-hover"],fn={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"}}},h=({light:e,dark:t})=>Object.freeze({light:e,dark:t}),gn=({fg:e,tint:t,accent:n})=>Object.freeze({fg:h(e),tint:h(t),accent:h(n),line:h({light:e.dark,dark:e.light}),solid:h(e),"solid-hover":h({light:t.dark,dark:t.light})}),pn=Object.freeze(Object.fromEntries(De.map(e=>[e,gn(fn[e])])));export{Be as a,He as b,$ as c,We as d,se as e,le as f,Ye as g,T as h,c as i,et as j,tt as k,H as l,rt as m,x as n,w as o,st as p,ft as q,xe as r,k as s,Re as t,Ce as u,i as v,Mt as w,R as x,C as y,g as z,q as A,$t as B,Dt as C,vt as D,Ut as E,Bt as F,Ht as G,M as H,Gt as I,Hn as J,Xt as K,Ie as L,zn as M,Yt as N,y as O,Vt as P,Kn as Q,Fe as R,Jt as S,Zt as T,Qt as U,en as V,tn as W,er as X,nn as Y,J as Z,Z as _,rn as $,on as aa,an as ba,sn as ca,ln as da,$e as ea,un as fa,De as ga,mn as ha,pn as ia};
@@ -0,0 +1 @@
1
+ var o=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;var i=n=>{let e=o.exec(n);if(e===null)throw new RangeError(`Colour must be #rrggbb: ${n}`);let[,s,r,t]=e;return[Number.parseInt(s,16)/255,Number.parseInt(r,16)/255,Number.parseInt(t,16)/255]},c=n=>n<=.04045?n/12.92:((n+.055)/1.055)**2.4,f=n=>n<=.0031308?n*12.92:1.055*n**.4166666666666667-.055,a=n=>{for(let t of n)if(!(t>=0&&t<=1))throw new RangeError(`sRGB channels must be numbers in [0, 1]: ${n.join(", ")}`);let[e,s,r]=n;return .2126*c(e)+.7152*c(s)+.0722*c(r)},g=(n,e)=>{let[s,r]=[a(n),a(e)].sort((t,u)=>u-t);return(s+.05)/(r+.05)},l={text:7,largeText:4.5,nonText:3},d={text:7,largeText:4.5,nonText:4.5},b=["standard","more"],x={light:{fg:{surface:17.83,subtle:17.04,sunken:16.28,"danger-tint":16.3,"warning-tint":17.19,"success-tint":16.93,"info-tint":16.38},"fg-secondary":{surface:10.36,subtle:9.9,sunken:9.45},"fg-muted":{surface:7.8,subtle:7.46,sunken:7.12,"danger-tint":7.13,"warning-tint":7.52,"info-tint":7.17},"danger-fg":{surface:8.36,subtle:7.99,"danger-tint":7.64},"warning-fg":{surface:9.06,subtle:8.66,"warning-tint":8.73},"success-fg":{surface:7.61,subtle:7.27,"success-tint":7.23},"info-fg":{surface:8.82,"info-tint":8.11,subtle:8.43},"on-solid":{"neutral-solid":10.36,"danger-solid":8.36,"success-solid":7.61,"info-solid":8.82,"warning-solid":9.06},"danger-accent":{surface:4.77,"danger-tint":4.36},"warning-accent":{surface:5.03,"warning-tint":4.85},"success-accent":{surface:3.65,"success-tint":3.47},"info-accent":{surface:5.25,subtle:5.01,sunken:4.79,"info-tint":4.82},focus:{surface:5.25,subtle:5.01,sunken:4.79,"info-tint":4.82},"border-control":{surface:4.76,subtle:4.55,sunken:4.35}},dark:{fg:{surface:17.04,subtle:13.97,sunken:19.27,"danger-tint":15.45,"warning-tint":14.34,"success-tint":14.51,"info-tint":14.13},"fg-secondary":{surface:14.46,subtle:11.86,sunken:16.35},"fg-muted":{surface:12,subtle:9.83,sunken:13.56,"danger-tint":10.87,"warning-tint":10.09,"info-tint":9.94},"danger-fg":{surface:12.27,subtle:10.06,"danger-tint":11.12},"warning-fg":{surface:14.33,subtle:11.74,"warning-tint":12.05},"success-fg":{surface:13.94,subtle:11.43,"success-tint":11.87},"info-fg":{surface:12.54,"info-tint":10.39,subtle:10.28},"on-solid":{"neutral-solid":12,"danger-solid":9.29,"success-solid":11.72,"info-solid":9.83,"warning-solid":12.32},"danger-accent":{surface:6.17,"danger-tint":5.6},"warning-accent":{surface:10.4,"warning-tint":8.75},"success-accent":{surface:9.2,"success-tint":7.83},"info-accent":{surface:6.76,subtle:5.54,sunken:7.64,"info-tint":5.6},focus:{surface:6.76,subtle:5.54,sunken:7.64,"info-tint":5.6},"border-control":{surface:6.78,subtle:5.56,sunken:7.66}},contrastLight:{fg:{surface:19.36,subtle:18.5,sunken:17.67,"danger-tint":17.7,"warning-tint":18.67,"success-tint":18.38,"info-tint":17.79},"fg-secondary":{surface:14.67,subtle:14.02,sunken:13.39},"fg-muted":{surface:12.75,subtle:12.19,sunken:11.64,"danger-tint":11.66,"warning-tint":12.3,"info-tint":11.72},"danger-fg":{surface:13.28,subtle:12.69,"danger-tint":12.14},"warning-fg":{surface:13.82,subtle:13.21,"warning-tint":13.33},"success-fg":{surface:12.67,subtle:12.11,"success-tint":12.03},"info-fg":{surface:13.64,"info-tint":12.54,subtle:13.04},"on-solid":{"neutral-solid":10.36,"danger-solid":8.36,"success-solid":7.61,"info-solid":8.82,"warning-solid":9.06},"danger-accent":{surface:10,"danger-tint":9.14},"warning-accent":{surface:10.32,"warning-tint":9.95},"success-accent":{surface:8.79,"success-tint":8.35},"info-accent":{surface:10.48,subtle:10.01,sunken:9.56,"info-tint":9.63},focus:{surface:10.48,subtle:10.01,sunken:9.56,"info-tint":9.63},"border-control":{surface:10.02,subtle:9.58,sunken:9.15}},contrastDark:{fg:{surface:17.36,subtle:14.23,sunken:19.62,"danger-tint":15.74,"warning-tint":14.6,"success-tint":14.78,"info-tint":14.39},"fg-secondary":{surface:16.02,subtle:13.13,sunken:18.11},"fg-muted":{surface:14.59,subtle:11.96,sunken:16.49,"danger-tint":13.22,"warning-tint":12.27,"info-tint":12.09},"danger-fg":{surface:14.82,subtle:12.15,"danger-tint":13.44},"warning-fg":{surface:15.99,subtle:13.11,"warning-tint":13.45},"success-fg":{surface:15.78,subtle:12.94,"success-tint":13.44},"info-fg":{surface:15,"info-tint":12.43,subtle:12.29},"on-solid":{"neutral-solid":13.02,"danger-solid":10.09,"success-solid":12.72,"info-solid":10.68,"warning-solid":13.38},"danger-accent":{surface:10.47,"danger-tint":9.49},"warning-accent":{surface:13.62,"warning-tint":11.46},"success-accent":{surface:12.81,"success-tint":10.91},"info-accent":{surface:11.01,subtle:9.03,sunken:12.45,"info-tint":9.13},focus:{surface:11.01,subtle:9.03,sunken:12.45,"info-tint":9.13},"border-control":{surface:10.98,subtle:9,sunken:12.41}}},w={fg:"text","fg-secondary":"text","fg-muted":"text","danger-fg":"text","warning-fg":"text","success-fg":"text","info-fg":"text","on-solid":"text","danger-accent":"nonText","warning-accent":"nonText","success-accent":"nonText","info-accent":"nonText",focus:"nonText","border-control":"nonText"};export{i as a,c as b,f as c,a as d,g as e,l as f,d as g,b as h,x as i,w as j};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkXLOWKWIIcjs = require('./chunk-XLOWKWII.cjs');var Be="dialog:modal",He= exports.b =e=>{let t=[...e.querySelectorAll(Be)];if(t.length===0)return{kind:"none"};let n=e.activeElement,r=t.filter(l=>l.contains(n)),o=r.length>0?r:t,a=o.find(l=>o.every(s=>s.contains(l)));return a===void 0?{kind:"undecidable"}:{kind:"topmost",dialog:a}};var ze=[{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}],re=new Map,ae=e=>Number.isSafeInteger(e)&&e>=0,ie=(e,t,n)=>{let r=`${n} ${t}`,o=re.get(r);return o===void 0&&(o=new Intl.NumberFormat(t,{minimumFractionDigits:n,maximumFractionDigits:n,useGrouping:!0}),re.set(r,o)),o.format(e===0?0:e)},$= exports.c =(e,t)=>{if(!ae(e))throw new RangeError(`A count must be a non-negative safe integer: ${e}`);return ie(e,t,0)},oe=(e,t)=>Number((e/1024**t.power).toFixed(t.fractionDigits)),We= exports.d =(e,t)=>{if(!ae(e))throw new RangeError(`A byte size must be a non-negative safe integer: ${e}`);let[n,...r]=ze,o=n,a=oe(e,o);for(let l of r){if(a<1024)break;o=l,a=oe(e,o)}return`${ie(a,t,o.fractionDigits)} ${o.name}`},se= exports.e =(e,t)=>t===void 0?e:`${e} ${t}`;var je=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/,Ge=/[!-~]/g;var Xe=/^[^eE]*[1-9]/,le= exports.f =e=>{let t=e.replace(Ge,r=>String.fromCharCode(r.charCodeAt(0)-65248)).trim();if(!je.test(t))return null;let n=Number(t);return Number.isFinite(n)?n===0?Xe.test(t)?null:0:n:null},Ye= exports.g =e=>{let t=le(e);return t!==null&&Number.isSafeInteger(t)?t:null};var Ke=/[^\p{White_Space}\p{Cc}\p{Cf}\p{Default_Ignorable_Code_Point}]/u,T= exports.h =e=>Ke.test(e);var c=class extends RangeError{constructor(t,n){super(n),this.name="ZonedTimeError",this.reason=t}},Ve=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?$/,qe=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(?:(Z)|([+-])(\d{2}):(\d{2}))$/,Je=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(?:(Z)|([+-])(\d{2}):?(\d{2}))$/,de=864e5,v=6e4,O={min:1,max:9999},ce=new Map,ue=new Map,Ze=e=>{let t=ce.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"}),ce.set(e,t)),t},me=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},U=(e,t)=>{let[n,r,o,a,l,s,f]=t;if(f!==void 0&&/[1-9]/.test(f))throw new c("subsecond",`Fractions of a second cannot be kept: ${e}`);let u={year:Number(n),month:Number(r),day:Number(o),hour:Number(a),minute:Number(l),second:s===void 0?0:Number(s)},E=u.year>=O.min?me(u):null;if(E===null)throw new c("malformed",`Not a calendar date and time: ${e}`);return{fields:u,millis:E}},B=(e,t)=>{let n=new Map(Ze(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>O.max)throw new c("malformed",`The wall clock falls outside years ${O.min}-${O.max}: ${new Date(e).toISOString()}`);return r},D=(e,t)=>me(B(e,t))-e,b=e=>String(e).padStart(2,"0"),fe=(e,t)=>{let n=`${String(e.year).padStart(4,"0")}-${b(e.month)}-${b(e.day)}T${b(e.hour)}:${b(e.minute)}`;return t||e.second!==0?`${n}:${b(e.second)}`:n},Qe=e=>{if(e%v!==0)throw new c("malformed",`The zone's offset is not a whole number of minutes: ${e} ms`);let t=Math.abs(e)/v;return`${e<0?"-":"+"}${b(Math.floor(t/60))}:${b(t%60)}`},et= exports.j =(e,t)=>{let n=Ve.exec(e);if(n===null)throw new c("malformed",`Not a wall time (YYYY-MM-DDTHH:mm[:ss]): ${e}`);let{fields:r,millis:o}=U(e,n.slice(1)),l=[...new Set([D(o-de,t),D(o+de,t)])].filter(s=>D(o-s,t)===s);if(l.length===0)throw new c("nonexistent",`${e} does not exist in ${t}`);if(l.length>1)throw new c("ambiguous",`${e} occurs twice in ${t}`);return`${fe(r,!0)}${Qe(l[0])}`},ge=(e,t)=>{let[n,r,o,a]=t;if(n!==void 0)return 0;if(Number(o)>23||Number(a)>59)throw new c("malformed",`Not a valid offset: ${e}`);return(r==="-"?-1:1)*(Number(o)*60+Number(a))*v},tt= exports.k =(e,t)=>{let n=qe.exec(e);if(n===null)throw new c("malformed",`Not an ISO 8601 instant with an offset: ${e}`);let{millis:r}=U(e,n.slice(1,8));return fe(B(r-ge(e,n.slice(8)),t),!1)},nt=(e,t)=>{let n=JSON.stringify([e,t]),r=ue.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"}),ue.set(n,r)),r},H= exports.l =(e,t,n)=>{let r=Je.exec(e);if(r===null)throw new c("malformed",`Not an ISO 8601 instant with an offset: ${e}`);let{millis:o}=U(e,[...r.slice(1,7),void 0]),a=o-ge(e,r.slice(7));return B(a,n),nt(t,n).format(a)};function rt(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>Object.hasOwn(t,r)?String(t[r]):n)}var _authcore = require('@aiquants/auth-core');var x=e=>e===""?"":` (${e})`,pe=(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)},at=(e,t)=>t===""?e:`${e} Reason: ${t}.`,it=(e,t)=>t===""?e:`${e}${t}\u3002`,w= exports.o ={en:{unmeasured:"Not measured",loading:"Loading",loadFailed:e=>`Could not load${x(e)}.`,refreshFailed:e=>`Could not refresh${x(e)}.`,forbiddenBecause:at,failureSentence:pe,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${x(e)}\u3002`,refreshFailed:e=>`\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F${x(e)}\u3002`,forbiddenBecause:it,failureSentence:pe,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"}},st= exports.p =e=>{if(!Object.hasOwn(w,e))throw new RangeError(`No console UI labels for locale "${e}"; supported: ${Object.keys(w).join(", ")}`);return w[e]};var dt=64,ct=255,ye=([e,t,n])=>{let r=Math.cbrt(.4122214708*e+.5363325363*t+.0514459929*n),o=Math.cbrt(.2119034982*e+.6806995451*t+.1073969566*n),a=Math.cbrt(.0883024619*e+.2817188376*t+.6299787005*n);return[.2104542553*r+.793617785*o-.0040720468*a,1.9779984951*r-2.428592205*o+.4505937099*a,.0259040371*r+.7827717662*o-.808675766*a]},ut=([e,t,n])=>{let r=(e+.3963377774*t+.2158037573*n)**3,o=(e-.1055613458*t-.0638541728*n)**3,a=(e-.0894841775*t-1.291485548*n)**3,l=s=>Math.min(1,Math.max(0,s));return[l(4.0767416621*r-3.3077115913*o+.2309699292*a),l(-1.2684380046*r+2.6097574011*o-.3413193965*a),l(-.0041960863*r-.7034186147*o+1.707614701*a)]},mt=e=>`#${e.map(t=>Math.round(_chunkXLOWKWIIcjs.c.call(void 0, t)*ct).toString(16).padStart(2,"0")).join("")}`,Te=(e,t)=>{let n=_chunkXLOWKWIIcjs.a.call(void 0, e);if(t.length===0)throw new RangeError(`A more-contrast colour needs the surfaces it is drawn on: ${e}`);let r=_chunkXLOWKWIIcjs.d.call(void 0, n),o=t.map(d=>_chunkXLOWKWIIcjs.d.call(void 0, _chunkXLOWKWIIcjs.a.call(void 0, d))),a=o.every(d=>d>r);if(!(a||o.every(d=>d<r)))throw new RangeError(`The surfaces of a more-contrast colour must all be lighter or all be darker than it: ${e} on ${t.join(", ")}`);let l=a?Math.min(...o):Math.max(...o),s=a?0:1,f=d=>(Math.max(d,l)+.05)/(Math.min(d,l)+.05),u=Math.sqrt(f(r)*f(s));if(r===s)return e.toLowerCase();let E=ye(n.map(_chunkXLOWKWIIcjs.b)),ve=ye([s,s,s]),Q=d=>ut(E.map((p,L)=>p+d*(ve[L]-p))),Ue=([d,p,L])=>.2126*d+.7152*p+.0722*L,ee=0,N=1;for(let d=0;d<dt;d+=1){let p=(ee+N)/2;f(Ue(Q(p)))>=u?N=p:ee=p}return mt(Q(N))},be=(e,t)=>{let n=o=>{if(!Object.hasOwn(e,o))throw new RangeError(`Not a role of the palette: ${o}`);return e[o]};for(let o of Object.keys(t))n(o);let r=Object.fromEntries(Object.keys(e).map(o=>{let a=t[o];if(a===void 0)return[o,e[o]];let l=a.map(n),{light:s,dark:f}=e[o];return[o,Object.freeze({light:Te(s,l.map(u=>u.light)),dark:Te(f,l.map(u=>u.dark))})]}));return Object.freeze(r)};var ft=4,gt=[1,2,3,4,6,8,12,16,24],pt=16,yt=5/4,W={caption:-2,body:-1,"body-lg":0,title:0,heading:1,display:2,"display-lg":3},Tt=11,he=3/2,bt=7/4,ht=7/4,xt=120,kt=3/2,Rt=[1,2,3],Ct=40,St="space-6",xe= exports.r =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},j=e=>{if(!Number.isInteger(e))throw new RangeError(`A type step must be an integer: ${e}`);return Math.max(Tt,Math.round(pt*yt**e))},G=(e,t)=>xe(e*t),ke=G(j(W.body),he),k= exports.s =ke+24,Re= exports.t =k+8,Ce= exports.u =ke+8,z={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}},Et=()=>Object.fromEntries(gt.map(e=>[`space-${e}`,e*4])),Pt=()=>{let e=Object.fromEntries(Object.entries(W).map(([n,r])=>{let o=j(r);return[n,{size:o,lineHeight:G(o,n==="title"?ht:he)}]})),t=j(W.body);return{...e,prose:{size:t,lineHeight:G(t,bt)}}},Ot=()=>Object.fromEntries(Rt.map(e=>[`motion-${e}`,xt*kt**(e-1)])),Se=(e,t)=>{let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length||!n.every(o=>Object.hasOwn(t,o)))throw new RangeError(`The more-contrast palette must hold the roles of the standard one: ${n.join(", ")} / ${r.join(", ")}`);return Object.freeze({space:Object.freeze(Et()),type:Object.freeze(Pt()),weight:z.weight,radius:z.radius,size:Object.freeze({"size-target":k,"size-control":k,"size-row":k,"size-row-control":Re,"size-row-compact":Ce}),stroke:z.stroke,motion:Object.freeze(Ot()),measure:Object.freeze({"measure-dialog":Object.freeze({ic:Ct,inset:St})}),color:Object.freeze({...e}),moreContrastColor:Object.freeze({...t})})};var Ee={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"}},wt=Object.freeze({...Object.fromEntries(Object.entries(_chunkXLOWKWIIcjs.i.light).map(([e,t])=>[e,Object.freeze(Object.keys(t))])),"border-subtle":Object.freeze(["surface","subtle","sunken"])}),i= exports.v =Se(Ee,be(Ee,wt)),_t="--cui-",Mt= exports.w =e=>`var(${_t}${e})`;var It=e=>e>=32&&e<=126||e>=65377&&e<=65500||e>=65512&&e<=65518,Pe=(e,t)=>{let n=0,r=0;for(let o of e)It(o.codePointAt(0))?r+=1:n+=1;return n*1+r*t},R= exports.x =e=>Pe(e,.55),C= exports.y =e=>Pe(e,.6),g= exports.z =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 Oe="caption",K="body",V=2*i.space["space-3"],we={type:"caption",paddingInlinePx:2*i.space["space-2"]},X={type:"body",paddingInlinePx:2*i.space["space-3"]+2*i.stroke["border-width"],minInlinePx:i.size["size-control"]},_e={type:"body",minInlinePx:i.size["size-target"]},_={trackInlinePx:2*i.type.body.lineHeight+3*i.space["space-1"],labelGapPx:i.space["space-2"],type:"body"},Y={captionType:"caption",valueType:"heading",paddingInlinePx:2*i.space["space-3"]},Nt=10,Lt="2000-01-01T00:00:00Z",Ft=9999999,Me=(e,t,n)=>(t==="mono"?C(e):R(e))*i.type[n].size,At=(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(!T(n))throw new RangeError(`A ${t} sample must hold a readable character: ${JSON.stringify(n)}`);return e},m=(e,t,n,r)=>Math.max(...At(e,t).map(o=>Me(o,n,r))),q= exports.A =e=>{switch(e.kind){case"text":return m(e.texts,"text",e.face,e.type);case"measured":return m(e.texts,"measured value","sans",K);case"pill":return m(e.labels,"pill","sans",we.type)+we.paddingInlinePx;case"button":return Math.max(X.minInlinePx,m(e.labels,"button","sans",X.type)+X.paddingInlinePx);case"link":return Math.max(_e.minInlinePx,m(e.labels,"link","sans",_e.type));case"switch":return e.labelHidden?_.trackInlinePx:_.trackInlinePx+_.labelGapPx+m(e.labels,"switch","sans",_.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+q(n),0)+(e.items.length-1)*i.space[e.gap]}}},$t= exports.B =(e,t)=>{let n=m([e.header],"column header","sans",Oe),r=e.note===void 0?0:m(e.note,"column header note","sans",Oe);return g(Math.max(n,r,...t.map(q))+V)},Dt= exports.C =g(Me("\u3042".repeat(Nt),"sans",K)+V),vt= exports.D =e=>g(m(e,"comparison attribute","sans",K)+V),Ut= exports.E =(e,t)=>H(Lt,e,t),Bt= exports.F =(e,t)=>{if(t!==void 0&&!T(t))throw new RangeError(`A count sample's unit must hold a readable character: ${JSON.stringify(t)}`);return se($(Ft,e),t)},Ht= exports.G =(e,t)=>g(Math.max(m(e,"tile caption","sans",Y.captionType),m(t,"tile value","sans",Y.valueType))+Y.paddingInlinePx);var zt=.12,Wt=.16,jt=/[\u0020\u00a0\u1361\u{10100}\u{10101}\u{1039f}\u{1091f}]/u,S=i.space["space-3"],M= exports.H =(e,t)=>{let n=0,r=0;for(let a of e)n+=1,jt.test(a)&&(r+=1);return(t==="mono"?C(e):R(e))+zt*n+Wt*r},Gt= exports.I =e=>{for(let n of[e.name,...e.notes])if(!T(n))throw new RangeError(`A figure node's name and notes must hold a readable character: ${JSON.stringify(n)}`);let t=Math.max(M(e.name,"sans")*i.type.body.size,...e.notes.map(n=>M(n,"sans")*i.type.caption.size));return{minWidthPx:g(t)+2*S,heightPx:2*S+i.type.body.lineHeight+e.notes.length*i.type.caption.lineHeight}},Hn= exports.J =e=>{let t=S+i.type.body.lineHeight;return{insetPx:S,namePx:S+i.type.body.lineHeight/2,notesPx:Array.from({length:e},(n,r)=>t+r*i.type.caption.lineHeight+i.type.caption.lineHeight/2)}},Xt= exports.K =(e,t)=>{if(e!==null&&!T(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+Ie}:{widthPx:g(M(e,"sans")*i.type.caption.size),extentBelowPx:t+i.space["space-1"]+i.type.caption.lineHeight}},Ie= exports.L =i.stroke["focus-offset"]+i.stroke["focus-width"],zn= exports.M =i.stroke["focus-offset"]+i.stroke["focus-width"]/2;var I=(1+Math.sqrt(5))/2,Yt= exports.N =(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/I**t};var Kt=e=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`Length must be a finite px value >= 0: ${e}`);return e},y= exports.O =e=>`${Kt(e)/16}rem`;var Ne=({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},Vt= exports.P =(e,t)=>{let n=Ne(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+I),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}},Kn= exports.Q =e=>{let t=Ne(e),n=`cui-master-detail-m${e.masterMinPx}-d${e.detailMinPx}-g${e.gapPx}`,r=`[data-cui-master-detail="${n}"]`,o=y(e.gapPx),a=`${r}{grid-template-columns:minmax(0,1fr);gap:${o}}`,l=`clamp(${y(e.masterMinPx)},calc((100% - ${o}) / ${1+I}),calc(100% - ${o} - ${y(e.detailMinPx)}))`,s=`@container (min-width:${y(t)}){${r}{grid-template-columns:${l} minmax(0,1fr)}}`;return{key:n,css:a+s}};var qt=2*i.space["space-1"],Le=e=>{if(!(Number.isFinite(e)&&e>0))throw new RangeError(`Column width must be a positive px value: ${e}`);return e},Fe= exports.R =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+=Le(r.fixedPx);continue}let o=Le(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},Jt= exports.S =e=>Fe(e)+qt;var Zt=(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}`,a=`[data-cui-tile-grid="${o}"]`,l=r.map(({columns:s,minContainerPx:f})=>{let u=`${a}{grid-template-columns:repeat(${s},minmax(0,1fr))}`;return s===1?u:`@container (min-width:${y(f)}){${u}}`});return{key:o,steps:r,css:l.join("")}};var Qt=403,en= exports.V =(e,t)=>e.ok?{ok:!0,value:t(e.value)}:e,tn= exports.W =(e,t)=>e.ok?t(e.value):e,er= exports.X ={kind:"idle"},nn= exports.Y ={kind:"loading"},J= exports.Z =(e,t)=>e.kind==="ready"?{...e,refreshing:!0}:e.kind==="failed"?t==="reload"?{...e,retrying:!0}:e:nn,Z= exports._ =(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 rn=(e,t)=>{let n=J(e,t);return n.kind==="ready"?{...n,value:{...n.value,loadingMore:!1}}:n},on= exports.aa =(e,t)=>Z(e,t.ok?{ok:!0,value:{rows:t.value.rows,next:t.value.next,meta:t.value.meta,loadingMore:!1,moreFailure:null}}:t),an= exports.ba =e=>e.kind==="ready"&&!e.refreshing&&e.value.next!==null&&!e.value.loadingMore?{...e,value:{...e.value,loadingMore:!0}}:e,sn= exports.ca =(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}}}},ln= exports.da =(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 dn=/^#[0-9a-f]{6}$/i,cn=/^[a-z][a-z0-9-]*$/,Ae=e=>{if(!dn.test(e))throw new RangeError(`A palette colour must be #rrggbb: ${e}`);return e},$e= exports.ea =({light:e,dark:t})=>`light-dark(${Ae(e)}, ${Ae(t)})`,un= exports.fa =e=>{if(!cn.test(e))throw new RangeError(`A root attribute must be lowercase letters, digits and hyphens, starting with a letter: ${e}`);return`[${e}] ::placeholder { color: ${$e(i.color["fg-muted"])}; opacity: 1; }`};var De=["indigo","violet","purple","fuchsia","pink","rose","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue"],mn= exports.ha =["fg","tint","accent","line","solid","solid-hover"],fn={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"}}},h=({light:e,dark:t})=>Object.freeze({light:e,dark:t}),gn=({fg:e,tint:t,accent:n})=>Object.freeze({fg:h(e),tint:h(t),accent:h(n),line:h({light:e.dark,dark:e.light}),solid:h(e),"solid-hover":h({light:t.dark,dark:t.light})}),pn= exports.ia =Object.freeze(Object.fromEntries(De.map(e=>[e,gn(fn[e])])));exports.a = Be; exports.b = He; exports.c = $; exports.d = We; exports.e = se; exports.f = le; exports.g = Ye; exports.h = T; exports.i = c; exports.j = et; exports.k = tt; exports.l = H; exports.m = rt; exports.n = x; exports.o = w; exports.p = st; exports.q = ft; exports.r = xe; exports.s = k; exports.t = Re; exports.u = Ce; exports.v = i; exports.w = Mt; exports.x = R; exports.y = C; exports.z = g; exports.A = q; exports.B = $t; exports.C = Dt; exports.D = vt; exports.E = Ut; exports.F = Bt; exports.G = Ht; exports.H = M; exports.I = Gt; exports.J = Hn; exports.K = Xt; exports.L = Ie; exports.M = zn; exports.N = Yt; exports.O = y; exports.P = Vt; exports.Q = Kn; exports.R = Fe; exports.S = Jt; exports.T = Zt; exports.U = Qt; exports.V = en; exports.W = tn; exports.X = er; exports.Y = nn; exports.Z = J; exports._ = Z; exports.$ = rn; exports.aa = on; exports.ba = an; exports.ca = sn; exports.da = ln; exports.ea = $e; exports.fa = un; exports.ga = De; exports.ha = mn; exports.ia = pn;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var o=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;var i=n=>{let e=o.exec(n);if(e===null)throw new RangeError(`Colour must be #rrggbb: ${n}`);let[,s,r,t]=e;return[Number.parseInt(s,16)/255,Number.parseInt(r,16)/255,Number.parseInt(t,16)/255]},c= exports.b =n=>n<=.04045?n/12.92:((n+.055)/1.055)**2.4,f= exports.c =n=>n<=.0031308?n*12.92:1.055*n**.4166666666666667-.055,a= exports.d =n=>{for(let t of n)if(!(t>=0&&t<=1))throw new RangeError(`sRGB channels must be numbers in [0, 1]: ${n.join(", ")}`);let[e,s,r]=n;return .2126*c(e)+.7152*c(s)+.0722*c(r)},g= exports.e =(n,e)=>{let[s,r]=[a(n),a(e)].sort((t,u)=>u-t);return(s+.05)/(r+.05)},l= exports.f ={text:7,largeText:4.5,nonText:3},d= exports.g ={text:7,largeText:4.5,nonText:4.5},b= exports.h =["standard","more"],x= exports.i ={light:{fg:{surface:17.83,subtle:17.04,sunken:16.28,"danger-tint":16.3,"warning-tint":17.19,"success-tint":16.93,"info-tint":16.38},"fg-secondary":{surface:10.36,subtle:9.9,sunken:9.45},"fg-muted":{surface:7.8,subtle:7.46,sunken:7.12,"danger-tint":7.13,"warning-tint":7.52,"info-tint":7.17},"danger-fg":{surface:8.36,subtle:7.99,"danger-tint":7.64},"warning-fg":{surface:9.06,subtle:8.66,"warning-tint":8.73},"success-fg":{surface:7.61,subtle:7.27,"success-tint":7.23},"info-fg":{surface:8.82,"info-tint":8.11,subtle:8.43},"on-solid":{"neutral-solid":10.36,"danger-solid":8.36,"success-solid":7.61,"info-solid":8.82,"warning-solid":9.06},"danger-accent":{surface:4.77,"danger-tint":4.36},"warning-accent":{surface:5.03,"warning-tint":4.85},"success-accent":{surface:3.65,"success-tint":3.47},"info-accent":{surface:5.25,subtle:5.01,sunken:4.79,"info-tint":4.82},focus:{surface:5.25,subtle:5.01,sunken:4.79,"info-tint":4.82},"border-control":{surface:4.76,subtle:4.55,sunken:4.35}},dark:{fg:{surface:17.04,subtle:13.97,sunken:19.27,"danger-tint":15.45,"warning-tint":14.34,"success-tint":14.51,"info-tint":14.13},"fg-secondary":{surface:14.46,subtle:11.86,sunken:16.35},"fg-muted":{surface:12,subtle:9.83,sunken:13.56,"danger-tint":10.87,"warning-tint":10.09,"info-tint":9.94},"danger-fg":{surface:12.27,subtle:10.06,"danger-tint":11.12},"warning-fg":{surface:14.33,subtle:11.74,"warning-tint":12.05},"success-fg":{surface:13.94,subtle:11.43,"success-tint":11.87},"info-fg":{surface:12.54,"info-tint":10.39,subtle:10.28},"on-solid":{"neutral-solid":12,"danger-solid":9.29,"success-solid":11.72,"info-solid":9.83,"warning-solid":12.32},"danger-accent":{surface:6.17,"danger-tint":5.6},"warning-accent":{surface:10.4,"warning-tint":8.75},"success-accent":{surface:9.2,"success-tint":7.83},"info-accent":{surface:6.76,subtle:5.54,sunken:7.64,"info-tint":5.6},focus:{surface:6.76,subtle:5.54,sunken:7.64,"info-tint":5.6},"border-control":{surface:6.78,subtle:5.56,sunken:7.66}},contrastLight:{fg:{surface:19.36,subtle:18.5,sunken:17.67,"danger-tint":17.7,"warning-tint":18.67,"success-tint":18.38,"info-tint":17.79},"fg-secondary":{surface:14.67,subtle:14.02,sunken:13.39},"fg-muted":{surface:12.75,subtle:12.19,sunken:11.64,"danger-tint":11.66,"warning-tint":12.3,"info-tint":11.72},"danger-fg":{surface:13.28,subtle:12.69,"danger-tint":12.14},"warning-fg":{surface:13.82,subtle:13.21,"warning-tint":13.33},"success-fg":{surface:12.67,subtle:12.11,"success-tint":12.03},"info-fg":{surface:13.64,"info-tint":12.54,subtle:13.04},"on-solid":{"neutral-solid":10.36,"danger-solid":8.36,"success-solid":7.61,"info-solid":8.82,"warning-solid":9.06},"danger-accent":{surface:10,"danger-tint":9.14},"warning-accent":{surface:10.32,"warning-tint":9.95},"success-accent":{surface:8.79,"success-tint":8.35},"info-accent":{surface:10.48,subtle:10.01,sunken:9.56,"info-tint":9.63},focus:{surface:10.48,subtle:10.01,sunken:9.56,"info-tint":9.63},"border-control":{surface:10.02,subtle:9.58,sunken:9.15}},contrastDark:{fg:{surface:17.36,subtle:14.23,sunken:19.62,"danger-tint":15.74,"warning-tint":14.6,"success-tint":14.78,"info-tint":14.39},"fg-secondary":{surface:16.02,subtle:13.13,sunken:18.11},"fg-muted":{surface:14.59,subtle:11.96,sunken:16.49,"danger-tint":13.22,"warning-tint":12.27,"info-tint":12.09},"danger-fg":{surface:14.82,subtle:12.15,"danger-tint":13.44},"warning-fg":{surface:15.99,subtle:13.11,"warning-tint":13.45},"success-fg":{surface:15.78,subtle:12.94,"success-tint":13.44},"info-fg":{surface:15,"info-tint":12.43,subtle:12.29},"on-solid":{"neutral-solid":13.02,"danger-solid":10.09,"success-solid":12.72,"info-solid":10.68,"warning-solid":13.38},"danger-accent":{surface:10.47,"danger-tint":9.49},"warning-accent":{surface:13.62,"warning-tint":11.46},"success-accent":{surface:12.81,"success-tint":10.91},"info-accent":{surface:11.01,subtle:9.03,sunken:12.45,"info-tint":9.13},focus:{surface:11.01,subtle:9.03,sunken:12.45,"info-tint":9.13},"border-control":{surface:10.98,subtle:9,sunken:12.41}}},w= exports.j ={fg:"text","fg-secondary":"text","fg-muted":"text","danger-fg":"text","warning-fg":"text","success-fg":"text","info-fg":"text","on-solid":"text","danger-accent":"nonText","warning-accent":"nonText","success-accent":"nonText","info-accent":"nonText",focus:"nonText","border-control":"nonText"};exports.a = i; exports.b = c; exports.c = f; exports.d = a; exports.e = g; exports.f = l; exports.g = d; exports.h = b; exports.i = x; exports.j = w;
package/dist/core.cjs CHANGED
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkW3FRNSCOcjs = require('./chunk-W3FRNSCO.cjs');var _chunkXLOWKWIIcjs = require('./chunk-XLOWKWII.cjs');exports.COMPACT_ROW_PX = _chunkW3FRNSCOcjs.u; exports.CONSOLE_UI_LABEL_CATALOGS = _chunkW3FRNSCOcjs.o; exports.CONTRAST_MINIMUM = _chunkXLOWKWIIcjs.f; exports.CONTRAST_PAIRS = _chunkXLOWKWIIcjs.i; exports.FIGURE_RING_REACH_PX = _chunkW3FRNSCOcjs.L; exports.FLEXIBLE_COLUMN_MIN_PX = _chunkW3FRNSCOcjs.C; exports.HTTP_FORBIDDEN = _chunkW3FRNSCOcjs.U; exports.LATTICE_PX = _chunkW3FRNSCOcjs.q; exports.MORE_CONTRAST_MINIMUM = _chunkXLOWKWIIcjs.g; exports.ROW_WITH_CONTROL_PX = _chunkW3FRNSCOcjs.t; exports.TARGET_PX = _chunkW3FRNSCOcjs.s; exports.TOKENS = _chunkW3FRNSCOcjs.v; exports.TONES = _chunkW3FRNSCOcjs.ia; exports.TONE_HUES = _chunkW3FRNSCOcjs.ga; exports.TONE_ROLES = _chunkW3FRNSCOcjs.ha; exports.ZonedTimeError = _chunkW3FRNSCOcjs.i; exports.beginPage = _chunkW3FRNSCOcjs.ba; exports.beginPagedReload = _chunkW3FRNSCOcjs.$; exports.beginReload = _chunkW3FRNSCOcjs.Z; exports.ceil8 = _chunkW3FRNSCOcjs.z; exports.ceilToLattice = _chunkW3FRNSCOcjs.r; exports.cellContentInlinePx = _chunkW3FRNSCOcjs.A; exports.comparisonAttributePx = _chunkW3FRNSCOcjs.D; exports.contrastRatio = _chunkXLOWKWIIcjs.e; exports.countSampleText = _chunkW3FRNSCOcjs.F; exports.cssVar = _chunkW3FRNSCOcjs.w; exports.figureBoxPlan = _chunkW3FRNSCOcjs.I; exports.figureDiscLabelPlan = _chunkW3FRNSCOcjs.K; exports.fillLabel = _chunkW3FRNSCOcjs.m; exports.fixedColumnPx = _chunkW3FRNSCOcjs.B; exports.flatMapOutcome = _chunkW3FRNSCOcjs.W; exports.formatByteSize = _chunkW3FRNSCOcjs.d; exports.formatCount = _chunkW3FRNSCOcjs.c; exports.formatInstant = _chunkW3FRNSCOcjs.l; exports.goldenSectionPx = _chunkW3FRNSCOcjs.N; exports.hexToSrgb = _chunkXLOWKWIIcjs.a; exports.instantSampleText = _chunkW3FRNSCOcjs.E; exports.isReadableText = _chunkW3FRNSCOcjs.h; exports.keepLastGood = _chunkW3FRNSCOcjs._; exports.lightDark = _chunkW3FRNSCOcjs.ea; exports.mapOutcome = _chunkW3FRNSCOcjs.V; exports.mapPagedList = _chunkW3FRNSCOcjs.da; exports.masterDetailPlan = _chunkW3FRNSCOcjs.P; exports.monoTextWidthEm = _chunkW3FRNSCOcjs.y; exports.placeholderRule = _chunkW3FRNSCOcjs.fa; exports.pxToRem = _chunkW3FRNSCOcjs.O; exports.readDecimalText = _chunkW3FRNSCOcjs.f; exports.readIntegerText = _chunkW3FRNSCOcjs.g; exports.reasonAside = _chunkW3FRNSCOcjs.n; exports.resolveConsoleUiLabels = _chunkW3FRNSCOcjs.p; exports.settleFirstPage = _chunkW3FRNSCOcjs.aa; exports.settlePage = _chunkW3FRNSCOcjs.ca; exports.spacedTextWidthEm = _chunkW3FRNSCOcjs.H; exports.tableFrameMinInlinePx = _chunkW3FRNSCOcjs.S; exports.tableMinInlinePx = _chunkW3FRNSCOcjs.R; exports.textWidthEm = _chunkW3FRNSCOcjs.x; exports.tileGridPlan = _chunkW3FRNSCOcjs.T; exports.tileMinInlinePx = _chunkW3FRNSCOcjs.G; exports.toOffsetIso = _chunkW3FRNSCOcjs.j; exports.toWallTime = _chunkW3FRNSCOcjs.k; exports.topmostModalOf = _chunkW3FRNSCOcjs.b;
package/dist/core.d.cts CHANGED
@@ -1,3 +1,12 @@
1
+ type TopmostModal = {
2
+ readonly kind: "none";
3
+ } | {
4
+ readonly kind: "topmost";
5
+ readonly dialog: HTMLDialogElement;
6
+ } | {
7
+ readonly kind: "undecidable";
8
+ };
9
+ declare const topmostModalOf: (document: Document) => TopmostModal;
1
10
  declare const formatCount: (value: number, formatLocale: string) => string;
2
11
  declare const formatByteSize: (size: number, formatLocale: string) => string;
3
12
  declare const readDecimalText: (text: string) => number | null;
@@ -72,6 +81,11 @@ type WeightToken = "regular" | "medium" | "bold";
72
81
  type RadiusToken = "radius-control" | "radius-item" | "radius-container" | "radius-pill";
73
82
  type SizeToken = "size-control" | "size-row" | "size-row-compact" | "size-row-control" | "size-target";
74
83
  type StrokeToken = "border-width" | "focus-width" | "focus-offset" | "marker-width";
84
+ type MeasureToken = "measure-dialog";
85
+ type Measure = {
86
+ readonly ic: number;
87
+ readonly inset: SpaceToken;
88
+ };
75
89
  type SchemeColor = {
76
90
  readonly light: string;
77
91
  readonly dark: string;
@@ -87,7 +101,9 @@ type ConsoleUiTokens$1<ColorToken extends string = string> = {
87
101
  readonly size: Readonly<Record<SizeToken, number>>;
88
102
  readonly stroke: Readonly<Record<StrokeToken, number>>;
89
103
  readonly motion: Readonly<Record<MotionToken, number>>;
104
+ readonly measure: Readonly<Record<MeasureToken, Measure>>;
90
105
  readonly color: Readonly<Record<ColorToken, SchemeColor>>;
106
+ readonly moreContrastColor: Readonly<Record<ColorToken, SchemeColor>>;
91
107
  };
92
108
  declare const CONSOLE_PALETTE: {
93
109
  readonly fg: {
@@ -205,7 +221,7 @@ declare const TOKENS: ConsoleUiTokens;
205
221
  type FgRole = "fg" | "fg-secondary" | "fg-muted" | "danger-fg" | "warning-fg" | "success-fg" | "info-fg" | "on-solid";
206
222
  type SurfaceRole = "surface" | "subtle" | "sunken" | "danger-tint" | "warning-tint" | "success-tint" | "info-tint" | "neutral-solid" | "danger-solid" | "success-solid" | "info-solid" | "warning-solid";
207
223
  type AccentRole = "danger-accent" | "warning-accent" | "success-accent" | "info-accent";
208
- type TokenName = SpaceToken | `font-size-${TypeToken}` | `line-height-${TypeToken}` | `font-weight-${WeightToken}` | RadiusToken | SizeToken | StrokeToken | MotionToken | ColorToken;
224
+ type TokenName = SpaceToken | `font-size-${TypeToken}` | `line-height-${TypeToken}` | `font-weight-${WeightToken}` | RadiusToken | SizeToken | StrokeToken | MotionToken | MeasureToken | ColorToken;
209
225
  declare const cssVar: (name: TokenName) => string;
210
226
  type TextFace = "sans" | "mono";
211
227
  declare const textWidthEm: (text: string) => number;
@@ -391,8 +407,15 @@ declare const CONTRAST_MINIMUM: {
391
407
  readonly largeText: 4.5;
392
408
  readonly nonText: 3;
393
409
  };
410
+ declare const MORE_CONTRAST_MINIMUM: {
411
+ readonly text: 7;
412
+ readonly largeText: 4.5;
413
+ readonly nonText: 4.5;
414
+ };
394
415
  type ContrastRole = FgRole | AccentRole | "focus" | "border-control";
395
416
  type ColorScheme = "light" | "dark";
417
+ type ContrastLevel = "standard" | "more";
418
+ type PaletteName = ColorScheme | "contrastLight" | "contrastDark";
396
419
  declare const CONTRAST_PAIRS: {
397
420
  readonly light: {
398
421
  readonly fg: {
@@ -554,6 +577,166 @@ declare const CONTRAST_PAIRS: {
554
577
  readonly sunken: 7.66;
555
578
  };
556
579
  };
580
+ readonly contrastLight: {
581
+ readonly fg: {
582
+ readonly surface: 19.36;
583
+ readonly subtle: 18.5;
584
+ readonly sunken: 17.67;
585
+ readonly "danger-tint": 17.7;
586
+ readonly "warning-tint": 18.67;
587
+ readonly "success-tint": 18.38;
588
+ readonly "info-tint": 17.79;
589
+ };
590
+ readonly "fg-secondary": {
591
+ readonly surface: 14.67;
592
+ readonly subtle: 14.02;
593
+ readonly sunken: 13.39;
594
+ };
595
+ readonly "fg-muted": {
596
+ readonly surface: 12.75;
597
+ readonly subtle: 12.19;
598
+ readonly sunken: 11.64;
599
+ readonly "danger-tint": 11.66;
600
+ readonly "warning-tint": 12.3;
601
+ readonly "info-tint": 11.72;
602
+ };
603
+ readonly "danger-fg": {
604
+ readonly surface: 13.28;
605
+ readonly subtle: 12.69;
606
+ readonly "danger-tint": 12.14;
607
+ };
608
+ readonly "warning-fg": {
609
+ readonly surface: 13.82;
610
+ readonly subtle: 13.21;
611
+ readonly "warning-tint": 13.33;
612
+ };
613
+ readonly "success-fg": {
614
+ readonly surface: 12.67;
615
+ readonly subtle: 12.11;
616
+ readonly "success-tint": 12.03;
617
+ };
618
+ readonly "info-fg": {
619
+ readonly surface: 13.64;
620
+ readonly "info-tint": 12.54;
621
+ readonly subtle: 13.04;
622
+ };
623
+ readonly "on-solid": {
624
+ readonly "neutral-solid": 10.36;
625
+ readonly "danger-solid": 8.36;
626
+ readonly "success-solid": 7.61;
627
+ readonly "info-solid": 8.82;
628
+ readonly "warning-solid": 9.06;
629
+ };
630
+ readonly "danger-accent": {
631
+ readonly surface: 10;
632
+ readonly "danger-tint": 9.14;
633
+ };
634
+ readonly "warning-accent": {
635
+ readonly surface: 10.32;
636
+ readonly "warning-tint": 9.95;
637
+ };
638
+ readonly "success-accent": {
639
+ readonly surface: 8.79;
640
+ readonly "success-tint": 8.35;
641
+ };
642
+ readonly "info-accent": {
643
+ readonly surface: 10.48;
644
+ readonly subtle: 10.01;
645
+ readonly sunken: 9.56;
646
+ readonly "info-tint": 9.63;
647
+ };
648
+ readonly focus: {
649
+ readonly surface: 10.48;
650
+ readonly subtle: 10.01;
651
+ readonly sunken: 9.56;
652
+ readonly "info-tint": 9.63;
653
+ };
654
+ readonly "border-control": {
655
+ readonly surface: 10.02;
656
+ readonly subtle: 9.58;
657
+ readonly sunken: 9.15;
658
+ };
659
+ };
660
+ readonly contrastDark: {
661
+ readonly fg: {
662
+ readonly surface: 17.36;
663
+ readonly subtle: 14.23;
664
+ readonly sunken: 19.62;
665
+ readonly "danger-tint": 15.74;
666
+ readonly "warning-tint": 14.6;
667
+ readonly "success-tint": 14.78;
668
+ readonly "info-tint": 14.39;
669
+ };
670
+ readonly "fg-secondary": {
671
+ readonly surface: 16.02;
672
+ readonly subtle: 13.13;
673
+ readonly sunken: 18.11;
674
+ };
675
+ readonly "fg-muted": {
676
+ readonly surface: 14.59;
677
+ readonly subtle: 11.96;
678
+ readonly sunken: 16.49;
679
+ readonly "danger-tint": 13.22;
680
+ readonly "warning-tint": 12.27;
681
+ readonly "info-tint": 12.09;
682
+ };
683
+ readonly "danger-fg": {
684
+ readonly surface: 14.82;
685
+ readonly subtle: 12.15;
686
+ readonly "danger-tint": 13.44;
687
+ };
688
+ readonly "warning-fg": {
689
+ readonly surface: 15.99;
690
+ readonly subtle: 13.11;
691
+ readonly "warning-tint": 13.45;
692
+ };
693
+ readonly "success-fg": {
694
+ readonly surface: 15.78;
695
+ readonly subtle: 12.94;
696
+ readonly "success-tint": 13.44;
697
+ };
698
+ readonly "info-fg": {
699
+ readonly surface: 15;
700
+ readonly "info-tint": 12.43;
701
+ readonly subtle: 12.29;
702
+ };
703
+ readonly "on-solid": {
704
+ readonly "neutral-solid": 13.02;
705
+ readonly "danger-solid": 10.09;
706
+ readonly "success-solid": 12.72;
707
+ readonly "info-solid": 10.68;
708
+ readonly "warning-solid": 13.38;
709
+ };
710
+ readonly "danger-accent": {
711
+ readonly surface: 10.47;
712
+ readonly "danger-tint": 9.49;
713
+ };
714
+ readonly "warning-accent": {
715
+ readonly surface: 13.62;
716
+ readonly "warning-tint": 11.46;
717
+ };
718
+ readonly "success-accent": {
719
+ readonly surface: 12.81;
720
+ readonly "success-tint": 10.91;
721
+ };
722
+ readonly "info-accent": {
723
+ readonly surface: 11.01;
724
+ readonly subtle: 9.03;
725
+ readonly sunken: 12.45;
726
+ readonly "info-tint": 9.13;
727
+ };
728
+ readonly focus: {
729
+ readonly surface: 11.01;
730
+ readonly subtle: 9.03;
731
+ readonly sunken: 12.45;
732
+ readonly "info-tint": 9.13;
733
+ };
734
+ readonly "border-control": {
735
+ readonly surface: 10.98;
736
+ readonly subtle: 9;
737
+ readonly sunken: 12.41;
738
+ };
739
+ };
557
740
  };
558
741
  declare const lightDark: ({ light, dark }: SchemeColor) => string;
559
742
  declare const placeholderRule: (rootAttribute: string) => string;
@@ -588,4 +771,4 @@ declare const TONE_ROLES: readonly [
588
771
  type ToneRole = (typeof TONE_ROLES)[number];
589
772
  type Tone = Readonly<Record<ToneRole, SchemeColor>>;
590
773
  declare const TONES: Readonly<Record<ToneHue, Tone>>;
591
- export { type AccentRole, COMPACT_ROW_PX, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, type CellContent, type ColorScheme, type ColorToken, type ColumnHeaderText, type ColumnWidth, type ColumnWidthSource, type CommandOutcome, type ConsoleUiLabels, type ConsoleUiLocale, type ConsoleUiTokens, type ContrastRole, FIGURE_RING_REACH_PX, FLEXIBLE_COLUMN_MIN_PX, type FgRole, type FigureBoxLines, type FigureBoxPlan, type FigureDiscLabelPlan, HTTP_FORBIDDEN, type KeysetPage, LATTICE_PX, type MasterDetailOptions, type MasterDetailPlan, type MotionToken, type NextPage, type PageFailure, type PagedContent, type PagedState, type PagedValue, ROW_WITH_CONTROL_PX, type RadiusToken, type ReloadCause, type ResourceFailure, type ResourceOutcome, type ResourceState, type SchemeColor, type SizeToken, type SpaceToken, type Srgb, type StrokeToken, type SurfaceRole, TARGET_PX, TOKENS, TONES, TONE_HUES, TONE_ROLES, type TextFace, type TileGridPlan, type TileGridStep, type TokenName, type Tone, type ToneHue, type ToneRole, type TypeToken, type WeightToken, ZonedTimeError, type ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, ceilToLattice, cellContentInlinePx, comparisonAttributePx, contrastRatio, countSampleText, cssVar, figureBoxPlan, figureDiscLabelPlan, fillLabel, fixedColumnPx, flatMapOutcome, formatByteSize, formatCount, formatInstant, goldenSectionPx, hexToSrgb, instantSampleText, isReadableText, keepLastGood, lightDark, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, placeholderRule, pxToRem, readDecimalText, readIntegerText, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, spacedTextWidthEm, tableFrameMinInlinePx, tableMinInlinePx, textWidthEm, tileGridPlan, tileMinInlinePx, toOffsetIso, toWallTime };
774
+ export { type AccentRole, COMPACT_ROW_PX, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, type CellContent, type ColorScheme, type ColorToken, type ColumnHeaderText, type ColumnWidth, type ColumnWidthSource, type CommandOutcome, type ConsoleUiLabels, type ConsoleUiLocale, type ConsoleUiTokens, type ContrastLevel, type ContrastRole, FIGURE_RING_REACH_PX, FLEXIBLE_COLUMN_MIN_PX, type FgRole, type FigureBoxLines, type FigureBoxPlan, type FigureDiscLabelPlan, HTTP_FORBIDDEN, type KeysetPage, LATTICE_PX, MORE_CONTRAST_MINIMUM, type MasterDetailOptions, type MasterDetailPlan, type Measure, type MeasureToken, type MotionToken, type NextPage, type PageFailure, type PagedContent, type PagedState, type PagedValue, type PaletteName, ROW_WITH_CONTROL_PX, type RadiusToken, type ReloadCause, type ResourceFailure, type ResourceOutcome, type ResourceState, type SchemeColor, type SizeToken, type SpaceToken, type Srgb, type StrokeToken, type SurfaceRole, TARGET_PX, TOKENS, TONES, TONE_HUES, TONE_ROLES, type TextFace, type TileGridPlan, type TileGridStep, type TokenName, type Tone, type ToneHue, type ToneRole, type TopmostModal, type TypeToken, type WeightToken, ZonedTimeError, type ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, ceilToLattice, cellContentInlinePx, comparisonAttributePx, contrastRatio, countSampleText, cssVar, figureBoxPlan, figureDiscLabelPlan, fillLabel, fixedColumnPx, flatMapOutcome, formatByteSize, formatCount, formatInstant, goldenSectionPx, hexToSrgb, instantSampleText, isReadableText, keepLastGood, lightDark, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, placeholderRule, pxToRem, readDecimalText, readIntegerText, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, spacedTextWidthEm, tableFrameMinInlinePx, tableMinInlinePx, textWidthEm, tileGridPlan, tileMinInlinePx, toOffsetIso, toWallTime, topmostModalOf };