@aiquants/console-ui 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,19 @@
1
- import { ConsoleUiLocale, ConsoleUiLabels, ColumnWidth, ResourceFailure, SpaceToken, FgRole, TypeToken, ResourceOutcome, KeysetPage, NextPage, PagedState, PagedContent, ResourceState } from "./core.js";
2
- export { AccentRole, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, ColorToken, ColumnWidthSource, CommandOutcome, ConsoleUiTokens, ContrastRole, HTTP_FORBIDDEN, MasterDetailOptions, MasterDetailPlan, PageFailure, PagedValue, RadiusToken, ReloadCause, SizeToken, Srgb, StrokeToken, SurfaceRole, TOKENS, TileGridPlan, TileGridStep, TokenName, WeightToken, ZonedTimeError, ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, contrastRatio, cssVar, flatMapOutcome, formatCount, formatInstant, hexToSrgb, keepLastGood, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, tableMinInlinePx, textWidthEm, tileGridPlan, toOffsetIso, toWallTime } from "./core.js";
1
+ import { ConsoleUiLocale, ConsoleUiLabels, ColumnWidth, TypeToken, ResourceFailure, SpaceToken, FgRole, ResourceOutcome, KeysetPage, NextPage, PagedState, PagedContent, ResourceState } from "./core.js";
2
+ export { AccentRole, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, ColorScheme, ColorToken, ColumnWidthSource, CommandOutcome, ConsoleUiTokens, ContrastRole, HTTP_FORBIDDEN, LATTICE_PX, MasterDetailOptions, MasterDetailPlan, MotionToken, PageFailure, PagedValue, ROW_WITH_CONTROL_PX, RadiusToken, ReloadCause, SchemeColor, SizeToken, Srgb, StrokeToken, SurfaceRole, TARGET_PX, TOKENS, TileGridPlan, TileGridStep, TokenName, WeightToken, ZonedTimeError, ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, ceilToLattice, contrastRatio, cssVar, flatMapOutcome, formatCount, formatInstant, hexToSrgb, keepLastGood, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, tableMinInlinePx, textWidthEm, tileGridPlan, toOffsetIso, toWallTime } from "./core.js";
3
3
  import * as react from "react";
4
4
  import { ReactNode, MouseEvent, Ref, RefObject, RefCallback, KeyboardEvent } from "react";
5
+ type BreadcrumbItem = {
6
+ readonly id: string;
7
+ readonly label: string;
8
+ readonly href: string;
9
+ };
10
+ type BreadcrumbProps = {
11
+ readonly items: readonly BreadcrumbItem[];
12
+ readonly current: string;
13
+ readonly onNavigate: (href: string) => void;
14
+ readonly testId: string;
15
+ };
16
+ declare const Breadcrumb: ({ items, current, onNavigate, testId }: BreadcrumbProps) => react.JSX.Element;
5
17
  type DataAttributes = Readonly<Record<`data-${string}`, string | number | boolean>>;
6
18
  type ButtonVariant = "primary" | "secondary" | "danger" | "link";
7
19
  type ButtonProps = {
@@ -56,6 +68,12 @@ type CardSectionProps = {
56
68
  readonly children: ReactNode;
57
69
  };
58
70
  declare const CardSection: ({ id, title, subtitle, region, testId, headingRef, ref, dataAttributes, children }: CardSectionProps) => react.JSX.Element;
71
+ type CodeBlockProps = {
72
+ readonly label: string;
73
+ readonly code: string;
74
+ readonly testId: string;
75
+ };
76
+ declare const CodeBlock: ({ label, code, testId }: CodeBlockProps) => react.JSX.Element;
59
77
  type ComparisonLayout = "table" | "stack";
60
78
  type ComparisonAttribute = {
61
79
  readonly key: string;
@@ -114,6 +132,32 @@ type DataTableProps<T> = {
114
132
  readonly ref?: Ref<HTMLDivElement>;
115
133
  };
116
134
  declare const DataTable: <T>({ caption, captionHidden, columns, rows, rowKey, rowTestId, rowData, rowSize, empty, testId, ref }: DataTableProps<T>) => react.JSX.Element;
135
+ type DescriptionItem = {
136
+ readonly key: string;
137
+ readonly term: string;
138
+ readonly description: ReactNode;
139
+ };
140
+ type DescriptionListProps = {
141
+ readonly items: readonly DescriptionItem[];
142
+ readonly testId: string;
143
+ };
144
+ declare const DescriptionList: ({ items, testId }: DescriptionListProps) => react.JSX.Element;
145
+ type DialogProps = {
146
+ readonly title: string;
147
+ readonly open: boolean;
148
+ readonly onClose: () => void;
149
+ readonly testId: string;
150
+ readonly children: ReactNode;
151
+ };
152
+ declare const Dialog: ({ title, open, onClose, testId, children }: DialogProps) => react.JSX.Element;
153
+ type DisclosureProps = {
154
+ readonly summary: string;
155
+ readonly open: boolean;
156
+ readonly onOpenChange: (open: boolean) => void;
157
+ readonly testId: string;
158
+ readonly children: ReactNode;
159
+ };
160
+ declare const Disclosure: ({ summary, open, onOpenChange, testId, children }: DisclosureProps) => react.JSX.Element;
117
161
  type FieldControl = {
118
162
  readonly id: string;
119
163
  readonly "aria-describedby": string | undefined;
@@ -170,6 +214,50 @@ type RadioGroupProps = {
170
214
  readonly ref?: Ref<HTMLInputElement>;
171
215
  };
172
216
  declare const RadioGroup: ({ legend, description, error, value, options, onValueChange, testId, ref }: RadioGroupProps) => react.JSX.Element;
217
+ type HeadingType = Extract<TypeToken, "title" | "heading" | "display" | "display-lg">;
218
+ type HeadingProps = {
219
+ readonly level: 1 | 2 | 3;
220
+ readonly type: HeadingType;
221
+ readonly testId: string;
222
+ readonly headingRef?: Ref<HTMLHeadingElement>;
223
+ readonly children: ReactNode;
224
+ };
225
+ declare const Heading: ({ level, type, testId, headingRef, children }: HeadingProps) => react.JSX.Element;
226
+ type PillTone = "neutral" | "info" | "success" | "warning" | "danger";
227
+ type PillProps = {
228
+ readonly tone: PillTone;
229
+ readonly variant: "tint" | "solid";
230
+ readonly testId: string;
231
+ readonly dataAttributes?: DataAttributes;
232
+ readonly children: ReactNode;
233
+ };
234
+ declare const Pill: ({ tone, variant, testId, dataAttributes, children }: PillProps) => react.JSX.Element;
235
+ type ProgressBarProps = {
236
+ readonly label: string;
237
+ readonly valueText: string;
238
+ readonly value: number | null;
239
+ readonly max: number | null;
240
+ readonly testId: string;
241
+ };
242
+ declare const ProgressBar: ({ label, valueText, value, max, testId }: ProgressBarProps) => react.JSX.Element;
243
+ type JobCancel = {
244
+ readonly label: string;
245
+ readonly busyLabel: string;
246
+ readonly busy: boolean;
247
+ readonly onCancel: () => void;
248
+ };
249
+ type JobCardProps = {
250
+ readonly title: string;
251
+ readonly status: {
252
+ readonly tone: PillTone;
253
+ readonly label: string;
254
+ };
255
+ readonly progress?: Omit<ProgressBarProps, "testId">;
256
+ readonly cancel?: JobCancel;
257
+ readonly testId: string;
258
+ readonly children?: ReactNode;
259
+ };
260
+ declare const JobCard: ({ title, status, progress, cancel, testId, children }: JobCardProps) => react.JSX.Element;
173
261
  type LoadMoreProps = {
174
262
  readonly onLoad: () => void;
175
263
  readonly busy: boolean;
@@ -200,6 +288,15 @@ type MeasuredProps = {
200
288
  readonly testId: string;
201
289
  };
202
290
  declare const Measured: ({ value, unit, testId }: MeasuredProps) => react.JSX.Element;
291
+ type MeterProps = {
292
+ readonly label: string;
293
+ readonly value: number;
294
+ readonly min: number;
295
+ readonly max: number;
296
+ readonly valueText: string;
297
+ readonly testId: string;
298
+ };
299
+ declare const Meter: ({ label, value, min, max, valueText, testId }: MeterProps) => react.JSX.Element;
203
300
  type NoticeProps = {
204
301
  readonly tone: "info" | "warning";
205
302
  readonly testId: string;
@@ -212,23 +309,6 @@ type AlertMessageProps = {
212
309
  readonly children: ReactNode;
213
310
  };
214
311
  declare const AlertMessage: ({ occurrence, testId, children }: AlertMessageProps) => react.JSX.Element;
215
- type PillTone = "neutral" | "info" | "success" | "warning" | "danger";
216
- type PillProps = {
217
- readonly tone: PillTone;
218
- readonly variant: "tint" | "solid";
219
- readonly testId: string;
220
- readonly dataAttributes?: DataAttributes;
221
- readonly children: ReactNode;
222
- };
223
- declare const Pill: ({ tone, variant, testId, dataAttributes, children }: PillProps) => react.JSX.Element;
224
- type ProgressBarProps = {
225
- readonly label: string;
226
- readonly valueText: string;
227
- readonly value: number | null;
228
- readonly max: number | null;
229
- readonly testId: string;
230
- };
231
- declare const ProgressBar: ({ label, valueText, value, max, testId }: ProgressBarProps) => react.JSX.Element;
232
312
  type ResourceFailedProps = {
233
313
  readonly failure: ResourceFailure;
234
314
  readonly onReload: () => void;
@@ -238,6 +318,18 @@ type ResourceFailedProps = {
238
318
  readonly testId: string;
239
319
  };
240
320
  declare const ResourceFailed: ({ failure, onReload, forbiddenMessage, failureMessage, rescueRef, testId }: ResourceFailedProps) => react.JSX.Element;
321
+ type SegmentedOption = {
322
+ readonly value: string;
323
+ readonly label: string;
324
+ };
325
+ type SegmentedControlProps = {
326
+ readonly label: string;
327
+ readonly options: readonly SegmentedOption[];
328
+ readonly value: string;
329
+ readonly onValueChange: (value: string) => void;
330
+ readonly testId: string;
331
+ };
332
+ declare const SegmentedControl: ({ label, options, value, onValueChange, testId }: SegmentedControlProps) => react.JSX.Element;
241
333
  type RowButtonProps = {
242
334
  readonly selected: boolean;
243
335
  readonly controls: string;
@@ -263,6 +355,17 @@ type SelectableListProps<T> = {
263
355
  readonly ref?: Ref<HTMLDivElement>;
264
356
  };
265
357
  declare const SelectableList: <T>({ label, items, itemKey, selectedKey, onSelect, detailId, renderRow, rowTestId, rowData, empty, testId, ref }: SelectableListProps<T>) => react.JSX.Element;
358
+ type SliderProps = {
359
+ readonly label: string;
360
+ readonly value: number;
361
+ readonly min: number;
362
+ readonly max: number;
363
+ readonly step: number;
364
+ readonly valueText: (value: number) => string;
365
+ readonly onValueChange: (value: number) => void;
366
+ readonly testId: string;
367
+ };
368
+ declare const Slider: ({ label, value, min, max, step, valueText, onValueChange, testId }: SliderProps) => react.JSX.Element;
266
369
  type StackProps = {
267
370
  readonly gap: SpaceToken;
268
371
  readonly testId: string;
@@ -270,6 +373,38 @@ type StackProps = {
270
373
  };
271
374
  declare const Stack: ({ gap, testId, children }: StackProps) => react.JSX.Element;
272
375
  declare const Cluster: ({ gap, testId, children }: StackProps) => react.JSX.Element;
376
+ type StepState = "done" | "current" | "pending";
377
+ type StepperItem = {
378
+ readonly id: string;
379
+ readonly label: string;
380
+ readonly state: StepState;
381
+ };
382
+ type StepperProps = {
383
+ readonly label: string;
384
+ readonly steps: readonly StepperItem[];
385
+ readonly testId: string;
386
+ };
387
+ declare const Stepper: ({ label, steps, testId }: StepperProps) => react.JSX.Element;
388
+ type SwitchProps = {
389
+ readonly label: string;
390
+ readonly checked: boolean;
391
+ readonly onCheckedChange: (checked: boolean) => void;
392
+ readonly testId: string;
393
+ };
394
+ declare const Switch: ({ label, checked, onCheckedChange, testId }: SwitchProps) => react.JSX.Element;
395
+ type TabItem = {
396
+ readonly id: string;
397
+ readonly label: string;
398
+ readonly href: string;
399
+ };
400
+ type TabsProps = {
401
+ readonly label: string;
402
+ readonly items: readonly TabItem[];
403
+ readonly currentId: string;
404
+ readonly onNavigate: (href: string) => void;
405
+ readonly testId: string;
406
+ };
407
+ declare const Tabs: ({ label, items, currentId, onNavigate, testId }: TabsProps) => react.JSX.Element;
273
408
  type TextFace = "sans" | "mono";
274
409
  type TextProps = {
275
410
  readonly fg: FgRole;
@@ -300,6 +435,12 @@ type TileGridProps = {
300
435
  readonly children: ReactNode;
301
436
  };
302
437
  declare const TileGrid: ({ count, minInlinePx, testId, children }: TileGridProps) => react.JSX.Element;
438
+ type ToolbarProps = {
439
+ readonly label: string;
440
+ readonly testId: string;
441
+ readonly children: ReactNode;
442
+ };
443
+ declare const Toolbar: ({ label, testId, children }: ToolbarProps) => react.JSX.Element;
303
444
  declare const useEscapeToClose: (onClose: () => void) => ((event: KeyboardEvent<HTMLElement>) => void);
304
445
  declare const useFocusRescue: (getTarget: () => HTMLElement | null) => RefCallback<HTMLElement>;
305
446
  type PagedLoaders<T, C, M> = {
@@ -326,4 +467,4 @@ type VisuallyHiddenProps = {
326
467
  readonly children: ReactNode;
327
468
  };
328
469
  declare const VisuallyHidden: ({ testId, children }: VisuallyHiddenProps) => react.JSX.Element;
329
- export { ANNOUNCE_SETTLE_MS, AlertMessage, type AlertMessageProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, Cluster, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, type DataAttributes, DataTable, type DataTableProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, KeysetPage, Link, type LinkProps, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, Select, type SelectProps, SelectableList, type SelectableListProps, SpaceToken, Stack, type StackProps, Text, TextArea, type TextAreaProps, type TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, TypeToken, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAnnounce, useConsoleUi, useEscapeToClose, useFocusRescue, usePagedResource, useResource };
470
+ export { ANNOUNCE_SETTLE_MS, AlertMessage, type AlertMessageProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, Cluster, CodeBlock, type CodeBlockProps, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, type DataAttributes, DataTable, type DataTableProps, type DescriptionItem, DescriptionList, type DescriptionListProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, Heading, type HeadingProps, type HeadingType, type JobCancel, JobCard, type JobCardProps, KeysetPage, Link, type LinkProps, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredProps, Meter, type MeterProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, SelectableList, type SelectableListProps, Slider, type SliderProps, SpaceToken, Stack, type StackProps, type StepState, Stepper, type StepperItem, type StepperProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, type TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, Toolbar, type ToolbarProps, TypeToken, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAnnounce, useConsoleUi, useEscapeToClose, useFocusRescue, usePagedResource, useResource };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{A as Te,B as te,C as W,D as Po,a as V,b as io,c as lo,d as co,e as uo,f as qe,g as po,h as yo,i as Q,j,k as ue,l as ee,m as mo,n as fo,o as pe,p as A,q as go,r as ye,s as me,t as Ro,u as bo,v as To,w as fe,x as ge,y as Re,z as be}from"./chunk-YUUKR7HN.js";import{a as ho,b as vo,c as Co,d as xo}from"./chunk-MYMCHY7C.js";import{useId as tt}from"react";import{createContext as _e,useCallback as Ge,useContext as xe,useLayoutEffect as Ve,useMemo as he,useRef as ve}from"react";import{jsx as Ce,jsxs as je}from"react/jsx-runtime";var oe=_e(null),We=" ",Ze='[inert], [aria-hidden="true" i]',Pe="dialog:modal",ze=e=>{if(e.closest(Ze)!==null)return'an ancestor is inert or aria-hidden="true"';let t=e.ownerDocument,o=[...t.querySelectorAll(Pe)],r=t.activeElement,n=o.filter(l=>l.contains(r)),a=n.length>0?n:o,s=a.filter(l=>l.contains(e)).length;return s===a.length?null:s===0?"the topmost open modal dialog does not contain the console":"open modal dialogs both contain and do not contain the console, and focus does not tell which one is topmost"},Ye=e=>{try{e.querySelectorAll(Pe)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},re=150,Xe=1e3,Je=({locale:e,formatLocale:t,timeZone:o,testId:r,children:n})=>{if(xe(oe)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");let s=pe(e),[l]=Intl.getCanonicalLocales(t),d=he(()=>new Intl.DateTimeFormat(l,{timeZone:o}).resolvedOptions().timeZone,[l,o]),u=ve(null),p=ve(null);Ve(()=>{Ye(u.current.ownerDocument)},[]);let i=Ge(y=>{if(y.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let R=()=>{let{texts:N,settle:g,deadline:b}=p.current;p.current=null,clearTimeout(g),clearTimeout(b);let f=u.current;if(f===null)return;let T=N.join(We),h=ze(f);if(h!==null)throw new Error(`announce: the live region is hidden from assistive technology (${h}), so this announcement would be lost: ${T}`);let L=f.ownerDocument.createElement("span");L.textContent=T,f.replaceChildren(L)},P=p.current;if(P===null){p.current={texts:[y],settle:setTimeout(R,re),deadline:setTimeout(R,Xe)};return}P.texts.push(y),clearTimeout(P.settle),P.settle=setTimeout(R,re)},[]),c=he(()=>({locale:e,formatLocale:l,timeZone:d,labels:s,announce:i}),[e,l,d,s,i]);return Ce(oe.Provider,{value:c,children:je("div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":r,children:[n,Ce("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${r}-announcer`,ref:u})]})})},w=()=>{let e=xe(oe);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},m=()=>{w()},Qe=()=>w().announce;var E=e=>{if(e===void 0)return{};for(let t of Object.keys(e))if(!t.startsWith("data-")||t.startsWith("data-cui-")||t==="data-testid")throw new RangeError(`Caller attributes must be data-* and must not override data-cui-* or data-testid: ${t}`);return e};import{jsx as et}from"react/jsx-runtime";var x=({fg:e,type:t,face:o,as:r="span",testId:n,id:a,tabIndex:s,ref:l,children:d})=>(m(),et(r,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":o,"data-testid":n,id:a,tabIndex:s,ref:l,children:d}));import{jsx as F,jsxs as at}from"react/jsx-runtime";var ot={primary:{fg:"on-solid",surface:"info-solid",type:"body"},secondary:{fg:"fg",surface:void 0,type:"body"},danger:{fg:"on-solid",surface:"danger-solid",type:"body"},link:{fg:"info-fg",surface:void 0,type:"prose"}},Ee=({children:e})=>F("span",{children:e}),O=({variant:e,children:t,testId:o,type:r="button",onClick:n,unavailable:a,expanded:s,controls:l,ref:d,dataAttributes:u,busy:p,busyLabel:i})=>{m();let c=tt(),y=p===!0||a!==void 0,R=ot[e],P=N=>{if(y){N.preventDefault();return}n?.(N)};return at("span",{className:"cui-button-group",children:[F("button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":R.fg,"data-cui-surface":R.surface,"data-cui-type":R.type,"data-testid":o,"aria-disabled":y?!0:void 0,"aria-busy":p===!0?!0:void 0,"aria-describedby":a===void 0?void 0:c,"aria-expanded":s,"aria-controls":l,onClick:P,ref:d,...E(u),children:F(Ee,{children:p===!0?i:t})}),a===void 0?null:F(x,{fg:"fg-muted",type:"body",id:c,testId:`${o}-reason`,children:a.reason})]})},rt=({onNavigate:e,children:t,testId:o,ref:r})=>(m(),F("button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"prose","data-testid":o,onClick:e,ref:r,children:F(Ee,{children:t})}));import{useId as Ne}from"react";import{Fragment as it,jsx as k,jsxs as $}from"react/jsx-runtime";var nt=({id:e,title:t,description:o,actions:r,testId:n,headingRef:a,ref:s,dataAttributes:l,children:d})=>{m();let u=Ne();return $("section",{className:"cui-card",id:e,"aria-labelledby":u,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":n,ref:s,...E(l),children:[$("div",{className:"cui-card-header",children:[$("div",{className:"cui-card-heading",children:[k("h2",{className:"cui-card-title",id:u,"data-cui-type":"title",ref:a,tabIndex:a===void 0?void 0:-1,children:t}),o===void 0?null:k("div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),r===void 0?null:k("div",{className:"cui-card-actions",children:r})]}),d]})},st=({id:e,title:t,subtitle:o,region:r=!1,testId:n,headingRef:a,ref:s,dataAttributes:l,children:d})=>{m();let u=Ne(),p=$(it,{children:[$("div",{className:"cui-card-section-heading",children:[k("h3",{className:"cui-card-section-title",id:u,"data-cui-type":"body",ref:a,tabIndex:a===void 0?void 0:-1,children:t}),o===void 0?null:k("div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),d]});return r?k("section",{className:"cui-card-section",id:e,"aria-labelledby":u,"data-testid":n,ref:s,...E(l),children:p}):k("div",{className:"cui-card-section",id:e,"data-testid":n,ref:s,...E(l),children:p})};import{useId as dt}from"react";import{jsx as lt}from"react/jsx-runtime";var D=({ruleKey:e,css:t})=>lt("style",{href:e,precedence:"cui",children:t});import{jsx as C,jsxs as S}from"react/jsx-runtime";var ct=({caption:e,attributes:t,columns:o,attributePx:r,columnMinPx:n,testId:a})=>{m();let s=dt();for(let i of[r,n])if(!(Number.isFinite(i)&&i>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${i}`);if(o.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let i of o)for(let c of t)if(!Object.hasOwn(i.cells,c.key))throw new RangeError(`Column "${i.key}" has no value for attribute "${c.key}"`);let l=r+o.length*n,d=`cui-comparison-a${r}-c${n}-n${o.length}`,u=i=>`[data-cui-comparison="${d}"][data-cui-comparison-layout="${i}"]`,p=`${u("table")}{display:none}@container (min-width:${A(l)}){${u("table")}{display:block}${u("stack")}{display:none}}`;return S("div",{className:"cui-container","data-cui-stack-below-px":l,"data-testid":a,children:[C(D,{ruleKey:d,css:p}),C("div",{className:"cui-comparison-frame","data-cui-comparison":d,"data-cui-comparison-layout":"table",children:S("table",{className:"cui-comparison-table","data-cui-type":"prose",children:[C("caption",{className:"cui-visually-hidden",children:e}),S("colgroup",{children:[C("col",{style:{width:A(r)}}),o.map(i=>C("col",{},i.key))]}),C("thead",{children:S("tr",{children:[C("td",{}),o.map(i=>C("th",{scope:"col",children:i.heading},i.key))]})}),C("tbody",{children:t.map(i=>S("tr",{children:[C("th",{scope:"row",children:i.label}),o.map(c=>C("td",{children:c.cells[i.key]("table")},c.key))]},i.key))})]})}),C("div",{className:"cui-comparison-stack","data-cui-comparison":d,"data-cui-comparison-layout":"stack",children:o.map((i,c)=>{let y=`${s}-column-${c}`;return S("div",{className:"cui-comparison-column",role:"group","aria-labelledby":y,"data-cui-type":"prose",children:[C("p",{className:"cui-comparison-heading",id:y,children:i.heading}),C("dl",{className:"cui-comparison-list",children:t.map(R=>S("div",{children:[C("dt",{children:R.label}),C("dd",{children:i.cells[R.key]("stack")})]},R.key))})]},i.key)})})]})};import{useId as ut}from"react";import{jsx as M,jsxs as yt}from"react/jsx-runtime";var pt=({caption:e,captionHidden:t,columns:o,rows:r,rowKey:n,rowTestId:a,rowData:s,rowSize:l,empty:d,testId:u,ref:p})=>{m();let i=ut(),c=me(o);return M("div",{className:"cui-container","data-testid":u,ref:p,children:r.length===0?M(x,{as:"p",fg:"fg-muted",type:"prose",testId:`${u}-empty`,children:d}):M("section",{className:"cui-table-frame",tabIndex:0,"aria-labelledby":i,"data-testid":`${u}-frame`,children:yt("table",{className:"cui-table","data-cui-type":"prose","data-cui-row-size":l,style:{"--cui-table-min":A(c)},children:[M("caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:i,children:e}),M("colgroup",{children:o.map(y=>M("col",{style:y.width.fixedPx===void 0?void 0:{width:A(y.width.fixedPx)}},y.key))}),M("thead",{children:M("tr",{children:o.map(y=>M("th",{scope:"col","data-cui-align":y.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:y.header},y.key))})}),M("tbody",{children:r.map(y=>M("tr",{tabIndex:-1,"data-cui-row-focus":"","data-testid":a,...E(s?.(y)),children:o.map(R=>M("td",{"data-cui-align":R.align,children:R.cell(y)},R.key))},n(y)))})]})})})};import{useId as Z}from"react";import{Fragment as Tt,jsx as v,jsxs as I}from"react/jsx-runtime";var B=({description:e,error:t})=>{m();let o=Z(),r=Z(),n=Z(),a=[e===void 0?null:r,t===void 0?null:n].filter(l=>l!==null).join(" ");return{control:{id:o,"aria-describedby":a===""?void 0:a,"aria-invalid":t===void 0?void 0:!0},descriptionId:r,errorId:n}},q=({description:e,error:t,descriptionId:o,errorId:r,testId:n})=>I(Tt,{children:[e===void 0?null:v(x,{as:"p",fg:"fg-muted",type:"body",id:o,testId:`${n}-description`,children:e}),t===void 0?null:v(x,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${n}-error`,children:t})]}),mt=({label:e,description:t,error:o,testId:r,children:n})=>{let{control:a,descriptionId:s,errorId:l}=B({label:e,description:t,error:o});return I("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":r,children:[v("label",{className:"cui-field-label",htmlFor:a.id,"data-cui-type":"body",children:e}),n(a),v(q,{description:t,error:o,descriptionId:s,errorId:l,testId:r})]})},ft=({label:e,description:t,error:o,value:r,onValueChange:n,type:a,list:s,required:l,testId:d,ref:u})=>{let{control:p,descriptionId:i,errorId:c}=B({label:e,description:t,error:o});return I("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${d}-field`,children:[v("label",{className:"cui-field-label",htmlFor:p.id,"data-cui-type":"body",children:e}),v("input",{className:"cui-input",type:a,value:r,list:s,required:l,onChange:y=>n(y.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":d,ref:u,...p}),v(q,{description:t,error:o,descriptionId:i,errorId:c,testId:d})]})},gt=({label:e,description:t,error:o,value:r,onValueChange:n,required:a,testId:s,ref:l})=>{let{control:d,descriptionId:u,errorId:p}=B({label:e,description:t,error:o});return I("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[v("label",{className:"cui-field-label",htmlFor:d.id,"data-cui-type":"body",children:e}),v("textarea",{className:"cui-input cui-textarea",value:r,required:a,onChange:i=>n(i.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":s,ref:l,...d}),v(q,{description:t,error:o,descriptionId:u,errorId:p,testId:s})]})},Rt=({label:e,description:t,error:o,value:r,options:n,onValueChange:a,testId:s,ref:l})=>{let{control:d,descriptionId:u,errorId:p}=B({label:e,description:t,error:o});return I("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[v("label",{className:"cui-field-label",htmlFor:d.id,"data-cui-type":"body",children:e}),v("select",{className:"cui-input",value:r,onChange:i=>a(i.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":s,ref:l,...d,children:n.map(i=>v("option",{value:i.value,children:i.label},i.value))}),v(q,{description:t,error:o,descriptionId:u,errorId:p,testId:s})]})},bt=({legend:e,description:t,error:o,value:r,options:n,onValueChange:a,testId:s,ref:l})=>{let d=Z(),{control:u,descriptionId:p,errorId:i}=B({label:e,description:t,error:o});return I("fieldset",{className:"cui-radio-group","aria-describedby":u["aria-describedby"],"data-invalid":o!==void 0,"data-testid":s,children:[v("legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),n.map((c,y)=>I("label",{className:"cui-radio","data-cui-type":"body",children:[v("input",{type:"radio",name:d,value:c.value,checked:c.value===r,onChange:()=>a(c.value),"aria-invalid":u["aria-invalid"],"data-testid":`${s}-option-${c.value}`,ref:y===0?l:void 0}),v("span",{children:c.label})]},c.value)),v(q,{description:t,error:o,descriptionId:p,errorId:i,testId:s})]})};import{useCallback as ke,useLayoutEffect as Pt,useRef as z}from"react";import{jsx as Me}from"react/jsx-runtime";var ht=({tone:e,testId:t,children:o})=>(m(),Me("div",{className:"cui-notice","data-cui-tone":e,"data-cui-surface":e==="info"?"info-tint":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-testid":t,children:o})),_=({occurrence:e,testId:t,children:o})=>(m(),Me("div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-occurrence":e,"data-testid":t,children:o},e));import{useCallback as vt,useLayoutEffect as we,useReducer as Ct,useRef as Le}from"react";var xt=e=>e+1,ae=e=>{let t=Le(e),o=Le(null),[,r]=Ct(xt,0),n=vt((a=>()=>{a.contains(document.activeElement)&&(o.current=a,r())}),[]);return we(()=>{t.current=e}),we(()=>{let a=o.current;if(a===null)return;o.current=null;let s=[null,document.body].includes(document.activeElement);a.isConnected||!s||t.current()?.focus()}),n};import{jsx as Y,jsxs as wt}from"react/jsx-runtime";var ne="[data-cui-row-focus]",Et=e=>{let t=e.ref.current;if(t===null)throw new Error("LoadMore: rows.ref is not attached to the element holding the rows");let o=[...t.querySelectorAll(ne)];if(o.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${o.length} ${ne} elements for ${e.count} rows`);return o},Nt=(e,t)=>{let o=-1;return e.forEach((r,n)=>{t.has(r)&&(o=n)}),e[o+1]},Mt=({onLoad:e,busy:t,done:o,failure:r,limit:n,rows:a,testId:s})=>{let{formatLocale:l,labels:d}=w(),u=z(null),p=z(null),i=z(null),c=z(!1),y=()=>{let g=a.ref.current;u.current={shown:new Set(g===null?[]:g.querySelectorAll(ne)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};Pt(()=>{let g=c.current;c.current=!1;let b=u.current;if(b===null)return;let f=Et(a);if(t){b.busySeen=!0,b.shown=new Set(f);return}let T=Nt(f,b.shown),h=r!==null&&r.occurrence!==b.failureOccurrence;if(!(b.busySeen||T!==void 0||h||o)||(u.current=null,h||T===void 0))return;let L=[null,document.body].includes(document.activeElement);(i.current!==null&&document.activeElement===i.current||g&&L)&&T.focus()});let R=ae(()=>o?p.current:i.current),P=ke((g=>{i.current=g;let b=R(g);return()=>{i.current=null,c.current=g===document.activeElement,b()}}),[R]),N=ke((g=>{p.current=g;let b=R(g);return()=>{p.current=null,b()}}),[R]);return o?Y("div",{className:"cui-load-more","data-testid":s,children:Y(x,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:N,testId:`${s}-end`,children:d.endOfRecords})}):wt("div",{className:"cui-load-more","data-testid":s,children:[Y(O,{variant:"secondary",busy:t,busyLabel:d.loading,onClick:y,ref:P,testId:`${s}-button`,children:d.loadMore(V(n,l))}),r===null?null:Y(_,{occurrence:r.occurrence,testId:`${s}-failure`,children:d.loadFailed(r.reason)})]})};import{jsx as se,jsxs as Se}from"react/jsx-runtime";var Lt=({master:e,detail:t,masterMinPx:o,detailMinPx:r,testId:n})=>{m();let a=ye({masterMinPx:o,detailMinPx:r,gapPx:W.space["space-6"]});return Se("div",{className:"cui-container","data-testid":n,children:[se(D,{ruleKey:a.key,css:a.css}),Se("div",{className:"cui-master-detail","data-cui-master-detail":a.key,children:[se("div",{className:"cui-master-detail-pane","data-testid":`${n}-master`,children:e}),se("div",{className:"cui-master-detail-pane","data-testid":`${n}-detail`,children:t})]})]})};import{jsx as Ie}from"react/jsx-runtime";var ie=({value:e,unit:t,testId:o})=>{let{formatLocale:r,labels:n}=w();if(e===null)return Ie("span",{className:"cui-measured","data-measured":"false","data-testid":o,children:n.unmeasured});let a=V(e,r);return Ie("span",{className:"cui-measured","data-measured":"true","data-testid":o,children:t===void 0?a:`${a} ${t}`})};import{jsx as At}from"react/jsx-runtime";var kt={neutral:{fg:"fg-secondary",surface:"sunken"},info:{fg:"info-fg",surface:"info-tint"},success:{fg:"success-fg",surface:"success-tint"},warning:{fg:"warning-fg",surface:"warning-tint"},danger:{fg:"danger-fg",surface:"danger-tint"}},St={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},It=({tone:e,variant:t,testId:o,dataAttributes:r,children:n})=>{m();let a=t==="tint"?kt[e]:{fg:"on-solid",surface:St[e]};return At("span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":a.fg,"data-cui-surface":a.surface,"data-cui-type":"caption","data-testid":o,...E(r),children:n})};import{useId as Ft}from"react";import{jsx as G,jsxs as Ut}from"react/jsx-runtime";var Dt=({label:e,valueText:t,value:o,max:r,testId:n})=>{m();let a=Ft();if(r!==null){if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Progress maximum must be positive: ${r}`);if(o===null||!(Number.isFinite(o)&&o>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${o}`)}let s=r===null?null:{max:r,now:Math.min(o,r)};return Ut("div",{className:"cui-progress","data-testid":n,children:[G(x,{as:"p",fg:"fg",type:"body",id:a,children:e}),G("div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":a,"aria-valuetext":t,"aria-valuemin":s===null?void 0:0,"aria-valuemax":s?.max,"aria-valuenow":s?.now,"data-cui-surface":"sunken","data-cui-indeterminate":s===null,"data-testid":`${n}-bar`,children:G("div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:s===null?void 0:{inlineSize:`${s.now/s.max*100}%`},"data-testid":`${n}-fill`})}),G("div",{"aria-hidden":"true",children:G(x,{as:"p",fg:"fg-secondary",type:"body",testId:`${n}-value`,children:t})})]})};import{jsx as Ae,jsxs as Kt}from"react/jsx-runtime";var Ht=({failure:e,onReload:t,forbiddenMessage:o,failureMessage:r,rescueRef:n,testId:a})=>{let{labels:s}=w();return Kt("div",{className:"cui-resource-failed","data-testid":a,children:[Ae(_,{occurrence:e.occurrence,testId:`${a}-alert`,children:s.failureSentence(e,o,r===void 0?s.loadFailed:r)}),e.status===403?null:Ae(O,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:n,testId:`${a}-reload`,children:s.reload})]})};import{jsx as U}from"react/jsx-runtime";var Fe=({selected:e,controls:t,onSelect:o,testId:r,dataAttributes:n,ref:a,children:s})=>(m(),U("button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"prose","data-testid":r,onClick:o,ref:a,...E(n),children:s})),Ot=({label:e,items:t,itemKey:o,selectedKey:r,onSelect:n,detailId:a,renderRow:s,rowTestId:l,rowData:d,empty:u,testId:p,ref:i})=>(m(),U("div",{className:"cui-selectable","data-testid":p,ref:i,children:t.length===0?U(x,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:u}):U("ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(c=>{let y=o(c);return U("li",{children:U(Fe,{selected:y===r,controls:a,onSelect:()=>n(c),testId:l,dataAttributes:d?.(c),children:s(c)})},y)})})}));import{jsx as De}from"react/jsx-runtime";var $t=({gap:e,testId:t,children:o})=>(m(),De("div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:o})),Bt=({gap:e,testId:t,children:o})=>(m(),De("div",{className:"cui-cluster","data-cui-gap":e,"data-testid":t,children:o}));import{Children as qt,Fragment as _t,isValidElement as Gt}from"react";import{jsx as H,jsxs as He}from"react/jsx-runtime";var Vt={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},Wt=({label:e,sublabel:t,value:o,tone:r,testId:n,dataAttributes:a})=>{if(m(),o===null&&r!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${r}`);return He("div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":n,...E(a),children:[H("p",{className:"cui-tile-label","data-cui-type":"caption",children:e}),H("p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption",children:t}),H("p",{className:"cui-tile-value","data-cui-fg":Vt[r],"data-cui-type":"heading",children:H(ie,{value:o,testId:`${n}-value`})})]})},Ue=e=>qt.toArray(e).flatMap(t=>{if(!Gt(t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===_t?Ue(t.props.children):[t]}),Zt=({count:e,minInlinePx:t,testId:o,children:r})=>{m();let n=fe(e,t,W.space["space-2"]),a=Ue(r).length;if(a!==e)throw new RangeError(`TileGrid has ${a} tiles but count is ${e}`);return He("div",{className:"cui-container","data-testid":o,children:[H(D,{ruleKey:n.key,css:n.css}),H("div",{className:"cui-tile-grid","data-cui-tile-grid":n.key,"data-cui-gap":"space-2",children:r})]})};import{useCallback as zt}from"react";var Yt=229,Xt=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),Jt=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&Xt.has(e.type)&&(e.value!==""||e.validity.badInput),Qt=e=>zt(t=>{t.key!=="Escape"||t.nativeEvent.isComposing||t.keyCode===Yt||Jt(t.target)||(t.stopPropagation(),e())},[e]);import{useCallback as K,useEffect as to,useLayoutEffect as Oe,useRef as ce}from"react";import{useCallback as X,useEffect as jt,useLayoutEffect as eo,useRef as le,useState as de}from"react";var Ke=e=>e===null?Q:j,J=(e,t,o,r,n)=>{let[a,s]=de(()=>({key:e,state:Ke(e)})),[l,d]=de(0),[u,p]=de(0),i=le(t),c=le(null),y=le(l);eo(()=>{i.current=t}),jt(()=>{if(e===null){s({key:null,state:Q});return}let f=new AbortController;c.current=e;let T=l===y.current?"revision":"reload";return y.current=l,s(h=>Object.is(h.key,e)?{key:e,state:r(h.state,T)}:{key:e,state:j}),i.current(f.signal).then(h=>{f.signal.aborted||(c.current=null,s(L=>({key:e,state:n(L.state,h)})))},h=>{f.signal.aborted||s(()=>{throw h})}),()=>{f.abort(),c.current=null}},[e,o,l,u]);let R=X(()=>d(f=>f+1),[]),P=X(()=>p(f=>f+1),[]),N=X((f,T)=>{s(h=>Object.is(h.key,f)?{key:f,state:T(h.state)}:h)},[]),g=X((f,T)=>{N(f,T),Object.is(c.current,f)&&P()},[N,P]);return{state:Object.is(a.key,e)?a.state:Ke(e),reload:R,refresh:P,update:N,write:g}};var oo=(e,t,o)=>{let r=ce(t);Oe(()=>{r.current=t});let n=K(g=>r.current.first(g),[]),{state:a,reload:s,refresh:l,update:d,write:u}=J(e,n,o,ge,Re),p=ce({key:e,state:a});Oe(()=>{p.current={key:e,state:a}});let i=ce(null),c=K(()=>{i.current?.controller.abort(),i.current=null},[]);to(()=>c,[e,o,c]);let y=K(()=>{c(),s()},[c,s]),R=K(()=>{c(),l()},[c,l]),P=K(()=>{let{key:g,state:b}=p.current;if(g===null||b.kind!=="ready"||b.refreshing||b.value.next===null||b.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let f=b.value.next,T={key:g,controller:new AbortController,maps:[]};i.current=T,d(g,be),r.current.next(f,T.controller.signal).then(h=>{i.current===T&&(i.current=null,d(g,L=>T.maps.reduce(($e,Be)=>te($e,Be),Te(L,f,h))))},h=>{i.current===T&&d(g,()=>{throw h})})},[d]),N=K((g,b)=>{let f=i.current;f!==null&&Object.is(f.key,g)&&f.maps.push(b),u(g,T=>te(T,b))},[u]);return{state:a,reload:y,refresh:R,loadMore:P,updateList:N}};import{useCallback as ro}from"react";var ao=(e,t,o)=>{let{state:r,reload:n,refresh:a,write:s}=J(e,t,o,ue,ee),l=ro((d,u)=>s(d,p=>ee(p,{ok:!0,value:u})),[s]);return{state:r,reload:n,refresh:a,put:l}};import{jsx as so}from"react/jsx-runtime";var no=({testId:e,children:t})=>(m(),so("span",{className:"cui-visually-hidden","data-testid":e,children:t}));export{re as ANNOUNCE_SETTLE_MS,_ as AlertMessage,O as Button,fo as CONSOLE_UI_LABEL_CATALOGS,Co as CONTRAST_MINIMUM,xo as CONTRAST_PAIRS,nt as Card,st as CardSection,Bt as Cluster,ct as ComparisonGrid,Je as ConsoleUiRoot,pt as DataTable,mt as Field,qe as HTTP_FORBIDDEN,rt as Link,Mt as LoadMore,Lt as MasterDetail,ie as Measured,Wt as MetricTile,ht as Notice,It as Pill,Dt as ProgressBar,bt as RadioGroup,Ht as ResourceFailed,Fe as RowButton,Rt as Select,Ot as SelectableList,$t as Stack,W as TOKENS,x as Text,gt as TextArea,ft as TextInput,Zt as TileGrid,no as VisuallyHidden,io as ZonedTimeError,be as beginPage,ge as beginPagedReload,ue as beginReload,To as ceil8,vo as contrastRatio,Po as cssVar,yo as flatMapOutcome,V as formatCount,uo as formatInstant,ho as hexToSrgb,ee as keepLastGood,po as mapOutcome,te as mapPagedList,go as masterDetailPlan,bo as monoTextWidthEm,mo as reasonAside,pe as resolveConsoleUiLabels,Re as settleFirstPage,Te as settlePage,me as tableMinInlinePx,Ro as textWidthEm,fe as tileGridPlan,lo as toOffsetIso,co as toWallTime,Qe as useAnnounce,w as useConsoleUi,Qt as useEscapeToClose,ae as useFocusRescue,oo as usePagedResource,ao as useResource};
1
+ import{A as Fe,B as de,C as xr,D as Er,E as Nr,F as Pr,G as W,H as wr,a as z,b as ir,c as lr,d as dr,e as cr,f as Tt,g as ur,h as pr,i as se,j as ie,k as Se,l as le,m as yr,n as mr,o as Le,p as D,q as fr,r as ke,s as Ie,t as gr,u as br,v as Rr,w as Ae,x as De,y as $e,z as He}from"./chunk-BUX2DNVR.js";import{a as Tr,b as hr,c as vr,d as Cr}from"./chunk-BMGBEN26.js";import{createContext as ht,useCallback as vt,useContext as qe,useLayoutEffect as Ct,useMemo as Ue,useRef as Oe}from"react";import{jsx as Ke,jsxs as Lt}from"react/jsx-runtime";var ce=ht(null),xt=" ",Be='[inert], [aria-hidden="true" i]',_e="dialog:modal",pe="data-cui-dialog-announcer",Et=`:scope > [${pe}]`,Nt=e=>{if(e.closest(Be)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=e.ownerDocument,o=[...t.querySelectorAll(_e)],r=t.activeElement,n=o.filter(c=>c.contains(r)),a=n.length>0?n:o,s=a.filter(c=>c.contains(e)).length;if(s===a.length)return{region:e};let d=a.find(c=>a.every(p=>p.contains(c))),i=d?.querySelector(Et)??null;return d!==void 0&&i!==null&&e.parentElement.contains(d)&&i.closest(Be)===null?{region:i}:s===0?{hidden:"the topmost open modal dialog does not contain the console"}:{hidden:"open modal dialogs both contain and do not contain the console, and focus does not tell which one is topmost"}},Pt=e=>{try{e.querySelectorAll(_e)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},ue=150,wt=1e3,Mt=({locale:e,formatLocale:t,timeZone:o,testId:r,children:n})=>{if(qe(ce)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");let s=Le(e),[d]=Intl.getCanonicalLocales(t),i=Ue(()=>new Intl.DateTimeFormat(d,{timeZone:o}).resolvedOptions().timeZone,[d,o]),c=Oe(null),p=Oe(null);Ct(()=>{Pt(c.current.ownerDocument)},[]);let l=vt(m=>{if(m.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let g=()=>{let{texts:w,settle:b,deadline:R}=p.current;p.current=null,clearTimeout(b),clearTimeout(R);let f=c.current;if(f===null)return;let h=w.join(xt),T=Nt(f);if("hidden"in T)throw new Error(`announce: the live region is hidden from assistive technology (${T.hidden}), so this announcement would be lost: ${h}`);let L=f.ownerDocument.createElement("span");L.textContent=h,T.region.replaceChildren(L)},x=p.current;if(x===null){p.current={texts:[m],settle:setTimeout(g,ue),deadline:setTimeout(g,wt)};return}x.texts.push(m),clearTimeout(x.settle),x.settle=setTimeout(g,ue)},[]),y=Ue(()=>({locale:e,formatLocale:d,timeZone:i,labels:s,announce:l}),[e,d,i,s,l]);return Ke(ce.Provider,{value:y,children:Lt("div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":r,children:[n,Ke("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${r}-announcer`,ref:c})]})})},N=()=>{let e=qe(ce);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},u=()=>{N()},St=()=>N().announce;var J=(e,t,o)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),o(t))};import{jsx as B,jsxs as Ge}from"react/jsx-runtime";var kt=({items:e,current:t,onNavigate:o,testId:r})=>{let{labels:n}=N();if(new Set(e.map(a=>a.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(a=>a.id).join(", ")}`);return B("nav",{className:"cui-breadcrumb","aria-label":n.breadcrumb,"data-testid":r,children:Ge("ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(a=>Ge("li",{className:"cui-breadcrumb-item",children:[B("a",{className:"cui-link",href:a.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${r}-${a.id}`,onClick:s=>J(s,a.href,o),children:a.label}),B("span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},a.id)),B("li",{className:"cui-breadcrumb-item",children:B("span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${r}-current`,children:t})})]})})};import{useId as At}from"react";var P=e=>{if(e===void 0)return{};for(let t of Object.keys(e))if(!t.startsWith("data-")||t.startsWith("data-cui-")||t==="data-testid")throw new RangeError(`Caller attributes must be data-* and must not override data-cui-* or data-testid: ${t}`);return e};import{jsx as It}from"react/jsx-runtime";var v=({fg:e,type:t,face:o,as:r="span",testId:n,id:a,tabIndex:s,ref:d,children:i})=>(u(),It(r,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":o,"data-testid":n,id:a,tabIndex:s,ref:d,children:i}));import{jsx as $,jsxs as Ht}from"react/jsx-runtime";var Dt={primary:{fg:"on-solid",surface:"info-solid",type:"body"},secondary:{fg:"fg",surface:void 0,type:"body"},danger:{fg:"on-solid",surface:"danger-solid",type:"body"},link:{fg:"info-fg",surface:void 0,type:"body"}},Ve=({children:e})=>$("span",{children:e}),S=({variant:e,children:t,testId:o,type:r="button",onClick:n,unavailable:a,expanded:s,controls:d,ref:i,dataAttributes:c,busy:p,busyLabel:l})=>{u();let y=At(),m=p===!0||a!==void 0,g=Dt[e],x=w=>{if(m){w.preventDefault();return}n?.(w)};return Ht("span",{className:"cui-button-group",children:[$("button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":g.fg,"data-cui-surface":g.surface,"data-cui-type":g.type,"data-testid":o,"aria-disabled":m?!0:void 0,"aria-busy":p===!0?!0:void 0,"aria-describedby":a===void 0?void 0:y,"aria-expanded":s,"aria-controls":d,onClick:x,ref:i,...P(c),children:$(Ve,{children:p===!0?l:t})}),a===void 0?null:$(v,{fg:"fg-muted",type:"body",id:y,testId:`${o}-reason`,children:a.reason})]})},$t=({onNavigate:e,children:t,testId:o,ref:r})=>(u(),$("button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":o,onClick:e,ref:r,children:$(Ve,{children:t})}));import{useId as ze}from"react";import{Fragment as Ut,jsx as k,jsxs as K}from"react/jsx-runtime";var ye=({id:e,title:t,description:o,actions:r,testId:n,headingRef:a,ref:s,dataAttributes:d,children:i})=>{u();let c=ze();return K("section",{className:"cui-card",id:e,"aria-labelledby":c,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":n,ref:s,...P(d),children:[K("div",{className:"cui-card-header",children:[K("div",{className:"cui-card-heading",children:[k("h2",{className:"cui-card-title",id:c,"data-cui-type":"title",ref:a,tabIndex:a===void 0?void 0:-1,children:t}),o===void 0?null:k("div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),r===void 0?null:k("div",{className:"cui-card-actions",children:r})]}),i]})},Ft=({id:e,title:t,subtitle:o,region:r=!1,testId:n,headingRef:a,ref:s,dataAttributes:d,children:i})=>{u();let c=ze(),p=K(Ut,{children:[K("div",{className:"cui-card-section-heading",children:[k("h3",{className:"cui-card-section-title",id:c,"data-cui-type":"body",ref:a,tabIndex:a===void 0?void 0:-1,children:t}),o===void 0?null:k("div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),i]});return r?k("section",{className:"cui-card-section",id:e,"aria-labelledby":c,"data-testid":n,ref:s,...P(d),children:p}):k("div",{className:"cui-card-section",id:e,"data-testid":n,ref:s,...P(d),children:p})};import{jsx as We}from"react/jsx-runtime";var Ot=({label:e,code:t,testId:o})=>(u(),We("section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":o,children:We("pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${o}-code`,children:t})}));import{useId as Kt}from"react";import{jsx as Bt}from"react/jsx-runtime";var H=({ruleKey:e,css:t})=>Bt("style",{href:e,precedence:"cui",children:t});import{jsx as E,jsxs as I}from"react/jsx-runtime";var qt=({caption:e,attributes:t,columns:o,attributePx:r,columnMinPx:n,testId:a})=>{u();let s=Kt();for(let l of[r,n])if(!(Number.isFinite(l)&&l>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${l}`);if(o.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let l of o)for(let y of t)if(!Object.hasOwn(l.cells,y.key))throw new RangeError(`Column "${l.key}" has no value for attribute "${y.key}"`);let d=r+o.length*n,i=`cui-comparison-a${r}-c${n}-n${o.length}`,c=l=>`[data-cui-comparison="${i}"][data-cui-comparison-layout="${l}"]`,p=`${c("table")}{display:none}@container (min-width:${D(d)}){${c("table")}{display:block}${c("stack")}{display:none}}`;return I("div",{className:"cui-container","data-cui-stack-below-px":d,"data-testid":a,children:[E(H,{ruleKey:i,css:p}),E("div",{className:"cui-comparison-frame","data-cui-comparison":i,"data-cui-comparison-layout":"table",children:I("table",{className:"cui-comparison-table","data-cui-type":"body",children:[E("caption",{className:"cui-visually-hidden",children:e}),I("colgroup",{children:[E("col",{style:{width:D(r)}}),o.map(l=>E("col",{},l.key))]}),E("thead",{children:I("tr",{children:[E("td",{}),o.map(l=>E("th",{scope:"col",children:l.heading},l.key))]})}),E("tbody",{children:t.map(l=>I("tr",{children:[E("th",{scope:"row",children:l.label}),o.map(y=>E("td",{children:y.cells[l.key]("table")},y.key))]},l.key))})]})}),E("div",{className:"cui-comparison-stack","data-cui-comparison":i,"data-cui-comparison-layout":"stack",children:o.map((l,y)=>{let m=`${s}-column-${y}`;return I("div",{className:"cui-comparison-column",role:"group","aria-labelledby":m,"data-cui-type":"body",children:[E("p",{className:"cui-comparison-heading",id:m,children:l.heading}),E("dl",{className:"cui-comparison-list",children:t.map(g=>I("div",{children:[E("dt",{children:g.label}),E("dd",{children:l.cells[g.key]("stack")})]},g.key))})]},l.key)})})]})};import{useId as _t}from"react";import{jsx as M,jsxs as Vt}from"react/jsx-runtime";var Gt=({caption:e,captionHidden:t,columns:o,rows:r,rowKey:n,rowTestId:a,rowData:s,rowSize:d,empty:i,testId:c,ref:p})=>{u();let l=_t(),y=Ie(o);return M("div",{className:"cui-container","data-testid":c,ref:p,children:r.length===0?M(v,{as:"p",fg:"fg-muted",type:"prose",testId:`${c}-empty`,children:i}):M("section",{className:"cui-table-frame",tabIndex:0,"aria-labelledby":l,"data-testid":`${c}-frame`,children:Vt("table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":d,style:{"--cui-table-min":D(y)},children:[M("caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:l,children:e}),M("colgroup",{children:o.map(m=>M("col",{style:m.width.fixedPx===void 0?void 0:{width:D(m.width.fixedPx)}},m.key))}),M("thead",{children:M("tr",{children:o.map(m=>M("th",{scope:"col","data-cui-align":m.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:m.header},m.key))})}),M("tbody",{children:r.map(m=>M("tr",{tabIndex:-1,"data-cui-row-focus":"","data-testid":a,...P(s?.(m)),children:o.map(g=>M("td",{"data-cui-align":g.align,children:g.cell(m)},g.key))},n(m)))})]})})})};import{jsx as me,jsxs as Wt}from"react/jsx-runtime";var zt=({items:e,testId:t})=>{if(u(),new Set(e.map(o=>o.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(o=>o.key).join(", ")}`);return me("dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(o=>Wt("div",{className:"cui-description-row","data-testid":`${t}-${o.key}`,children:[me("dt",{"data-cui-fg":"fg-secondary",children:o.term}),me("dd",{"data-cui-fg":"fg",children:o.description})]},o.key))})};import{useId as Qt,useLayoutEffect as Je,useRef as Ze}from"react";import{useCallback as Jt}from"react";var Zt=229,Yt=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),fe=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&Yt.has(e.type)&&(e.value!==""||e.validity.badInput),Xt=e=>Jt(t=>{t.key!=="Escape"||t.nativeEvent.isComposing||t.keyCode===Zt||fe(t.target)||(t.stopPropagation(),e())},[e]);import{jsx as Z,jsxs as Xe}from"react/jsx-runtime";var Ye=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},jt=({title:e,open:t,onClose:o,testId:r,children:n})=>{let{labels:a}=N(),s=Qt(),d=Ze(null),i=Ze(null);return Je(()=>{let l=d.current;t&&!l.open?(i.current=l.ownerDocument.activeElement,l.showModal()):!t&&l.open&&l.close()},[t]),Je(()=>{let l=d.current;return()=>{l.open&&(l.close(),Ye(i.current),i.current=null)}},[]),Xe("dialog",{className:"cui-dialog","aria-labelledby":s,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":r,ref:d,onClose:()=>{Ye(i.current),i.current=null,t&&o()},onCancel:l=>{fe(l.currentTarget.ownerDocument.activeElement)&&l.preventDefault()},children:[Xe("div",{className:"cui-dialog-header",children:[Z("h2",{className:"cui-dialog-title",id:s,"data-cui-type":"title",children:e}),Z("div",{className:"cui-dialog-actions",children:Z(S,{variant:"secondary",testId:`${r}-close`,onClick:()=>d.current?.close(),children:a.close})})]}),n,Z("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[pe]:"","data-testid":`${r}-announcer`})]})};import{useId as eo}from"react";import{jsx as ge,jsxs as Qe}from"react/jsx-runtime";var to=({summary:e,open:t,onOpenChange:o,testId:r,children:n})=>{u();let a=eo();return Qe("div",{className:"cui-disclosure","data-testid":r,children:[Qe("button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":a,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${r}-button`,onClick:()=>o(!t),children:[ge("span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),ge("span",{children:e})]}),ge("div",{className:"cui-disclosure-panel",id:a,hidden:!t,"data-testid":`${r}-panel`,children:n})]})};import{useId as Y}from"react";import{Fragment as io,jsx as C,jsxs as A}from"react/jsx-runtime";var q=({description:e,error:t})=>{u();let o=Y(),r=Y(),n=Y(),a=[e===void 0?null:r,t===void 0?null:n].filter(d=>d!==null).join(" ");return{control:{id:o,"aria-describedby":a===""?void 0:a,"aria-invalid":t===void 0?void 0:!0},descriptionId:r,errorId:n}},_=({description:e,error:t,descriptionId:o,errorId:r,testId:n})=>A(io,{children:[e===void 0?null:C(v,{as:"p",fg:"fg-muted",type:"body",id:o,testId:`${n}-description`,children:e}),t===void 0?null:C(v,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${n}-error`,children:t})]}),oo=({label:e,description:t,error:o,testId:r,children:n})=>{let{control:a,descriptionId:s,errorId:d}=q({label:e,description:t,error:o});return A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":r,children:[C("label",{className:"cui-field-label",htmlFor:a.id,"data-cui-type":"body",children:e}),n(a),C(_,{description:t,error:o,descriptionId:s,errorId:d,testId:r})]})},ro=({label:e,description:t,error:o,value:r,onValueChange:n,type:a,list:s,required:d,testId:i,ref:c})=>{let{control:p,descriptionId:l,errorId:y}=q({label:e,description:t,error:o});return A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${i}-field`,children:[C("label",{className:"cui-field-label",htmlFor:p.id,"data-cui-type":"body",children:e}),C("input",{className:"cui-input",type:a,value:r,list:s,required:d,onChange:m=>n(m.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":i,ref:c,...p}),C(_,{description:t,error:o,descriptionId:l,errorId:y,testId:i})]})},ao=({label:e,description:t,error:o,value:r,onValueChange:n,required:a,testId:s,ref:d})=>{let{control:i,descriptionId:c,errorId:p}=q({label:e,description:t,error:o});return A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[C("label",{className:"cui-field-label",htmlFor:i.id,"data-cui-type":"body",children:e}),C("textarea",{className:"cui-input cui-textarea",value:r,required:a,onChange:l=>n(l.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":s,ref:d,...i}),C(_,{description:t,error:o,descriptionId:c,errorId:p,testId:s})]})},no=({label:e,description:t,error:o,value:r,options:n,onValueChange:a,testId:s,ref:d})=>{let{control:i,descriptionId:c,errorId:p}=q({label:e,description:t,error:o});return A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[C("label",{className:"cui-field-label",htmlFor:i.id,"data-cui-type":"body",children:e}),C("select",{className:"cui-input",value:r,onChange:l=>a(l.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":s,ref:d,...i,children:n.map(l=>C("option",{value:l.value,children:l.label},l.value))}),C(_,{description:t,error:o,descriptionId:c,errorId:p,testId:s})]})},so=({legend:e,description:t,error:o,value:r,options:n,onValueChange:a,testId:s,ref:d})=>{let i=Y(),{control:c,descriptionId:p,errorId:l}=q({label:e,description:t,error:o});return A("fieldset",{className:"cui-radio-group","aria-describedby":c["aria-describedby"],"data-invalid":o!==void 0,"data-testid":s,children:[C("legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),n.map((y,m)=>A("label",{className:"cui-radio","data-cui-type":"body",children:[C("input",{type:"radio",name:i,value:y.value,checked:y.value===r,onChange:()=>a(y.value),"aria-invalid":c["aria-invalid"],"data-testid":`${s}-option-${y.value}`,ref:m===0?d:void 0}),C("span",{children:y.label})]},y.value)),C(_,{description:t,error:o,descriptionId:p,errorId:l,testId:s})]})};import{jsx as uo}from"react/jsx-runtime";var lo={1:"h1",2:"h2",3:"h3"},co=({level:e,type:t,testId:o,headingRef:r,children:n})=>{u();let a=lo[e];return uo(a,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":o,ref:r,tabIndex:r===void 0?void 0:-1,children:n})};import{jsx as mo}from"react/jsx-runtime";var po={neutral:{fg:"fg-secondary",surface:"sunken"},info:{fg:"info-fg",surface:"info-tint"},success:{fg:"success-fg",surface:"success-tint"},warning:{fg:"warning-fg",surface:"warning-tint"},danger:{fg:"danger-fg",surface:"danger-tint"}},yo={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},be=({tone:e,variant:t,testId:o,dataAttributes:r,children:n})=>{u();let a=t==="tint"?po[e]:{fg:"on-solid",surface:yo[e]};return mo("span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":a.fg,"data-cui-surface":a.surface,"data-cui-type":"caption","data-testid":o,...P(r),children:n})};import{useId as fo}from"react";import{jsx as G,jsxs as go}from"react/jsx-runtime";var Re=({label:e,valueText:t,value:o,max:r,testId:n})=>{u();let a=fo();if(r!==null){if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Progress maximum must be positive: ${r}`);if(o===null||!(Number.isFinite(o)&&o>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${o}`)}let s=r===null?null:{max:r,now:Math.min(o,r)};return go("div",{className:"cui-progress","data-testid":n,children:[G(v,{as:"p",fg:"fg",type:"body",id:a,children:e}),G("div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":a,"aria-valuetext":t,"aria-valuemin":s===null?void 0:0,"aria-valuemax":s?.max,"aria-valuenow":s?.now,"data-cui-surface":"sunken","data-cui-indeterminate":s===null,"data-testid":`${n}-bar`,children:G("div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:s===null?void 0:{inlineSize:`${s.now/s.max*100}%`},"data-testid":`${n}-fill`})}),G("div",{"aria-hidden":"true",children:G(v,{as:"p",fg:"fg-secondary",type:"body",testId:`${n}-value`,children:t})})]})};import{jsx as X,jsxs as je}from"react/jsx-runtime";var bo=({title:e,status:t,progress:o,cancel:r,testId:n,children:a})=>je(ye,{title:e,actions:r===void 0?void 0:X(S,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${n}-cancel`,children:r.label}),testId:n,children:[je("div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${n}-status`,children:[X("span",{className:"cui-visually-hidden",children:`${e} `}),X(be,{tone:t.tone,variant:"tint",testId:`${n}-status-pill`,children:t.label})]}),o===void 0?null:X(Re,{...o,testId:`${n}-progress`}),a]});import{useCallback as rt,useLayoutEffect as Co,useRef as Q}from"react";import{jsx as et}from"react/jsx-runtime";var Ro=({tone:e,testId:t,children:o})=>(u(),et("div",{className:"cui-notice","data-cui-tone":e,"data-cui-surface":e==="info"?"info-tint":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-testid":t,children:o})),V=({occurrence:e,testId:t,children:o})=>(u(),et("div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-occurrence":e,"data-testid":t,children:o},e));import{useCallback as To,useLayoutEffect as tt,useReducer as ho,useRef as ot}from"react";var vo=e=>e+1,Te=e=>{let t=ot(e),o=ot(null),[,r]=ho(vo,0),n=To((a=>()=>{a.contains(document.activeElement)&&(o.current=a,r())}),[]);return tt(()=>{t.current=e}),tt(()=>{let a=o.current;if(a===null)return;o.current=null;let s=[null,document.body].includes(document.activeElement);a.isConnected||!s||t.current()?.focus()}),n};import{jsx as j,jsxs as Po}from"react/jsx-runtime";var he="[data-cui-row-focus]",xo=e=>{let t=e.ref.current;if(t===null)throw new Error("LoadMore: rows.ref is not attached to the element holding the rows");let o=[...t.querySelectorAll(he)];if(o.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${o.length} ${he} elements for ${e.count} rows`);return o},Eo=(e,t)=>{let o=-1;return e.forEach((r,n)=>{t.has(r)&&(o=n)}),e[o+1]},No=({onLoad:e,busy:t,done:o,failure:r,limit:n,rows:a,testId:s})=>{let{formatLocale:d,labels:i}=N(),c=Q(null),p=Q(null),l=Q(null),y=Q(!1),m=()=>{let b=a.ref.current;c.current={shown:new Set(b===null?[]:b.querySelectorAll(he)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};Co(()=>{let b=y.current;y.current=!1;let R=c.current;if(R===null)return;let f=xo(a);if(t){R.busySeen=!0,R.shown=new Set(f);return}let h=Eo(f,R.shown),T=r!==null&&r.occurrence!==R.failureOccurrence;if(!(R.busySeen||h!==void 0||T||o)||(c.current=null,T||h===void 0))return;let L=[null,document.body].includes(document.activeElement);(l.current!==null&&document.activeElement===l.current||b&&L)&&h.focus()});let g=Te(()=>o?p.current:l.current),x=rt((b=>{l.current=b;let R=g(b);return()=>{l.current=null,y.current=b===document.activeElement,R()}}),[g]),w=rt((b=>{p.current=b;let R=g(b);return()=>{p.current=null,R()}}),[g]);return o?j("div",{className:"cui-load-more","data-testid":s,children:j(v,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:w,testId:`${s}-end`,children:i.endOfRecords})}):Po("div",{className:"cui-load-more","data-testid":s,children:[j(S,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:m,ref:x,testId:`${s}-button`,children:i.loadMore(z(n,d))}),r===null?null:j(V,{occurrence:r.occurrence,testId:`${s}-failure`,children:i.loadFailed(r.reason)})]})};import{jsx as ve,jsxs as at}from"react/jsx-runtime";var wo=({master:e,detail:t,masterMinPx:o,detailMinPx:r,testId:n})=>{u();let a=ke({masterMinPx:o,detailMinPx:r,gapPx:W.space["space-6"]});return at("div",{className:"cui-container","data-testid":n,children:[ve(H,{ruleKey:a.key,css:a.css}),at("div",{className:"cui-master-detail","data-cui-master-detail":a.key,children:[ve("div",{className:"cui-master-detail-pane","data-testid":`${n}-master`,children:e}),ve("div",{className:"cui-master-detail-pane","data-testid":`${n}-detail`,children:t})]})]})};import{jsx as nt}from"react/jsx-runtime";var Ce=({value:e,unit:t,testId:o})=>{let{formatLocale:r,labels:n}=N();if(e===null)return nt("span",{className:"cui-measured","data-measured":"false","data-testid":o,children:n.unmeasured});let a=z(e,r);return nt("span",{className:"cui-measured","data-measured":"true","data-testid":o,children:t===void 0?a:`${a} ${t}`})};import{jsx as ee,jsxs as So}from"react/jsx-runtime";var Mo=({label:e,value:t,min:o,max:r,valueText:n,testId:a})=>{if(u(),!(Number.isFinite(o)&&Number.isFinite(r)&&o<r))throw new RangeError(`Meter needs a finite range with min below max: min ${o}, max ${r}`);if(!(Number.isFinite(t)&&t>=o&&t<=r))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${o}, max ${r}`);return So("span",{className:"cui-meter","data-testid":a,children:[ee("span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":t,"aria-valuetext":n,"data-cui-surface":"sunken","data-testid":`${a}-bar`,children:ee("span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-o)/(r-o)*100}%`},"data-testid":`${a}-fill`})}),ee("span",{"aria-hidden":"true",children:ee(v,{fg:"fg",type:"body",testId:`${a}-value`,children:n})})]})};import{jsx as st,jsxs as ko}from"react/jsx-runtime";var Lo=({failure:e,onReload:t,forbiddenMessage:o,failureMessage:r,rescueRef:n,testId:a})=>{let{labels:s}=N();return ko("div",{className:"cui-resource-failed","data-testid":a,children:[st(V,{occurrence:e.occurrence,testId:`${a}-alert`,children:s.failureSentence(e,o,r===void 0?s.loadFailed:r)}),e.status===403?null:st(S,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:n,testId:`${a}-reload`,children:s.reload})]})};import{jsx as xe,jsxs as Ao}from"react/jsx-runtime";var Io=({label:e,options:t,value:o,onValueChange:r,testId:n})=>{u();let a=new Set(t.map(s=>s.value));if(t.length<2||a.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(s=>s.value).join(", ")}`);if(!a.has(o))throw new RangeError(`The pressed value "${o}" is not one of the options: ${[...a].join(", ")}`);return Ao("fieldset",{className:"cui-segmented-group","data-testid":n,children:[xe("legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),xe("div",{className:"cui-segmented",children:t.map(s=>{let d=s.value===o;return xe("button",{className:"cui-segment",type:"button","aria-pressed":d,"data-cui-fg":d?"on-solid":"fg","data-cui-surface":d?"info-solid":void 0,"data-cui-type":"body","data-testid":`${n}-${s.value}`,onClick:()=>{d||r(s.value)},children:s.label},s.value)})})]})};import{jsx as F}from"react/jsx-runtime";var it=({selected:e,controls:t,onSelect:o,testId:r,dataAttributes:n,ref:a,children:s})=>(u(),F("button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:o,ref:a,...P(n),children:s})),Do=({label:e,items:t,itemKey:o,selectedKey:r,onSelect:n,detailId:a,renderRow:s,rowTestId:d,rowData:i,empty:c,testId:p,ref:l})=>(u(),F("div",{className:"cui-selectable","data-testid":p,ref:l,children:t.length===0?F(v,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:c}):F("ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(y=>{let m=o(y);return F("li",{children:F(it,{selected:m===r,controls:a,onSelect:()=>n(y),testId:d,dataAttributes:i?.(y),children:s(y)})},m)})})}));import{useId as $o}from"react";import{jsx as te,jsxs as lt}from"react/jsx-runtime";var Ho=({label:e,value:t,min:o,max:r,step:n,valueText:a,onValueChange:s,testId:d})=>{u();let i=$o();if(!([t,o,r,n].every(Number.isFinite)&&o<r&&n>0&&o<=t&&t<=r))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${o}, max ${r}, step ${n}`);let c=a(t);return lt("div",{className:"cui-field","data-testid":`${d}-field`,children:[te("label",{className:"cui-field-label",htmlFor:i,"data-cui-type":"body",children:e}),lt("div",{className:"cui-slider",children:[te("input",{className:"cui-slider-input",id:i,type:"range",min:o,max:r,step:n,value:t,"aria-valuetext":c,"data-testid":d,onChange:p=>s(p.currentTarget.valueAsNumber)}),te("span",{className:"cui-slider-value","aria-hidden":"true",children:te(v,{fg:"fg",type:"body",testId:`${d}-value`,children:c})})]})]})};import{jsx as dt}from"react/jsx-runtime";var Fo=({gap:e,testId:t,children:o})=>(u(),dt("div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:o})),Uo=({gap:e,testId:t,children:o})=>(u(),dt("div",{className:"cui-cluster","data-cui-gap":e,"data-testid":t,children:o}));import{jsx as Ee,jsxs as ut}from"react/jsx-runtime";var ct={done:0,current:1,pending:2},Oo={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Bo=({label:e,steps:t,testId:o})=>{let{labels:r}=N();if(t.length===0||new Set(t.map(a=>a.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(a=>a.id).join(", ")}`);if(t.filter(a=>a.state==="current").length>1||t.some((a,s)=>s>0&&ct[a.state]<ct[t[s-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(a=>a.state).join(", ")}`);let n={done:r.stepDone,current:null,pending:r.stepPending};return Ee("ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":o,children:t.map((a,s)=>{let d=Oo[a.state],i=n[a.state];return ut("li",{className:"cui-step","aria-current":a.state==="current"?"step":void 0,"data-cui-step":a.state,"data-testid":`${o}-${a.id}`,children:[Ee("span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":d.fg,"data-cui-surface":d.surface,"data-cui-type":"caption",children:a.state==="done"?"\u2713":s+1}),ut("span",{className:"cui-step-label","data-cui-fg":"fg",children:[a.label,i===null?null:Ee("span",{className:"cui-visually-hidden",children:` (${i})`})]})]},a.id)})})};import{jsx as Ne,jsxs as qo}from"react/jsx-runtime";var Ko=({label:e,checked:t,onCheckedChange:o,testId:r})=>(u(),qo("button",{className:"cui-switch",type:"button",role:"switch","aria-checked":t,"data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:()=>o(!t),children:[Ne("span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":t?"info-solid":"sunken","data-testid":`${r}-track`,children:Ne("span",{className:"cui-switch-thumb","data-cui-surface":t?"surface":"neutral-solid","data-testid":`${r}-thumb`})}),Ne("span",{children:e})]}));import{jsx as oe}from"react/jsx-runtime";var _o=({label:e,items:t,currentId:o,onNavigate:r,testId:n})=>{if(u(),t.length===0)throw new RangeError("Tabs needs at least one tab");let a=new Set(t.map(s=>s.id));if(a.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(s=>s.id).join(", ")}`);if(!a.has(o))throw new RangeError(`The current tab "${o}" is not one of the tabs: ${[...a].join(", ")}`);return oe("nav",{className:"cui-tabs","aria-label":e,"data-testid":n,children:oe("ul",{className:"cui-tabs-list",role:"list",children:t.map(s=>{let d=s.id===o;return oe("li",{className:"cui-tabs-item",children:oe("a",{className:"cui-tab",href:s.href,"aria-current":d?"page":void 0,"data-cui-fg":d?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${n}-${s.id}`,onClick:i=>J(i,s.href,r),children:s.label})},s.id)})})})};import{Children as Go,Fragment as Vo,isValidElement as zo}from"react";import{jsx as U,jsxs as yt}from"react/jsx-runtime";var Wo={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},Jo=({label:e,sublabel:t,value:o,tone:r,testId:n,dataAttributes:a})=>{if(u(),o===null&&r!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${r}`);return yt("div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":n,...P(a),children:[U("p",{className:"cui-tile-label","data-cui-type":"caption",children:e}),U("p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption",children:t}),U("p",{className:"cui-tile-value","data-cui-fg":Wo[r],"data-cui-type":"heading",children:U(Ce,{value:o,testId:`${n}-value`})})]})},pt=e=>Go.toArray(e).flatMap(t=>{if(!zo(t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===Vo?pt(t.props.children):[t]}),Zo=({count:e,minInlinePx:t,testId:o,children:r})=>{u();let n=Ae(e,t,W.space["space-2"]),a=pt(r).length;if(a!==e)throw new RangeError(`TileGrid has ${a} tiles but count is ${e}`);return yt("div",{className:"cui-container","data-testid":o,children:[U(H,{ruleKey:n.key,css:n.css}),U("div",{className:"cui-tile-grid","data-cui-tile-grid":n.key,"data-cui-gap":"space-2",children:r})]})};import{useLayoutEffect as Yo,useRef as mt}from"react";import{jsx as Qo}from"react/jsx-runtime";var re=e=>[...e.querySelectorAll("button")],Xo=({label:e,testId:t,children:o})=>{u();let r=mt(null),n=mt(null);Yo(()=>{let i=re(r.current),c=n.current!==null&&i.includes(n.current)?n.current:i[0]??null;n.current=c;for(let p of i)p.tabIndex=p===c?0:-1});let a=i=>{for(let c of re(r.current))c.tabIndex=c===i?0:-1;n.current=i};return Qo("div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:r,onFocus:i=>{let c=re(i.currentTarget).find(p=>p.contains(i.target));c!==void 0&&a(c)},onKeyDown:i=>{let c=re(i.currentTarget),p=c.indexOf(i.target);if(p===-1)return;let l=getComputedStyle(i.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",y=l==="ArrowRight"?"ArrowLeft":"ArrowRight",g={[l]:(p+1)%c.length,[y]:(p-1+c.length)%c.length,Home:0,End:c.length-1}[i.key];if(g===void 0)return;i.preventDefault();let x=c[g];a(x),x.focus()},children:o})};import{useCallback as O,useEffect as tr,useLayoutEffect as gt,useRef as Me}from"react";import{useCallback as ae,useEffect as jo,useLayoutEffect as er,useRef as Pe,useState as we}from"react";var ft=e=>e===null?se:ie,ne=(e,t,o,r,n)=>{let[a,s]=we(()=>({key:e,state:ft(e)})),[d,i]=we(0),[c,p]=we(0),l=Pe(t),y=Pe(null),m=Pe(d);er(()=>{l.current=t}),jo(()=>{if(e===null){s({key:null,state:se});return}let f=new AbortController;y.current=e;let h=d===m.current?"revision":"reload";return m.current=d,s(T=>Object.is(T.key,e)?{key:e,state:r(T.state,h)}:{key:e,state:ie}),l.current(f.signal).then(T=>{f.signal.aborted||(y.current=null,s(L=>({key:e,state:n(L.state,T)})))},T=>{f.signal.aborted||s(()=>{throw T})}),()=>{f.abort(),y.current=null}},[e,o,d,c]);let g=ae(()=>i(f=>f+1),[]),x=ae(()=>p(f=>f+1),[]),w=ae((f,h)=>{s(T=>Object.is(T.key,f)?{key:f,state:h(T.state)}:T)},[]),b=ae((f,h)=>{w(f,h),Object.is(y.current,f)&&x()},[w,x]);return{state:Object.is(a.key,e)?a.state:ft(e),reload:g,refresh:x,update:w,write:b}};var or=(e,t,o)=>{let r=Me(t);gt(()=>{r.current=t});let n=O(b=>r.current.first(b),[]),{state:a,reload:s,refresh:d,update:i,write:c}=ne(e,n,o,De,$e),p=Me({key:e,state:a});gt(()=>{p.current={key:e,state:a}});let l=Me(null),y=O(()=>{l.current?.controller.abort(),l.current=null},[]);tr(()=>y,[e,o,y]);let m=O(()=>{y(),s()},[y,s]),g=O(()=>{y(),d()},[y,d]),x=O(()=>{let{key:b,state:R}=p.current;if(b===null||R.kind!=="ready"||R.refreshing||R.value.next===null||R.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let f=R.value.next,h={key:b,controller:new AbortController,maps:[]};l.current=h,i(b,He),r.current.next(f,h.controller.signal).then(T=>{l.current===h&&(l.current=null,i(b,L=>h.maps.reduce((bt,Rt)=>de(bt,Rt),Fe(L,f,T))))},T=>{l.current===h&&i(b,()=>{throw T})})},[i]),w=O((b,R)=>{let f=l.current;f!==null&&Object.is(f.key,b)&&f.maps.push(R),c(b,h=>de(h,R))},[c]);return{state:a,reload:m,refresh:g,loadMore:x,updateList:w}};import{useCallback as rr}from"react";var ar=(e,t,o)=>{let{state:r,reload:n,refresh:a,write:s}=ne(e,t,o,Se,le),d=rr((i,c)=>s(i,p=>le(p,{ok:!0,value:c})),[s]);return{state:r,reload:n,refresh:a,put:d}};import{jsx as sr}from"react/jsx-runtime";var nr=({testId:e,children:t})=>(u(),sr("span",{className:"cui-visually-hidden","data-testid":e,children:t}));export{ue as ANNOUNCE_SETTLE_MS,V as AlertMessage,kt as Breadcrumb,S as Button,mr as CONSOLE_UI_LABEL_CATALOGS,vr as CONTRAST_MINIMUM,Cr as CONTRAST_PAIRS,ye as Card,Ft as CardSection,Uo as Cluster,Ot as CodeBlock,qt as ComparisonGrid,Mt as ConsoleUiRoot,Gt as DataTable,zt as DescriptionList,jt as Dialog,to as Disclosure,oo as Field,Tt as HTTP_FORBIDDEN,co as Heading,bo as JobCard,xr as LATTICE_PX,$t as Link,No as LoadMore,wo as MasterDetail,Ce as Measured,Mo as Meter,Jo as MetricTile,Ro as Notice,be as Pill,Re as ProgressBar,Pr as ROW_WITH_CONTROL_PX,so as RadioGroup,Lo as ResourceFailed,it as RowButton,Io as SegmentedControl,no as Select,Do as SelectableList,Ho as Slider,Fo as Stack,Bo as Stepper,Ko as Switch,Nr as TARGET_PX,W as TOKENS,_o as Tabs,v as Text,ao as TextArea,ro as TextInput,Zo as TileGrid,Xo as Toolbar,nr as VisuallyHidden,ir as ZonedTimeError,He as beginPage,De as beginPagedReload,Se as beginReload,Rr as ceil8,Er as ceilToLattice,hr as contrastRatio,wr as cssVar,pr as flatMapOutcome,z as formatCount,cr as formatInstant,Tr as hexToSrgb,le as keepLastGood,ur as mapOutcome,de as mapPagedList,fr as masterDetailPlan,br as monoTextWidthEm,yr as reasonAside,Le as resolveConsoleUiLabels,$e as settleFirstPage,Fe as settlePage,Ie as tableMinInlinePx,gr as textWidthEm,Ae as tileGridPlan,lr as toOffsetIso,dr as toWallTime,St as useAnnounce,N as useConsoleUi,Xt as useEscapeToClose,Te as useFocusRescue,or as usePagedResource,ar as useResource};