@aiquants/console-ui 0.9.0 → 0.9.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 +5 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/styles/console-ui.css +8 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -59,7 +59,8 @@ Load the stylesheet once, bind the package's neutral font variables to the host'
|
|
|
59
59
|
|
|
60
60
|
### Loading the stylesheet
|
|
61
61
|
|
|
62
|
-
Every rule of the stylesheet sits in the cascade layer `cui`. Cascade layers rank in the order they are first declared, and the `cui` layer must rank above any layer that holds a reset: the paddings and borders the layout arithmetic counts (the card's 1 px rule and the 23 px padding inside it, the 44 px controls and rows, the 52 px rows that hold a control)
|
|
62
|
+
Every rule of the stylesheet sits in the cascade layer `cui`. Cascade layers rank in the order they are first declared, and the `cui` layer must rank above any layer that holds a reset: the paddings and borders the layout arithmetic counts (the card's 1 px rule and the 23 px padding inside it, the 44 px controls and rows, the 52 px rows that hold a control)
|
|
63
|
+
and the margin that centres a `Dialog` (the browser's own `margin: auto`, which the stylesheet restates) are otherwise overridden by the reset (Tailwind's preflight sets `margin: 0; padding: 0; border: 0 solid` on every element in its `base` layer).
|
|
63
64
|
Unlayered host rules beat every layer whatever their order or specificity, so the host's reset must itself sit in a layer ranked below `cui`: an unlayered reset (normalize.css, modern-normalize, Tailwind v3's `@tailwind base`) overrides the package.
|
|
64
65
|
|
|
65
66
|
- **Tailwind v4 host**: `@import` the stylesheet in the CSS entry after the Tailwind layer statement, so `cui` is declared after `base` (it then ranks last), or name the order explicitly:
|
|
@@ -333,6 +334,7 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
|
|
|
333
334
|
- A `Card`, or a `CardSection` with `region`, that the operator closes with Escape takes `onEscape` (`useEscapeToClose` on the element: the press inside calls it and does not reach an enclosing region); without `onEscape` the element has no key handler, so the press reaches the region around it. Returning focus to the control that opened it is the caller's. A non-modal region such as an inspector is drawn this way rather than as a `role="dialog"`.
|
|
334
335
|
- `useEscapeToClose(onClose)` ignores Escape during IME composition and in a text field that holds a value, including a partly typed date, time or number field (its `value` is `""` while `validity.badInput` is true): closing the region would discard what the operator typed.
|
|
335
336
|
Escape changes nothing in most of these fields (a `text`, `number` or `textarea` value stays; only a `search` field clears its value), so the operator leaves the field (Tab) or empties it before Escape closes the region.
|
|
337
|
+
It also ignores an Escape that a handler heard before the region has already cancelled (`preventDefault()`, on the React event or on the native one), and lets it go on: that handler used the press, such as a control inside that closes its list on Escape, or a page-level listener in the capture phase that closes a menu, so the same press does not close the region too, and the next Escape does. `onEscape` of `Card`, `CardSection` and a group `Figure`, and the open popup of a collapsible `Tabs`, follow the same rule.
|
|
336
338
|
|
|
337
339
|
### Reads
|
|
338
340
|
|
|
@@ -432,7 +434,7 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
|
|
|
432
434
|
| `Tabs` | The tab row of a console whose tabs are routes: a named `nav` of real links (not an ARIA `tablist`), the current one `aria-current="page"` with an `info-accent` marker and the medium weight. A plain click hands the tab's `href` to `onNavigate` (the host's router); a click with a modifier key or another button keeps the link's own behaviour. With `collapsible`, a container narrower than 48rem (an inline-size container query on the tab row's own width) folds the links into a full-width 44 px button naming the current tab and a popup of every tab below it (opened on press, closed on choosing a tab, Escape, a press outside or focus moving to an element outside the row, which keeps that focus where it went so the popup never covers it; focus lost to nothing, such as another window, leaves it open); a wider container is the ordinary wrapping row, so a caller that does not set it is unchanged. |
|
|
433
435
|
| `Breadcrumb` | The trail to the current page: a `nav` named by the UI language's `breadcrumb` label around an ordered list of the ancestors' links (drawn like `Link`) and the current page's name as `aria-current="page"` text; separators are hidden from assistive technology. Clicks as `Tabs`. |
|
|
434
436
|
| `Toolbar` | `role="toolbar"` with a roving tabindex over its buttons (see Focus and announcements), laid out like a `Cluster` with an 8 px gap. |
|
|
435
|
-
| `Dialog` | A modal `<dialog>` named by its title, with its close button and its own live region (see Focus and announcements); at most 40 ideographs plus its padding wide (WCAG 1.4.8), never wider than the viewport less 24 px on each side. `description` (a confirmation's sentence) is drawn under the header as a paragraph with the reading measure and is the dialog's `aria-describedby`, so it is read with the dialog's name when the dialog opens; without it the dialog has no description. `initialFocus` names the element focus moves to when it opens (the first field of a form; see Focus and announcements). |
|
|
437
|
+
| `Dialog` | A modal `<dialog>` named by its title, with its close button and its own live region (see Focus and announcements); at most 40 ideographs plus its padding wide (WCAG 1.4.8), never wider than the viewport less 24 px on each side; centred in the viewport and never taller than the viewport (less any scrollbar) less 24 px above and below, cut down to the 4 px lattice. It declares both itself: a host's reset ranked below `cui` would otherwise remove the browser's centring margin and draw it at the top left, and the browser's own height limit falls off the lattice. `description` (a confirmation's sentence) is drawn under the header as a paragraph with the reading measure and is the dialog's `aria-describedby`, so it is read with the dialog's name when the dialog opens; without it the dialog has no description. `initialFocus` names the element focus moves to when it opens (the first field of a form; see Focus and announcements). |
|
|
436
438
|
| `Figure`, `FigureNode`, `FigureEdge` | A drawing of nodes and edges (see Figures): `kind="group"` (a named `role="group"` at its natural size in a scroll frame, every node a 44 px toggle button with the foundation's focus ring, `onEscape`) or `kind="decorative"` (`aria-hidden`, cut down to the lattice as its container shrinks; `viewBox`, `pointer` and `svgRef` for a pannable one). `FigureNode` draws a box (`x`, `y` its top-left corner; a name, caption `notes` and a height from `figureBoxPlan`) or a disc (`x`, `y` its centre; its name under it, or none for `name: null`) in a `tone`, `selected` or not, with a `solid` or `dashed` outline, an optional tooltip (`title`) and, in a group figure, `press` (`label`, `description`, `expanded`, `controls`, `onPress`). `FigureEdge` draws a path (`d`) in an `emphasis` (`normal` or `high`) and a `weight` (1 to 4), with an optional arrowhead and tooltip. The parts paint only through role attributes and take no paint, class or style; `FigureNode` and `FigureEdge` throw outside a `Figure`, and every refusal (`RangeError`) names the part's `testId`: a size off the lattice, a blank name (or a box's `null` one), a box narrower than its plan, a note role not in the table on a face the node takes, a group node without `press` or a decorative one with it, a pressable node below 44 px or closer than 4 px to the edge, and a weight outside 1–4. |
|
|
437
439
|
| `Switch` | An on/off setting that takes effect at once: `role="switch"` with `aria-checked`, named by its label; the thumb sits at the track's start when off and at its end when on, moving over `motion-1`. In a table cell whose headers show the name it may hide its label (`labelHidden`; the target is the 44 px box across the 52 px track). A cell holding more than one switch shows which is which instead: each label is a short visible name after a `VisuallyHidden` subject (the row and the column), so the name stays whole and contains the visible name. Takes `unavailable`, a `ref` and caller `dataAttributes`. |
|
|
438
440
|
| `PanelTabs` | Tabs that switch one panel within the page: a `tablist` of `tab` buttons (the selected one `aria-selected`, drawn like a `Tabs` tab) and the `tabpanel` they control, named by the selected tab; a press on the selected tab asks for nothing. The panel may be described by visible text inside it (`panelDescribedBy`, such as a hint on scrolling a wide figure). A list of one tab is allowed. Refuses no tab, repeated keys and a selected key that is not a tab. |
|
|
@@ -489,6 +491,7 @@ pnpm --filter @aiquants/console-ui run test:coverage # exits non-zero below 100
|
|
|
489
491
|
```
|
|
490
492
|
|
|
491
493
|
The stylesheet tests read `src/styles/components.css` with `node:fs` and parse it with postcss.
|
|
494
|
+
`tests/dialogBox.spec.tsx` measures a `Dialog`'s box in real Chromium, Firefox and WebKit through Playwright, so the test run needs the browsers of the installed `playwright` (`pnpm --filter @aiquants/console-ui exec playwright install chromium firefox webkit`).
|
|
492
495
|
|
|
493
496
|
### Testing in jsdom
|
|
494
497
|
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkRYHSVWM2cjs = require('./chunk-RYHSVWM2.cjs');var _chunkXLOWKWIIcjs = require('./chunk-XLOWKWII.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var Ke=_react.createContext.call(void 0, null),Dt=" ",It='[inert], [aria-hidden="true" i]',Ue="data-cui-dialog-announcer",In=`:scope > [${Ue}]`,$n=e=>{if(e.closest(It)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=_chunkRYHSVWM2cjs.b.call(void 0, e.ownerDocument);if(t.kind==="none")return{region:e};if(t.kind==="undecidable")return{hidden:"focus is in no open modal dialog and they do not nest, so which one is topmost cannot be told"};let n=t.dialog;if(n.contains(e))return{region:e};let r=n.querySelector(In);return r===null?{hidden:"the topmost open modal dialog neither contains the console nor is a Dialog"}:r.closest(It)!==null?{hidden:'the topmost open modal dialog is a Dialog whose live region has an inert or aria-hidden="true" ancestor'}:{region:r}},Fn=e=>{try{e.querySelectorAll(_chunkRYHSVWM2cjs.a)}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}},ge= exports.ANNOUNCE_SETTLE_MS =150,An=1e3,$t=new WeakMap,Dn=(e,t)=>{let n=_nullishCoalesce($t.get(e), () => (new Set)),r={text:t};$t.set(e,n.add(r)),setTimeout(()=>n.delete(r),ge);let a=e.ownerDocument.createElement("span");a.textContent=[...n].map(o=>o.text).join(Dt),e.replaceChildren(a)},Hn= exports.ConsoleUiRoot =({locale:e,formatLocale:t,timeZone:n,accessFailure:r,contrast:a="standard",reducedMotion:o=!1,testId:s,children:l})=>{if(_react.useContext.call(void 0, Ke)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");if(typeof r!="function")throw new TypeError("ConsoleUiRoot: accessFailure must be the host's presenter of access failures (a function)");if(!_chunkXLOWKWIIcjs.h.includes(a))throw new RangeError(`ConsoleUiRoot: contrast must be one of ${_chunkXLOWKWIIcjs.h.join(", ")}: ${String(a)}`);if(typeof o!="boolean")throw new TypeError(`ConsoleUiRoot: reducedMotion must be a boolean: ${String(o)}`);let d=_chunkRYHSVWM2cjs.p.call(void 0, e),[y]=Intl.getCanonicalLocales(t),u=_react.useMemo.call(void 0, ()=>new Intl.DateTimeFormat(y,{timeZone:n}).resolvedOptions().timeZone,[y,n]),c=_react.useRef.call(void 0, null),b=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{Fn(c.current.ownerDocument)},[]);let f=_react.useCallback.call(void 0, R=>{if(R.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let p=()=>{let{texts:h,settle:T,deadline:x}=b.current;b.current=null,clearTimeout(T),clearTimeout(x);let k=c.current;if(k===null)return;let $=h.join(Dt),oe=$n(k);if("hidden"in oe)throw new Error(`announce: the live region is hidden from assistive technology (${oe.hidden}), so this announcement would be lost: ${$}`);Dn(oe.region,$)},E=b.current;if(E===null){b.current={texts:[R],settle:setTimeout(p,ge),deadline:setTimeout(p,An)};return}E.texts.push(R),clearTimeout(E.settle),E.settle=setTimeout(p,ge)},[]),m=_react.useMemo.call(void 0, ()=>({locale:e,formatLocale:y,timeZone:u,labels:d,announce:f,accessFailure:r}),[e,y,u,d,f,r]);return _jsxruntime.jsx.call(void 0, Ke.Provider,{value:m,children:_jsxruntime.jsxs.call(void 0, "div",{"data-cui-root":"","data-cui-contrast":a,"data-cui-reduced-motion":o?"":void 0,"data-cui-surface":"surface","data-cui-fg":"fg","data-testid":s,children:[l,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${s}-announcer`,ref:c})]})})},C= exports.useConsoleUi =()=>{let e=_react.useContext.call(void 0, Ke);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},g=()=>{C()},Be= exports.useAnnounce =()=>C().announce,On= exports.useAccessFailure =()=>C().accessFailure;var v=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};var ae=e=>{let t=e.currentTarget;t.ownerDocument.activeElement!==t&&t.focus({preventScroll:!0})};var B=(e,t)=>{if(e!==void 0&&e.trim()==="")throw new RangeError(`${t}: the key shortcuts must name at least one shortcut, not a blank text: "${e}"`);return e};var Bn=new Set(["abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","mark","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr"]),_n=e=>{for(let t of e.querySelectorAll("*")){let n=t.localName;if(!Bn.has(n)||t.hasAttribute("tabindex")||t.hasAttribute("contenteditable"))return n}return null},D=(e,{testId:t,part:n,host:r})=>{_react.useLayoutEffect.call(void 0, ()=>{let a=_n(e.current);if(a!==null)throw new RangeError(`${t}: the ${n} is the content of a ${r} and holds only non-interactive phrasing content, not <${a}>`)})};var P=({fg:e,type:t,face:n,as:r="span",space:a,testId:o,id:s,tabIndex:l,ref:i,children:d})=>(g(),_jsxruntime.jsx.call(void 0, r,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":n,"data-cui-space":a,"data-cui-measure":r==="p"?"reading":void 0,"data-testid":o,id:s,tabIndex:l,ref:i,children:d}));var Gn=/\s/,_e=(e,t)=>{if(e===""||Gn.test(e))throw new RangeError(`The id of ${t} must be one token without whitespace: "${e}"`);return e},Y=(e,t)=>{if(e!==void 0){if(e.reason!==void 0){if(e.reason.trim()==="")throw new RangeError("An unavailable control needs a reason that is not blank");return t}return _e(e.reasonId,"an unavailable control's reason")}},_=(...e)=>{let t=e.filter(n=>n!==void 0);return t.length===0?void 0:t.join(" ")};var zn={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"}},qe=({subject:e,children:t})=>{let n=_react.useRef.call(void 0, null);return D(n,e),_jsxruntime.jsx.call(void 0, "span",{ref:n,children:t})},I= exports.Button =({variant:e,children:t,testId:n,type:r="button",onClick:a,unavailable:o,describedBy:s,expanded:l,controls:i,ref:d,dataAttributes:y,keyShortcuts:u,busy:c,busyLabel:b})=>{g();let f=_react.useId.call(void 0, ),m=Y(o,f),R=c===!0||o!==void 0,p=zn[e],E=h=>{if(ae(h),R){h.preventDefault();return}_optionalChain([a, 'optionalCall', _2 => _2(h)])};return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-button-group",children:[_jsxruntime.jsx.call(void 0, "button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":p.fg,"data-cui-surface":p.surface,"data-cui-type":p.type,"data-testid":n,"aria-disabled":R?!0:void 0,"aria-busy":c===!0?!0:void 0,"aria-describedby":_(s,m),"aria-expanded":l,"aria-controls":i,"aria-keyshortcuts":B(u,n),onClick:E,ref:d,...v(y),children:_jsxruntime.jsx.call(void 0, qe,{subject:{testId:n,part:"label",host:"button"},children:c===!0?b:t})}),_optionalChain([o, 'optionalAccess', _3 => _3.reason])===void 0?null:_jsxruntime.jsx.call(void 0, P,{fg:"fg-muted",type:"body",id:f,testId:`${n}-reason`,children:o.reason})]})},Jn= exports.Link =({onNavigate:e,children:t,testId:n,ref:r,keyShortcuts:a})=>(g(),_jsxruntime.jsx.call(void 0, "button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,"aria-keyshortcuts":B(a,n),onClick:e,ref:r,children:_jsxruntime.jsx.call(void 0, qe,{subject:{testId:n,part:"label",host:"button"},children:t})})),jn=/^[^\s#]+$/,Xn= exports.FragmentLink =({targetId:e,children:t,testId:n,onFollow:r,dataAttributes:a,keyShortcuts:o})=>{if(g(),!jn.test(e))throw new RangeError(`A fragment link needs the target's id without "#" or white space: "${e}"`);return _jsxruntime.jsx.call(void 0, "a",{className:"cui-link",href:`#${e}`,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,"aria-keyshortcuts":B(o,n),onClick:r,...v(a),children:_jsxruntime.jsx.call(void 0, qe,{subject:{testId:n,part:"label",host:"link"},children:t})})};var Zn=({gap:e,testId:t,children:n})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:n})),Ge= exports.Cluster =({gap:e,as:t="div",testId:n,children:r})=>(g(),_jsxruntime.jsx.call(void 0, t,{className:"cui-cluster","data-cui-gap":e,"data-testid":n,children:r}));var tr=new Set(["sign-in","sign-in-again","sign-in-again-in-new-window"]),nr=" ",rr= exports.AccessFailureNotice =({view:e,handlers:t,testId:n})=>{let r=Be(),a=e.actions.map(({action:l,label:i})=>{let d=t[l];if(d===void 0)throw new TypeError(`AccessFailureNotice: no handler for the action ${JSON.stringify(l)}`);return{action:l,label:i,handler:d}}),o=e.politeness==="status"?[e.title,...e.sentences].join(nr):null,s=_react.useRef.call(void 0, null);return _react.useEffect.call(void 0, ()=>{o===null||s.current===o||(s.current=o,r(o))},[r,o]),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-access-failure","data-cui-access-failure":e.kind,"data-testid":n,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-notice cui-access-failure-message",role:e.politeness==="alert"?"alert":void 0,"data-cui-tone":"warning","data-cui-surface":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-cui-measure":"reading","data-testid":`${n}-message`,children:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-access-failure-title","data-cui-measure":"reading","data-testid":`${n}-title`,children:e.title}),e.sentences.map(l=>_jsxruntime.jsx.call(void 0, "p",{className:"cui-access-failure-sentence","data-cui-measure":"reading",children:l},l))]}),a.length===0?null:_jsxruntime.jsx.call(void 0, Ge,{gap:"space-2",testId:`${n}-actions`,children:a.map(({action:l,label:i,handler:d})=>_jsxruntime.jsx.call(void 0, I,{variant:tr.has(l)?"primary":"secondary",onClick:d,testId:`${n}-${l}`,children:i},l))})]})};var Z=(e,t,n)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),n(t))};var or=({items:e,current:t,onNavigate:n,testId:r})=>{let{labels:a}=C();if(new Set(e.map(o=>o.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(o=>o.id).join(", ")}`);return _jsxruntime.jsx.call(void 0, "nav",{className:"cui-breadcrumb","aria-label":a.breadcrumb,"data-testid":r,children:_jsxruntime.jsxs.call(void 0, "ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(o=>_jsxruntime.jsxs.call(void 0, "li",{className:"cui-breadcrumb-item",children:[_jsxruntime.jsx.call(void 0, "a",{className:"cui-link",href:o.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${r}-${o.id}`,onClick:s=>Z(s,o.href,n),children:o.label}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},o.id)),_jsxruntime.jsx.call(void 0, "li",{className:"cui-breadcrumb-item",children:_jsxruntime.jsx.call(void 0, "span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${r}-current`,children:t})})]})})};var ir=229,sr=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),he=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&sr.has(e.type)&&(e.value!==""||e.validity.badInput),Ve=e=>e.nativeEvent.isComposing||e.keyCode===ir,q=(e,t)=>{e.key!=="Escape"||Ve(e)||he(e.target)||(e.stopPropagation(),t())},dr= exports.useEscapeToClose =e=>_react.useCallback.call(void 0, t=>q(t,e),[e]);var Bt=e=>e===void 0?void 0:t=>q(t,e),We= exports.Card =({id:e,title:t,description:n,actions:r,onEscape:a,testId:o,headingRef:s,ref:l,dataAttributes:i,children:d})=>{g();let y=_react.useId.call(void 0, ),u=Bt(a);return _jsxruntime.jsxs.call(void 0, "section",{className:"cui-card",id:e,"aria-labelledby":y,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:l,onKeyDown:u,...v(i),children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-header",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-heading",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"cui-card-title",id:y,"data-cui-type":"title","data-testid":`${o}-heading`,ref:s,tabIndex:s===void 0?void 0:-1,children:t}),n===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),r===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-actions",children:r})]}),d]})},lr={3:"h3",4:"h4"},ur= exports.CardSection =({id:e,title:t,subtitle:n,level:r=3,region:a=!1,onEscape:o,testId:s,headingRef:l,ref:i,dataAttributes:d,children:y})=>{g();let u=_react.useId.call(void 0, ),c=Bt(o),b=lr[r],f=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-section-heading",children:[_jsxruntime.jsx.call(void 0, b,{className:"cui-card-section-title",id:u,"data-cui-type":"body","data-testid":`${s}-heading`,ref:l,tabIndex:l===void 0?void 0:-1,children:t}),n===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),y]});return a?_jsxruntime.jsx.call(void 0, "section",{className:"cui-card-section",id:e,"aria-labelledby":u,"data-testid":s,ref:i,onKeyDown:c,...v(d),children:f}):_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section",id:e,"data-testid":s,ref:i,...v(d),children:f})};var pr=({label:e,code:t,testId:n})=>(g(),_jsxruntime.jsx.call(void 0, "section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":n,children:_jsxruntime.jsx.call(void 0, "pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${n}-code`,children:t})}));var Q=({ruleKey:e,css:t})=>_jsxruntime.jsx.call(void 0, "style",{href:e,precedence:"cui",children:t});var mr=({caption:e,attributes:t,columns:n,attributePx:r,columnMinPx:a,testId:o})=>{g();let s=_react.useId.call(void 0, );for(let u of[r,a])if(!(Number.isFinite(u)&&u>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${u}`);if(n.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let u of n)for(let c of t)if(!Object.hasOwn(u.cells,c.key))throw new RangeError(`Column "${u.key}" has no value for attribute "${c.key}"`);let l=r+n.length*a,i=`cui-comparison-a${r}-c${a}-n${n.length}`,d=u=>`[data-cui-comparison="${i}"][data-cui-comparison-layout="${u}"]`,y=`${d("table")}{display:none}@container (min-width:${_chunkRYHSVWM2cjs.O.call(void 0, l)}){${d("table")}{display:block}${d("stack")}{display:none}}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-cui-stack-below-px":l,"data-testid":o,children:[_jsxruntime.jsx.call(void 0, Q,{ruleKey:i,css:y}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-frame","data-cui-comparison":i,"data-cui-comparison-layout":"table",children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-comparison-table","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "caption",{className:"cui-visually-hidden",children:e}),_jsxruntime.jsxs.call(void 0, "colgroup",{children:[_jsxruntime.jsx.call(void 0, "col",{style:{width:_chunkRYHSVWM2cjs.O.call(void 0, r)}}),n.map(u=>_jsxruntime.jsx.call(void 0, "col",{},u.key))]}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "td",{}),n.map(u=>_jsxruntime.jsx.call(void 0, "th",{scope:"col",children:u.heading},u.key))]})}),_jsxruntime.jsx.call(void 0, "tbody",{children:t.map(u=>_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "th",{scope:"row",children:u.label}),n.map(c=>_jsxruntime.jsx.call(void 0, "td",{children:c.cells[u.key]("table")},c.key))]},u.key))})]})}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-stack","data-cui-comparison":i,"data-cui-comparison-layout":"stack",children:n.map((u,c)=>{let b=`${s}-column-${c}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-comparison-column",role:"group","aria-labelledby":b,"data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-heading",id:b,children:u.heading}),_jsxruntime.jsx.call(void 0, "dl",{className:"cui-comparison-list",children:t.map(f=>_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "dt",{children:f.label}),_jsxruntime.jsx.call(void 0, "dd",{children:u.cells[f.key]("stack")})]},f.key))})]},u.key)})})]})};var de="[data-cui-row-focus]",ze="[data-cui-row-detail]",gr=e=>e===null?[]:[...e.querySelectorAll(`:scope > ${de}`)],qt=(e,t)=>{let n=new Map;t!==null&&n.set(t,0);let r=-1;for(let a of e===null?[]:e.children)a.matches(de)?(r+=1,n.set(a,r)):r>=0&&a.matches(ze)&&n.set(a,r);return n},Gt=(e,t,n,r)=>{let a=gr(t);if(a.length===0)return n;let o=r.get(e);if(o===void 0)throw new RangeError(`rowFocusTarget: <${e.localName}> left holding focus with no position in the table (only its rows, row details and empty text hold one)`);return a[Math.min(o,a.length-1)]};var Rr=e=>e+1,le= exports.useFocusRescue =e=>{let t=_react.useRef.call(void 0, e),n=_react.useRef.call(void 0, null),r=_react.useRef.call(void 0, !1),[,a]=_react.useReducer.call(void 0, Rr,0),o=_react.useCallback.call(void 0, (s=>()=>{r.current&&s.contains(document.activeElement)&&(n.current=s,a())}),[]);return _react.useLayoutEffect.call(void 0, ()=>(r.current=!0,()=>{r.current=!1,n.current=null}),[]),_react.useLayoutEffect.call(void 0, ()=>{t.current=e}),_react.useLayoutEffect.call(void 0, ()=>{let s=n.current;if(s===null)return;n.current=null;let l=[null,document.body].includes(document.activeElement);s.isConnected||!l||_optionalChain([t, 'access', _4 => _4.current, 'call', _5 => _5(s), 'optionalAccess', _6 => _6.focus, 'call', _7 => _7()])}),o};var wr=new Map,vr='a[href], audio[controls], button, details, embed, iframe, img[usemap], input:not([type="hidden"]), label, select, textarea, video[controls], [tabindex], [contenteditable]',Pr=(e,t,n)=>{_react.useLayoutEffect.call(void 0, ()=>{let r=e.current;if(t!=="row-compact"||r===null)return;let a=[...r.querySelectorAll(vr)].find(o=>o.parentElement!==r);if(a!==void 0)throw new RangeError(`${n}: a compact row holds no control or focus target (a ${_chunkRYHSVWM2cjs.s} px target does not fit its ${_chunkRYHSVWM2cjs.u} px; use row-control), not <${a.localName}>`)})},Nr=(e,t)=>{let n=e.filter(a=>a.rowHeader===!0).map(a=>a.key);if(n.length>1)throw new RangeError(`${t}: a table has at most one row header column, not ${n.length} (${n.join(", ")})`);let r=e.find(a=>a.rowHeader!==!0&&a.rowHeaderNote!==void 0);if(r!==void 0)throw new RangeError(`${t}: a row header note belongs to the row header column, not to ${r.key}`)},Cr=e=>e==null?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-table-header-note",children:e}),kr=(e,t,n,r,a)=>{let o=e.open(t);return _jsxruntime.jsx.call(void 0, "tr",{ref:a,hidden:!o,"data-cui-row-detail":o?"open":"closed","data-testid":`${r}-detail`,children:_jsxruntime.jsx.call(void 0, "td",{colSpan:n,id:e.id(t),children:o?e.render(t):null})})},Lr= exports.DataTable =({caption:e,captionHidden:t,columns:n,rows:r,rowKey:a,rowTestId:o,rowData:s,rowSize:l,rowDetail:i,empty:d,testId:y,ref:u})=>{g();let c=_react.useId.call(void 0, ),b=_react.useRef.call(void 0, null);Pr(b,l,y);let f=_react.useRef.call(void 0, null),m=_react.useRef.call(void 0, wr),R=le(h=>Gt(h,b.current,f.current,m.current));_react.useLayoutEffect.call(void 0, ()=>{m.current=qt(b.current,f.current)});let p=_react.useCallback.call(void 0, h=>{f.current=h;let T=R(h);return()=>{f.current=null,T()}},[R]),E=_chunkRYHSVWM2cjs.R.call(void 0, n);return Nr(n,y),_jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":y,ref:u,children:r.length===0?_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"prose",tabIndex:-1,ref:p,testId:`${y}-empty`,children:d}):_jsxruntime.jsx.call(void 0, "section",{ref:R,className:"cui-table-frame",tabIndex:0,"aria-labelledby":c,"data-testid":`${y}-frame`,children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":l,style:{"--cui-table-min":_chunkRYHSVWM2cjs.O.call(void 0, E)},children:[_jsxruntime.jsx.call(void 0, "caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:c,children:e}),_jsxruntime.jsx.call(void 0, "colgroup",{children:n.map(h=>_jsxruntime.jsx.call(void 0, "col",{style:h.width.fixedPx===void 0?void 0:{width:_chunkRYHSVWM2cjs.O.call(void 0, h.width.fixedPx)}},h.key))}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsx.call(void 0, "tr",{children:n.map(h=>_jsxruntime.jsxs.call(void 0, "th",{scope:"col","data-cui-align":h.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:[h.header,h.note===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-table-header-note",children:h.note})]},h.key))})}),_jsxruntime.jsx.call(void 0, "tbody",{ref:b,children:r.map(h=>_jsxruntime.jsxs.call(void 0, _react.Fragment,{children:[_jsxruntime.jsx.call(void 0, "tr",{ref:R,tabIndex:-1,"data-cui-row-focus":"","data-testid":o,...v(_optionalChain([s, 'optionalCall', _8 => _8(h)])),children:n.map(T=>T.rowHeader===!0?_jsxruntime.jsxs.call(void 0, "th",{scope:"row","data-cui-align":T.align,children:[T.cell(h),T.rowHeaderNote===void 0?null:Cr(T.rowHeaderNote(h))]},T.key):_jsxruntime.jsx.call(void 0, "td",{"data-cui-align":T.align,children:T.cell(h)},T.key))}),i===void 0?null:kr(i,h,n.length,o,R)]},a(h)))})]})})})};var Sr=({items:e,testId:t})=>{if(g(),new Set(e.map(n=>n.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(n=>n.key).join(", ")}`);return _jsxruntime.jsx.call(void 0, "dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(n=>_jsxruntime.jsxs.call(void 0, "div",{className:"cui-description-row","data-testid":`${t}-${n.key}`,children:[_jsxruntime.jsx.call(void 0, "dt",{"data-cui-fg":"fg-secondary",children:n.term}),_jsxruntime.jsx.call(void 0, "dd",{"data-cui-fg":"fg",children:n.description})]},n.key))})};var Jt=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},Ir=(e,t)=>{if(t===null||!e.contains(t))throw new RangeError("A dialog's initial focus must be an element inside the dialog");return t},$r=(e,t)=>{if(t.focus(),e.ownerDocument.activeElement!==t)throw e.close(),new RangeError("A dialog's initial focus must be an element that takes focus")},Fr=e=>e instanceof HTMLInputElement&&e.type==="search",Ar= exports.Dialog =({title:e,description:t,open:n,onClose:r,initialFocus:a,testId:o,children:s})=>{let{labels:l}=C(),i=_react.useId.call(void 0, ),d=_react.useId.call(void 0, ),y=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null),c=_react.useRef.call(void 0, !1);return _react.useLayoutEffect.call(void 0, ()=>{let p=y.current;if(n&&!p.open){let E=a===void 0?null:Ir(p,a.current);u.current=p.ownerDocument.activeElement,p.showModal(),E!==null&&$r(p,E)}else!n&&p.open&&p.close()},[n,a]),_react.useLayoutEffect.call(void 0, ()=>{let p=y.current;return()=>{p.open&&(p.close(),Jt(u.current),u.current=null)}},[]),_jsxruntime.jsxs.call(void 0, "dialog",{className:"cui-dialog","aria-labelledby":i,"aria-describedby":t===void 0?void 0:d,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:y,onClose:p=>{p.currentTarget.open||(Jt(u.current),u.current=null,n&&r())},onCancel:p=>{let E=c.current;c.current=!1,(E||he(p.currentTarget.ownerDocument.activeElement))&&p.preventDefault()},onKeyDownCapture:p=>{let E=Ve(p);c.current=E,p.key==="Escape"&&!E&&he(p.target)&&!Fr(p.target)&&p.preventDefault()},onKeyUpCapture:()=>{c.current=!1},children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-dialog-header",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"cui-dialog-title",id:i,"data-cui-type":"title",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-dialog-actions",children:_jsxruntime.jsx.call(void 0, I,{variant:"secondary",testId:`${o}-close`,onClick:()=>_optionalChain([y, 'access', _9 => _9.current, 'optionalAccess', _10 => _10.close, 'call', _11 => _11()]),children:l.close})})]}),t===void 0?null:_jsxruntime.jsx.call(void 0, "div",{id:d,"data-cui-measure":"reading","data-testid":`${o}-description`,children:t}),s,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[Ue]:"","data-testid":`${o}-announcer`})]})};var Or=({summary:e,open:t,onOpenChange:n,testId:r,children:a})=>{g();let o=_react.useId.call(void 0, ),s=_react.useRef.call(void 0, null);return D(s,{testId:r,part:"summary",host:"button"}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-disclosure","data-testid":r,children:[_jsxruntime.jsxs.call(void 0, "button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":o,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${r}-button`,onClick:()=>n(!t),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),_jsxruntime.jsx.call(void 0, "span",{ref:s,children:e})]}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-disclosure-panel",id:o,hidden:!t,"data-testid":`${r}-panel`,children:a})]})};var _authcore = require('@aiquants/auth-core');var Kr=({tone:e,testId:t,children:n})=>(g(),_jsxruntime.jsx.call(void 0, "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-cui-measure":"reading","data-testid":t,children:n})),ce= exports.AlertMessage =({occurrence:e,testId:t,children:n})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-measure":"reading","data-cui-occurrence":e,"data-testid":t,children:n},e));var et=({failure:e,place:t,deniedSentence:n,failed:r,retry:a,testId:o})=>{let{labels:s,accessFailure:l}=C();if(n.trim()==="")throw new RangeError("FailureMessage: deniedSentence must be a non-empty sentence");let i=e.status===null?null:_authcore.accessFailureKindOfStatus.call(void 0, e.status);return i===null?_jsxruntime.jsx.call(void 0, ce,{occurrence:e.occurrence,testId:o,children:s.failureSentence(e,r)}):_jsxruntime.jsx.call(void 0, _react.Fragment,{children:l({kind:i,place:t,deniedSentence:i==="forbidden"?s.forbiddenBecause(n,e.reason):null,retry:a})},e.occurrence)};var _r=/\s/,tt=e=>{if(e!==void 0&&(typeof e!="string"||e===""||_r.test(e)))throw new RangeError(`A control's name must be one token without whitespace: "${e}"`);return e},Qt=e=>{if(e!==void 0&&!(Number.isInteger(e)&&e>0))throw new RangeError(`A field's maxLength must be a positive integer: ${e}`);return e},te=({description:e,error:t,errorId:n})=>{g();let r=_react.useId.call(void 0, ),a=_react.useId.call(void 0, ),o=_react.useId.call(void 0, ),s=n===void 0?o:_e(n,"a field's error"),l=[e===void 0?null:a,t===void 0?null:s].filter(d=>d!==null).join(" ");return{control:{id:r,"aria-describedby":l===""?void 0:l,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:s}},ne=({description:e,error:t,descriptionId:n,errorId:r,testId:a})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[e===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",id:n,testId:`${a}-description`,children:e}),t===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${a}-error`,children:t})]}),Te=({htmlFor:e,hidden:t,children:n})=>_jsxruntime.jsx.call(void 0, "label",{className:t===!0?"cui-visually-hidden":"cui-field-label",htmlFor:e,"data-cui-type":"body",children:n}),qr= exports.Field =({label:e,description:t,error:n,errorId:r,testId:a,children:o})=>{let{control:s,descriptionId:l,errorId:i}=te({label:e,description:t,error:n,errorId:r});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":a,children:[_jsxruntime.jsx.call(void 0, Te,{htmlFor:s.id,hidden:void 0,children:e}),o(s),_jsxruntime.jsx.call(void 0, ne,{description:t,error:n,descriptionId:l,errorId:i,testId:a})]})},en=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,type:s,name:l,maxLength:i,list:d,autoComplete:y,inputMode:u,prefix:c,labelHidden:b,required:f,testId:m,ref:R})=>{let{control:p,descriptionId:E,errorId:h}=te({label:e,description:t,error:n,errorId:r}),T=_react.useId.call(void 0, );if(c!==void 0&&c.trim()==="")throw new RangeError("An input's prefix must not be blank");if(i!==void 0&&s==="datetime-local")throw new RangeError(`A ${s} input takes no maxLength: ${i}`);let x=s==="password",k=_jsxruntime.jsx.call(void 0, "input",{className:"cui-input",type:s,name:tt(l),maxLength:Qt(i),value:a,list:d,autoComplete:y,inputMode:u,spellCheck:x?!1:void 0,autoCapitalize:x?"none":void 0,required:f,onChange:$=>o($.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":m,ref:R,...p,"aria-describedby":_(c===void 0?void 0:T,p["aria-describedby"])});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${m}-field`,children:[_jsxruntime.jsx.call(void 0, Te,{htmlFor:p.id,hidden:b,children:e}),c===void 0?k:_jsxruntime.jsxs.call(void 0, "div",{className:"cui-input-group",children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-input-prefix",id:T,"data-cui-fg":"fg-secondary","data-cui-surface":"sunken","data-cui-type":"body","data-testid":`${m}-prefix`,children:c}),k]}),_jsxruntime.jsx.call(void 0, ne,{description:t,error:n,descriptionId:E,errorId:h,testId:m})]})},Gr= exports.TextInput =e=>_jsxruntime.jsx.call(void 0, en,{...e}),Vr= exports.PasswordInput =e=>_jsxruntime.jsx.call(void 0, en,{...e,type:"password"}),Wr= exports.TextArea =({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,name:s,maxLength:l,required:i,testId:d,ref:y})=>{let{control:u,descriptionId:c,errorId:b}=te({label:e,description:t,error:n,errorId:r});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${d}-field`,children:[_jsxruntime.jsx.call(void 0, Te,{htmlFor:u.id,hidden:void 0,children:e}),_jsxruntime.jsx.call(void 0, "textarea",{className:"cui-input cui-textarea",name:tt(s),maxLength:Qt(l),value:a,required:i,onChange:f=>o(f.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":d,ref:y,...u}),_jsxruntime.jsx.call(void 0, ne,{description:t,error:n,descriptionId:c,errorId:b,testId:d})]})},zr= exports.Select =({label:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:s,name:l,labelHidden:i,unavailable:d,testId:y,ref:u})=>{let{control:c,descriptionId:b,errorId:f}=te({label:e,description:t,error:n,errorId:r}),m=_react.useId.call(void 0, ),R=Y(d,m);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${y}-field`,children:[_jsxruntime.jsx.call(void 0, Te,{htmlFor:c.id,hidden:i,children:e}),_jsxruntime.jsx.call(void 0, "select",{className:"cui-input",name:tt(l),value:a,onChange:p=>{d===void 0&&s(p.target.value)},"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":y,ref:u,...c,"aria-disabled":d===void 0?void 0:!0,"aria-describedby":_(c["aria-describedby"],R),children:o.map(p=>_jsxruntime.jsx.call(void 0, "option",{value:p.value,children:p.label},p.value))}),_jsxruntime.jsx.call(void 0, ne,{description:t,error:n,descriptionId:b,errorId:f,testId:y}),_optionalChain([d, 'optionalAccess', _12 => _12.reason])===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",id:m,testId:`${y}-reason`,children:d.reason})]})},Jr= exports.RadioGroup =({legend:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:s,testId:l,ref:i})=>{let d=_react.useId.call(void 0, ),{control:y,descriptionId:u,errorId:c}=te({label:e,description:t,error:n,errorId:r});return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-radio-group","aria-describedby":y["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),o.map((b,f)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-radio","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"radio",name:d,value:b.value,checked:b.value===a,onChange:()=>s(b.value),"aria-invalid":y["aria-invalid"],"data-testid":`${l}-option-${b.value}`,ref:f===0?i:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:b.label})]},b.value)),_jsxruntime.jsx.call(void 0, ne,{description:t,error:n,descriptionId:u,errorId:c,testId:l})]})},jr= exports.CheckboxGroup =({legend:e,description:t,error:n,errorId:r,values:a,options:o,onValuesChange:s,testId:l,ref:i})=>{let{control:d,descriptionId:y,errorId:u}=te({label:e,description:t,error:n,errorId:r}),c=o.map(m=>m.value);if(c.length===0||new Set(c).size!==c.length)throw new RangeError(`A check box group needs at least one option with unique values: ${c.join(", ")}`);let b=a.filter(m=>!c.includes(m));if(b.length>0)throw new RangeError(`The chosen values are not options: ${b.join(", ")}`);let f=new Set(a);return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-checkbox-group","aria-describedby":d["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),o.map((m,R)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-checkbox","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"checkbox",value:m.value,checked:f.has(m.value),onChange:()=>s(c.filter(p=>p===m.value?!f.has(p):f.has(p))),"aria-invalid":d["aria-invalid"],"data-testid":`${l}-option-${m.value}`,ref:R===0?i:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:m.label})]},m.value)),_jsxruntime.jsx.call(void 0, ne,{description:t,error:n,descriptionId:y,errorId:u,testId:l})]})};var sn=_react.createContext.call(void 0, null),tn="surface",nn={neutral:{face:"surface",line:"border-control"},info:{face:"info-tint",line:"info-accent"},success:{face:"success-tint",line:"success-accent"},warning:{face:"warning-tint",line:"warning-accent"},danger:{face:"danger-tint",line:"danger-accent"}},rn={face:"info-tint",line:"info-accent"},dn={normal:"border-control",high:"info-accent"},eo=["normal","high"],to=[1,2,3,4],H=_chunkRYHSVWM2cjs.v.space["space-2"],no="fg",ro="fg-secondary",ln=e=>{let t=_react.useContext.call(void 0, sn);if(t===null)throw new Error(`${e} must be rendered inside Figure`);return t},nt=(e,t,n)=>{if(!(Number.isFinite(n)&&n>0&&n%4===0))throw new RangeError(`${e}: ${t} must be a positive multiple of the ${4} px lattice: ${n}`)},oo= exports.Figure =e=>{g();let t=_react.useId.call(void 0, ),{kind:n,widthPx:r,heightPx:a,testId:o,dataAttributes:s,children:l}=e;nt(o,"widthPx",r),nt(o,"heightPx",a);let i=_react.useMemo.call(void 0, ()=>({kind:n,widthPx:r,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[n,r,a,t]),d=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "defs",{children:eo.map(b=>_jsxruntime.jsx.call(void 0, "marker",{id:i.arrowIds[b],viewBox:`0 0 ${H} ${H}`,refX:H,refY:H/2,markerWidth:H,markerHeight:H,markerUnits:"userSpaceOnUse",orient:"auto","data-cui-emphasis":b,children:_jsxruntime.jsx.call(void 0, "path",{d:`M 0 0 L ${H} ${H/2} L 0 ${H} z`,"data-cui-stroke":dn[b],"data-testid":`${o}-arrow-${b}`})},b))}),_jsxruntime.jsx.call(void 0, sn.Provider,{value:i,children:l})]});if(e.kind==="group"){let{label:b,onEscape:f}=e;if(!_chunkRYHSVWM2cjs.h.call(void 0, b))throw new RangeError(`${o}: a group figure's label must hold a readable character: ${JSON.stringify(b)}`);return _jsxruntime.jsx.call(void 0, "div",{className:"cui-figure-frame","data-testid":`${o}-frame`,children:_jsxruntime.jsx.call(void 0, "svg",{className:"cui-figure",role:"group","aria-label":b,viewBox:`0 0 ${r} ${a}`,"data-cui-figure":"group","data-cui-surface":tn,"data-cui-face":"sans",style:{"--cui-figure-inline":_chunkRYHSVWM2cjs.O.call(void 0, r),"--cui-figure-block":_chunkRYHSVWM2cjs.O.call(void 0, a)},onKeyDown:f===void 0?void 0:m=>q(m,f),"data-testid":o,...v(s),children:d})})}let{viewBox:y,pointer:u,svgRef:c}=e;return _jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":`${o}-frame`,children:_jsxruntime.jsx.call(void 0, "svg",{ref:c,className:"cui-figure","aria-hidden":"true",viewBox:y===void 0?`0 0 ${r} ${a}`:y,"data-cui-figure":"decorative","data-cui-surface":tn,"data-cui-face":"sans","data-cui-pan":u===void 0?void 0:"true","data-cui-cursor":_optionalChain([u, 'optionalAccess', _13 => _13.cursor]),style:{"--cui-figure-inline":_chunkRYHSVWM2cjs.O.call(void 0, r),"--cui-figure-ratio":String(a/r)},"data-testid":o,...v(s),..._optionalChain([u, 'optionalAccess', _14 => _14.handlers]),children:d})})},on=(e,t)=>{try{return t()}catch(n){throw new RangeError(`${e}: ${n.message}`,{cause:n})}},ao=(e,t,n)=>{for(let r of t){let a=_chunkXLOWKWIIcjs.i.light[r.fg],o=n.find(s=>a[s]===void 0);if(o!==void 0)throw new RangeError(`${e}: the note ${JSON.stringify(r.text)} in ${r.fg} is not in the contrast table on ${o}, a face the node takes`)}},io= exports.FigureNode =e=>{g();let t=ln("FigureNode"),n=_react.useId.call(void 0, ),{x:r,y:a,shape:o,tone:s,outline:l,selected:i,name:d,title:y,press:u,testId:c,dataAttributes:b}=e,f=e.notes===void 0?[]:e.notes;if(!(Number.isFinite(r)&&Number.isFinite(a)))throw new RangeError(`${c}: a node's position must be finite: ${r}, ${a}`);if(t.kind==="group"&&u===void 0)throw new RangeError(`${c}: every node of a group figure must be pressable (pass press)`);if(t.kind==="decorative"&&u!==void 0)throw new RangeError(`${c}: a node of a decorative figure cannot be pressed (it is hidden from assistive technology)`);if(u!==void 0&&!_chunkRYHSVWM2cjs.h.call(void 0, u.label))throw new RangeError(`${c}: a pressable node's label must hold a readable character: ${JSON.stringify(u.label)}`);let m=i?rn:nn[s];ao(c,f,[nn[s].face,rn.face]);let R,p,E;if(o.kind==="box"){if(d===null)throw new RangeError(`${c}: a box's name is drawn inside the box and sizes it, so it cannot be null (only a disc may be drawn without a name)`);let T=on(c,()=>_chunkRYHSVWM2cjs.I.call(void 0, {name:d,notes:f.map(k=>k.text)}));if(nt(c,"a box's widthPx",o.widthPx),o.widthPx<T.minWidthPx)throw new RangeError(`${c}: a box ${o.widthPx} px wide is narrower than its lines under the widest 1.4.12 spacing (${T.minWidthPx} px)`);R={width:o.widthPx,height:T.heightPx,left:r,top:a};let x=_chunkRYHSVWM2cjs.J.call(void 0, f.length);p=_jsxruntime.jsxs.call(void 0, "g",{"data-cui-surface":m.face,children:[_jsxruntime.jsx.call(void 0, "rect",{className:"cui-figure-plate",width:o.widthPx,height:T.heightPx,rx:_chunkRYHSVWM2cjs.v.radius["radius-item"],"data-cui-fill":m.face,"data-cui-stroke":m.line,"data-testid":`${c}-plate`}),_jsxruntime.jsx.call(void 0, "text",{className:"cui-figure-name",x:x.insetPx,y:x.namePx,fontSize:_chunkRYHSVWM2cjs.v.type.body.size,"data-cui-fg":no,"data-cui-figure-type":"body","data-testid":`${c}-name`,children:d}),f.map((k,$)=>_jsxruntime.jsx.call(void 0, "text",{x:x.insetPx,y:x.notesPx[$],fontSize:_chunkRYHSVWM2cjs.v.type.caption.size,"data-cui-fg":k.fg,"data-cui-figure-type":"caption","data-testid":`${c}-note-${$}`,children:k.text},$))]}),E=_jsxruntime.jsx.call(void 0, "rect",{className:"cui-figure-ring",x:-_chunkRYHSVWM2cjs.M,y:-_chunkRYHSVWM2cjs.M,width:o.widthPx+2*_chunkRYHSVWM2cjs.M,height:T.heightPx+2*_chunkRYHSVWM2cjs.M,rx:_chunkRYHSVWM2cjs.v.radius["radius-item"]+_chunkRYHSVWM2cjs.M,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}else{let T=on(c,()=>_chunkRYHSVWM2cjs.K.call(void 0, d,o.radiusPx));R={width:2*o.radiusPx,height:2*o.radiusPx,left:r-o.radiusPx,top:a-o.radiusPx},p=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "g",{"data-cui-surface":m.face,children:_jsxruntime.jsx.call(void 0, "circle",{className:"cui-figure-plate",r:o.radiusPx,"data-cui-fill":m.face,"data-cui-stroke":m.line,"data-testid":`${c}-plate`})}),d===null?null:_jsxruntime.jsx.call(void 0, "text",{className:"cui-figure-label",x:0,y:T.extentBelowPx-_chunkRYHSVWM2cjs.v.type.caption.lineHeight/2,fontSize:_chunkRYHSVWM2cjs.v.type.caption.size,"data-cui-fg":ro,"data-cui-figure-type":"caption","data-testid":`${c}-name`,children:d})]}),E=_jsxruntime.jsx.call(void 0, "circle",{className:"cui-figure-ring",r:o.radiusPx+_chunkRYHSVWM2cjs.M,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}if(u!==void 0){if(R.width<_chunkRYHSVWM2cjs.s||R.height<_chunkRYHSVWM2cjs.s)throw new RangeError(`${c}: a pressable node must be at least the ${_chunkRYHSVWM2cjs.s} px target: ${R.width} \xD7 ${R.height}`);if(R.left<_chunkRYHSVWM2cjs.L||R.top<_chunkRYHSVWM2cjs.L||R.left+R.width+_chunkRYHSVWM2cjs.L>t.widthPx||R.top+R.height+_chunkRYHSVWM2cjs.L>t.heightPx)throw new RangeError(`${c}: a pressable node must keep ${_chunkRYHSVWM2cjs.L} px to the figure's edge for its focus ring`)}let h=u===void 0?{}:{role:"button",tabIndex:0,"aria-label":u.label,"aria-describedby":u.description===void 0?void 0:n,"aria-expanded":u.expanded,"aria-controls":u.expanded?u.controls:void 0,onClick:T=>{T.currentTarget.focus(),u.onPress()},onKeyDown:T=>{T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),T.repeat||u.onPress())}};return _jsxruntime.jsxs.call(void 0, "g",{className:"cui-figure-node",transform:`translate(${r} ${a})`,"data-cui-tone":s,"data-cui-outline":l,"data-selected":String(i),...h,"data-testid":c,...v(b),children:[y===void 0?null:_jsxruntime.jsx.call(void 0, "title",{children:y}),_optionalChain([u, 'optionalAccess', _15 => _15.description])===void 0?null:_jsxruntime.jsx.call(void 0, "desc",{id:n,"data-testid":`${c}-description`,children:u.description}),u===void 0?null:E,p]})},so= exports.FigureEdge =({d:e,emphasis:t,weight:n,arrow:r,title:a,testId:o,dataAttributes:s})=>{g();let l=ln("FigureEdge");if(!to.includes(n))throw new RangeError(`${o}: an edge's weight must be 1, 2, 3 or 4: ${n}`);return _jsxruntime.jsx.call(void 0, "path",{className:"cui-figure-edge",d:e,markerEnd:r?`url(#${l.arrowIds[t]})`:void 0,"data-cui-stroke":dn[t],"data-cui-weight":n,"data-cui-emphasis":t,"data-testid":o,...v(s),children:a===void 0?null:_jsxruntime.jsx.call(void 0, "title",{children:a})})};var lo={1:"h1",2:"h2",3:"h3"},uo= exports.Heading =({level:e,type:t,testId:n,headingRef:r,children:a})=>{g();let o=lo[e];return _jsxruntime.jsx.call(void 0, o,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":n,ref:r,tabIndex:r===void 0?void 0:-1,children:a})};var po={removed:"danger-tint",added:"success-tint"},yo= exports.InlineChange =({kind:e,testId:t,children:n})=>{if(g(),n==="")throw new RangeError(`${t}: a changed fragment must hold at least one character`);return _jsxruntime.jsx.call(void 0, e==="removed"?"del":"ins",{className:"cui-change","data-cui-change":e,"data-cui-surface":po[e],"data-cui-fg":"fg","data-testid":t,children:n})};var mo={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"}},go={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},rt= exports.Pill =({tone:e,variant:t,testId:n,dataAttributes:r,children:a})=>{g();let o=t==="tint"?mo[e]:{fg:"on-solid",surface:go[e]};return _jsxruntime.jsx.call(void 0, "span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":o.fg,"data-cui-surface":o.surface,"data-cui-type":"caption","data-testid":n,...v(r),children:a})};var ot=({label:e,valueText:t,value:n,max:r,testId:a})=>{g();let o=_react.useId.call(void 0, );if(r!==null){if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Progress maximum must be positive: ${r}`);if(n===null||!(Number.isFinite(n)&&n>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${n}`)}let s=r===null?null:{max:r,now:Math.min(n,r)};return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-progress","data-testid":a,children:[_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg",type:"body",id:o,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":o,"aria-valuetext":t,"aria-valuemin":s===null?void 0:0,"aria-valuemax":_optionalChain([s, 'optionalAccess', _16 => _16.max]),"aria-valuenow":_optionalChain([s, 'optionalAccess', _17 => _17.now]),"data-cui-surface":"sunken","data-cui-indeterminate":s===null,"data-testid":`${a}-bar`,children:_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:s===null?void 0:{inlineSize:`${s.now/s.max*100}%`},"data-testid":`${a}-fill`})}),_jsxruntime.jsx.call(void 0, "div",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-secondary",type:"body",testId:`${a}-value`,children:t})})]})};var To=({title:e,status:t,progress:n,cancel:r,testId:a,children:o})=>_jsxruntime.jsxs.call(void 0, We,{title:e,actions:r===void 0?void 0:_jsxruntime.jsx.call(void 0, I,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${a}-cancel`,children:r.label}),testId:a,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-status`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:`${e} `}),_jsxruntime.jsx.call(void 0, rt,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),n===void 0?null:_jsxruntime.jsx.call(void 0, ot,{...n,testId:`${a}-progress`}),o]});var at=_react.createContext.call(void 0, null),wo="space-2",vo= exports.List =e=>{g();let{gap:t,label:n,id:r,hidden:a,testId:o,children:s}=e;if(n!==void 0&&!_chunkRYHSVWM2cjs.h.call(void 0, n))throw new RangeError(`${o}: a list's label must hold a readable character: ${JSON.stringify(n)}`);let l=e.marker==="none"?void 0:e.type,i=l!==void 0,d=e.marker==="number"||e.marker==="none"&&e.ordered?"ol":"ul";return _jsxruntime.jsx.call(void 0, at.Provider,{value:e.marker,children:_jsxruntime.jsx.call(void 0, d,{className:"cui-list",role:"list","aria-label":n,id:r,hidden:a,"data-cui-gap":i?void 0:t,"data-cui-row-gap":i?t:void 0,"data-cui-column-gap":i?wo:void 0,"data-cui-marker":i?e.marker:void 0,"data-cui-type":l,"data-testid":o,children:s})})},Po= exports.ListItem =({testId:e,dataAttributes:t,children:n})=>{g();let r=_react.useContext.call(void 0, at);if(r===null)throw new Error("ListItem must be rendered inside List, not inside another ListItem");return _jsxruntime.jsx.call(void 0, "li",{className:"cui-list-item","data-testid":e,...v(t),children:_jsxruntime.jsx.call(void 0, "div",{className:"cui-list-body","data-cui-measure":r==="none"?void 0:"reading",children:_jsxruntime.jsx.call(void 0, at.Provider,{value:null,children:n})})})};var yn=e=>[...e.querySelectorAll(de)].filter(t=>{let n=t.closest(ze);return n===null||!e.contains(n)}),Co=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 n=yn(t);if(n.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${n.length} ${de} elements for ${e.count} rows`);return n},ko=(e,t)=>{let n=-1;return e.forEach((r,a)=>{t.has(r)&&(n=a)}),e[n+1]},Lo= exports.LoadMore =({onLoad:e,busy:t,done:n,failure:r,limit:a,rows:o,testId:s})=>{let{formatLocale:l,labels:i}=C(),d=_react.useRef.call(void 0, null),y=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null),c=_react.useRef.call(void 0, !1),b=()=>{let p=o.ref.current;d.current={shown:new Set(p===null?[]:yn(p)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};_react.useLayoutEffect.call(void 0, ()=>{let p=c.current;c.current=!1;let E=d.current;if(E===null)return;let h=Co(o);if(t){E.busySeen=!0,E.shown=new Set(h);return}let T=ko(h,E.shown),x=r!==null&&r.occurrence!==E.failureOccurrence;if(!(E.busySeen||T!==void 0||x||n)||(d.current=null,x||T===void 0))return;let k=[null,document.body].includes(document.activeElement);(u.current!==null&&document.activeElement===u.current||p&&k)&&T.focus()});let f=le(()=>n?y.current:u.current),m=_react.useCallback.call(void 0, (p=>{u.current=p;let E=f(p);return()=>{u.current=null,c.current=p===document.activeElement,E()}}),[f]),R=_react.useCallback.call(void 0, (p=>{y.current=p;let E=f(p);return()=>{y.current=null,E()}}),[f]);return n?_jsxruntime.jsx.call(void 0, "div",{className:"cui-load-more","data-testid":s,children:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:R,testId:`${s}-end`,children:i.endOfRecords})}):_jsxruntime.jsxs.call(void 0, "div",{className:"cui-load-more","data-testid":s,children:[_jsxruntime.jsx.call(void 0, I,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:b,ref:m,testId:`${s}-button`,children:i.loadMore(_chunkRYHSVWM2cjs.c.call(void 0, a,l))}),r===null?null:_jsxruntime.jsx.call(void 0, ce,{occurrence:r.occurrence,testId:`${s}-failure`,children:i.loadFailed(r.reason)})]})};var Mo=({master:e,detail:t,masterMinPx:n,detailMinPx:r,testId:a})=>{g();let o=_chunkRYHSVWM2cjs.Q.call(void 0, {masterMinPx:n,detailMinPx:r,gapPx:_chunkRYHSVWM2cjs.v.space["space-6"]});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":a,children:[_jsxruntime.jsx.call(void 0, Q,{ruleKey:o.key,css:o.css}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-master-detail","data-cui-master-detail":o.key,children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${a}-master`,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${a}-detail`,children:t})]})]})};var Ne=e=>{let{formatLocale:t,labels:n}=C(),{testId:r}=e;if(e.keep===void 0){let{value:s,unit:l}=e;if(l!==void 0&&!_chunkRYHSVWM2cjs.h.call(void 0, l))throw new RangeError(`${r}: a unit must hold a readable character: ${JSON.stringify(l)}`);if(s===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-testid":r,children:n.unmeasured});let i=_chunkRYHSVWM2cjs.c.call(void 0, s,t);return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-testid":r,children:_chunkRYHSVWM2cjs.e.call(void 0, i,l)})}let{text:a,keep:o}=e;if(a===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-cui-keep":o,"data-testid":r,children:n.unmeasured});if(!_chunkRYHSVWM2cjs.h.call(void 0, a))throw new RangeError(`${r}: a measured text must hold a readable character (pass null when the value was not measured): ${JSON.stringify(a)}`);return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-cui-keep":o,"data-testid":r,children:a})};var Io=({label:e,value:t,min:n,max:r,valueText:a,testId:o})=>{if(g(),!(Number.isFinite(n)&&Number.isFinite(r)&&n<r))throw new RangeError(`Meter needs a finite range with min below max: min ${n}, max ${r}`);if(!(Number.isFinite(t)&&t>=n&&t<=r))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${n}, max ${r}`);return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-meter","data-testid":o,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":t,"aria-valuetext":a,"data-cui-surface":"sunken","data-testid":`${o}-bar`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-n)/(r-n)*100}%`},"data-testid":`${o}-fill`})}),_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{fg:"fg",type:"body",testId:`${o}-value`,children:a})})]})};var Do={ArrowLeft:-1,ArrowRight:1},Ho= exports.PanelTabs =({label:e,items:t,value:n,onValueChange:r,testId:a,panelDescribedBy:o,children:s})=>{g();let l=_react.useId.call(void 0, ),i=_react.useRef.call(void 0, new Map);if(t.length===0)throw new RangeError("PanelTabs needs at least one tab");let d=t.map(m=>m.id);if(new Set(d).size!==d.length)throw new RangeError(`Tab keys must be unique: ${d.join(", ")}`);let y=d.indexOf(n);if(y<0)throw new RangeError(`The selected tab "${n}" is not one of the tabs: ${d.join(", ")}`);let u=m=>`${l}-tab-${m}`,c=`${l}-panel`,b=m=>{let R=t[m];R.id!==n&&r(R.id),_optionalChain([i, 'access', _18 => _18.current, 'access', _19 => _19.get, 'call', _20 => _20(R.id), 'optionalAccess', _21 => _21.focus, 'call', _22 => _22()])};return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-panel-tabs","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-tabs-list",role:"tablist","aria-label":e,onKeyDown:m=>{let R=t.findIndex(T=>i.current.get(T.id)===m.target),p=R<0?y:R,E=Do[m.key],h;if(E!==void 0){let T=getComputedStyle(m.currentTarget).direction==="rtl"?-E:E;h=(p+T+t.length)%t.length}else if(m.key==="Home")h=0;else if(m.key==="End")h=t.length-1;else return;m.preventDefault(),b(h)},children:t.map((m,R)=>{let p=R===y;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-tab cui-panel-tab",type:"button",role:"tab",id:u(R),"aria-selected":p,"aria-controls":c,tabIndex:p?0:-1,"data-cui-fg":p?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${m.id}`,ref:E=>{E===null?i.current.delete(m.id):i.current.set(m.id,E)},onClick:()=>b(R),children:m.label},m.id)})}),_jsxruntime.jsx.call(void 0, "div",{role:"tabpanel",id:c,"aria-labelledby":u(y),"aria-describedby":o,"data-testid":`${a}-panel`,children:s})]})};var Uo=({failure:e,onReload:t,deniedSentence:n,failureMessage:r,rescueRef:a,testId:o})=>{let{labels:s}=C(),l=_jsxruntime.jsx.call(void 0, et,{failure:e,place:"read",deniedSentence:n,failed:r===void 0?s.loadFailed:r,retry:t,testId:`${o}-alert`});return e.status!==null&&_authcore.accessFailureKindOfStatus.call(void 0, e.status)!==null?_jsxruntime.jsx.call(void 0, "div",{className:"cui-resource-failed",ref:a,"data-testid":o,children:l},e.occurrence):_jsxruntime.jsxs.call(void 0, "div",{className:"cui-resource-failed","data-testid":o,children:[l,_jsxruntime.jsx.call(void 0, I,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:a,testId:`${o}-reload`,children:s.reload})]})};var qo=({label:e,options:t,value:n,onValueChange:r,testId:a,density:o="regular"})=>{g();let s=_react.useId.call(void 0, ),l=new Set(t.map(i=>i.value));if(t.length<2||l.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(i=>i.value).join(", ")}`);if(!l.has(n))throw new RangeError(`The pressed value "${n}" is not one of the options: ${[...l].join(", ")}`);if(o!=="regular"&&o!=="compact")throw new RangeError(`A segmented control's density is "regular" or "compact", not ${JSON.stringify(o)}`);return o==="compact"?_jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-segmented-group","aria-labelledby":s,"data-cui-density":"compact","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-segmented-label",id:s,"data-cui-type":"caption",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===n;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-segment",type:"button","aria-pressed":d,"data-testid":`${a}-${i.value}`,onClick:()=>{d||r(i.value)},children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-segment-face","data-cui-fg":d?"on-solid":"fg","data-cui-surface":d?"info-solid":void 0,"data-cui-type":"caption","data-testid":`${a}-${i.value}-face`,children:i.label})},i.value)})})]}):_jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-segmented-group","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===n;return _jsxruntime.jsx.call(void 0, "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":`${a}-${i.value}`,onClick:()=>{d||r(i.value)},children:i.label},i.value)})})]})};var gn=e=>{let t=_react.useRef.call(void 0, null),n=_react.useCallback.call(void 0, r=>{if(t.current=r,typeof e=="function")return e(r);e!=null&&(e.current=r)},[e]);return{row:t,bindRow:n}},bn= exports.RowButton =({selected:e,controls:t,onSelect:n,testId:r,dataAttributes:a,ref:o,keyShortcuts:s,children:l})=>{g();let{row:i,bindRow:d}=gn(o);D(i,{testId:r,part:"row",host:"button"});let y=u=>{ae(u),n()};return _jsxruntime.jsx.call(void 0, "button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"aria-keyshortcuts":B(s,r),"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:y,ref:d,...v(a),children:l})},Wo= exports.RowLink =({href:e,current:t,onNavigate:n,testId:r,dataAttributes:a,ref:o,keyShortcuts:s,children:l})=>{g();let{row:i,bindRow:d}=gn(o);D(i,{testId:r,part:"row",host:"link"});let y=u=>{ae(u),Z(u,e,n)};return _jsxruntime.jsx.call(void 0, "a",{className:"cui-row-link",href:e,"aria-current":t?"page":void 0,"aria-keyshortcuts":B(s,r),"data-cui-row-focus":"","data-cui-surface":t?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:y,ref:d,...v(a),children:l})},zo= exports.SelectableList =({label:e,items:t,itemKey:n,selectedKey:r,onSelect:a,detailId:o,renderRow:s,rowTestId:l,rowData:i,empty:d,testId:y,ref:u})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-selectable","data-testid":y,ref:u,children:t.length===0?_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"prose",testId:`${y}-empty`,children:d}):_jsxruntime.jsx.call(void 0, "ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(c=>{let b=n(c);return _jsxruntime.jsx.call(void 0, "li",{children:_jsxruntime.jsx.call(void 0, bn,{selected:b===r,controls:o,onSelect:()=>a(c),testId:l,dataAttributes:_optionalChain([i, 'optionalCall', _23 => _23(c)]),children:s(c)})},b)})})}));var jo=({label:e,value:t,min:n,max:r,step:a,valueText:o,onValueChange:s,testId:l})=>{g();let i=_react.useId.call(void 0, );if(!([t,n,r,a].every(Number.isFinite)&&n<r&&a>0&&n<=t&&t<=r))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${n}, max ${r}, step ${a}`);let d=o(t);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-testid":`${l}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:i,"data-cui-type":"body",children:e}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-slider",children:[_jsxruntime.jsx.call(void 0, "input",{className:"cui-slider-input",id:i,type:"range",min:n,max:r,step:a,value:t,"aria-valuetext":d,"data-testid":l,onChange:y=>s(y.currentTarget.valueAsNumber)}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-slider-value","aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{fg:"fg",type:"body",testId:`${l}-value`,children:d})})]})]})};var Rn={done:0,current:1,pending:2},Xo={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Yo= exports.Stepper =({label:e,steps:t,testId:n})=>{let{labels:r}=C();if(t.length===0||new Set(t.map(o=>o.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(o=>o.id).join(", ")}`);if(t.filter(o=>o.state==="current").length>1||t.some((o,s)=>s>0&&Rn[o.state]<Rn[t[s-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(o=>o.state).join(", ")}`);let a={done:r.stepDone,current:null,pending:r.stepPending};return _jsxruntime.jsx.call(void 0, "ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":n,children:t.map((o,s)=>{let l=Xo[o.state],i=a[o.state];return _jsxruntime.jsxs.call(void 0, "li",{className:"cui-step","aria-current":o.state==="current"?"step":void 0,"data-cui-step":o.state,"data-testid":`${n}-${o.id}`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":l.fg,"data-cui-surface":l.surface,"data-cui-type":"caption",children:o.state==="done"?"\u2713":s+1}),_jsxruntime.jsxs.call(void 0, "span",{className:"cui-step-label","data-cui-fg":"fg",children:[o.label,i===null?null:_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:` (${i})`})]})]},o.id)})})};var ea=({label:e,labelHidden:t,checked:n,onCheckedChange:r,unavailable:a,testId:o,ref:s,dataAttributes:l})=>{g();let i=_react.useId.call(void 0, ),d=_react.useRef.call(void 0, null);D(d,{testId:o,part:"label",host:"button"});let y=Y(a,i),u=a!==void 0,c=_jsxruntime.jsxs.call(void 0, "button",{className:"cui-switch",type:"button",role:"switch","aria-checked":n,"aria-disabled":u?!0:void 0,"aria-describedby":_(y),"data-cui-fg":"fg","data-cui-type":"body","data-testid":o,ref:s,onClick:()=>{u||r(!n)},...v(l),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":n?"info-solid":"sunken","data-testid":`${o}-track`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-thumb","data-cui-surface":n?"surface":"neutral-solid","data-testid":`${o}-thumb`})}),_jsxruntime.jsx.call(void 0, "span",{className:t===!0?"cui-visually-hidden":void 0,ref:d,children:e})]});return _optionalChain([a, 'optionalAccess', _24 => _24.reason])===void 0?c:_jsxruntime.jsxs.call(void 0, "span",{className:"cui-button-group",children:[c,_jsxruntime.jsx.call(void 0, P,{fg:"fg-muted",type:"body",id:i,testId:`${o}-reason`,children:a.reason})]})};var aa=({label:e,items:t,currentId:n,onNavigate:r,testId:a,collapsible:o=!1})=>{if(g(),t.length===0)throw new RangeError("Tabs needs at least one tab");let s=new Set(t.map(f=>f.id));if(s.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(f=>f.id).join(", ")}`);let l=t.find(f=>f.id===n);if(l===void 0)throw new RangeError(`The current tab "${n}" is not one of the tabs: ${[...s].join(", ")}`);let[i,d]=_react.useState.call(void 0, !1),y=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null),c=_react.useId.call(void 0, ),b=_react.useCallback.call(void 0, f=>{d(!1),f&&_optionalChain([y, 'access', _25 => _25.current, 'optionalAccess', _26 => _26.contains, 'call', _27 => _27(document.activeElement)])&&_optionalChain([u, 'access', _28 => _28.current, 'optionalAccess', _29 => _29.focus, 'call', _30 => _30()])},[]);return _react.useEffect.call(void 0, ()=>{if(!(o&&i))return;let f=p=>y.current!==null&&!y.current.contains(p),m=p=>{f(p.target)&&b(!0)},R=p=>{f(p.target)&&b(!1)};return document.addEventListener("pointerdown",m,!0),document.addEventListener("focusin",R,!0),()=>{document.removeEventListener("pointerdown",m,!0),document.removeEventListener("focusin",R,!0)}},[o,i,b]),_jsxruntime.jsxs.call(void 0, "nav",{ref:y,className:"cui-tabs","aria-label":e,"data-testid":a,"data-cui-collapsible":o?"":void 0,"data-cui-open":o&&i?"":void 0,onKeyDown:o&&i?f=>q(f,()=>b(!0)):void 0,children:[o?_jsxruntime.jsxs.call(void 0, "button",{ref:u,type:"button",className:"cui-tabs-summary","aria-expanded":i,"aria-controls":c,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${a}-summary`,onClick:()=>d(f=>!f),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-tabs-summary-label",children:l.label}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-tabs-summary-marker","aria-hidden":"true",children:i?"\u25B4":"\u25BE"})]}):null,_jsxruntime.jsx.call(void 0, "ul",{className:"cui-tabs-list",id:c,role:"list","data-cui-surface":o?"surface":void 0,children:t.map(f=>{let m=f.id===n;return _jsxruntime.jsx.call(void 0, "li",{className:"cui-tabs-item",children:_jsxruntime.jsx.call(void 0, "a",{className:"cui-tab",href:f.href,"aria-current":m?"page":void 0,"data-cui-fg":m?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${f.id}`,onClick:R=>{Z(R,f.href,r),R.defaultPrevented&&b(!1)},children:f.label})},f.id)})})]})};var la={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},ua= exports.MetricTile =e=>{g();let{label:t,sublabel:n,tone:r,testId:a,dataAttributes:o}=e;if((e.text===void 0?e.value===null:e.text===null)&&r!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${r}`);let l=`${a}-value`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":a,...v(o),children:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-label","data-cui-type":"caption","data-cui-measure":"reading",children:t}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption","data-cui-measure":"reading",children:n}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-value","data-cui-fg":la[r],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?_jsxruntime.jsx.call(void 0, Ne,{value:e.value,unit:e.unit,testId:l}):_jsxruntime.jsx.call(void 0, Ne,{text:e.text,keep:"wrap",testId:l})})]})},vn=e=>_react.Children.toArray(e).flatMap(t=>{if(!_react.isValidElement.call(void 0, t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===_react.Fragment?vn(t.props.children):[t]}),ca= exports.TileGrid =({count:e,minInlinePx:t,testId:n,children:r})=>{g();let a=_chunkRYHSVWM2cjs.T.call(void 0, e,t,_chunkRYHSVWM2cjs.v.space["space-2"]),o=vn(r).length;if(o!==e)throw new RangeError(`TileGrid has ${o} tiles but count is ${e}`);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":n,children:[_jsxruntime.jsx.call(void 0, Q,{ruleKey:a.key,css:a.css}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-tile-grid","data-cui-tile-grid":a.key,"data-cui-gap":"space-2",children:r})]})};var Se=e=>[...e.querySelectorAll("button")],ya= exports.Toolbar =({label:e,testId:t,children:n})=>{g();let r=_react.useRef.call(void 0, null),a=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{let i=Se(r.current),d=a.current!==null&&i.includes(a.current)?a.current:_nullishCoalesce(i[0], () => (null));a.current=d;for(let y of i)y.tabIndex=y===d?0:-1});let o=i=>{for(let d of Se(r.current))d.tabIndex=d===i?0:-1;a.current=i};return _jsxruntime.jsx.call(void 0, "div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:r,onFocus:i=>{let d=Se(i.currentTarget).find(y=>y.contains(i.target));d!==void 0&&o(d)},onKeyDown:i=>{let d=Se(i.currentTarget),y=d.indexOf(i.target);if(y===-1)return;let u=getComputedStyle(i.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",c=u==="ArrowRight"?"ArrowLeft":"ArrowRight",f={[u]:(y+1)%d.length,[c]:(y-1+d.length)%d.length,Home:0,End:d.length-1}[i.key];if(f===void 0)return;i.preventDefault();let m=d[f];o(m),m.focus()},children:n})};var ga=e=>{let[t,n]=_react.useState.call(void 0, {failure:null,count:0});return e!==null&&e!==t.failure?(n({failure:e,count:t.count+1}),t.count+1):t.count};var Cn=e=>e===null?_chunkRYHSVWM2cjs.X:_chunkRYHSVWM2cjs.Y,Ie=(e,t,n,r,a)=>{let[o,s]=_react.useState.call(void 0, ()=>({key:e,state:Cn(e)})),[l,i]=_react.useState.call(void 0, 0),[d,y]=_react.useState.call(void 0, 0),u=_react.useRef.call(void 0, t),c=_react.useRef.call(void 0, null),b=_react.useRef.call(void 0, l);_react.useLayoutEffect.call(void 0, ()=>{u.current=t}),_react.useEffect.call(void 0, ()=>{if(e===null){s({key:null,state:_chunkRYHSVWM2cjs.X});return}let h=new AbortController;c.current=e;let T=l===b.current?"revision":"reload";return b.current=l,s(x=>Object.is(x.key,e)?{key:e,state:r(x.state,T)}:{key:e,state:_chunkRYHSVWM2cjs.Y}),u.current(h.signal).then(x=>{h.signal.aborted||(c.current=null,s(k=>({key:e,state:a(k.state,x)})))},x=>{h.signal.aborted||s(()=>{throw x})}),()=>{h.abort(),c.current=null}},[e,n,l,d]);let f=_react.useCallback.call(void 0, ()=>i(h=>h+1),[]),m=_react.useCallback.call(void 0, ()=>y(h=>h+1),[]),R=_react.useCallback.call(void 0, (h,T)=>{s(x=>Object.is(x.key,h)?{key:h,state:T(x.state)}:x)},[]),p=_react.useCallback.call(void 0, (h,T)=>{R(h,T),Object.is(c.current,h)&&m()},[R,m]);return{state:Object.is(o.key,e)?o.state:Cn(e),reload:f,refresh:m,update:R,write:p}};var Ta=(e,t,n)=>{let r=_react.useRef.call(void 0, t);_react.useLayoutEffect.call(void 0, ()=>{r.current=t});let a=_react.useCallback.call(void 0, p=>r.current.first(p),[]),{state:o,reload:s,refresh:l,update:i,write:d}=Ie(e,a,n,_chunkRYHSVWM2cjs.$,_chunkRYHSVWM2cjs.aa),y=_react.useRef.call(void 0, {key:e,state:o});_react.useLayoutEffect.call(void 0, ()=>{y.current={key:e,state:o}});let u=_react.useRef.call(void 0, null),c=_react.useCallback.call(void 0, ()=>{_optionalChain([u, 'access', _31 => _31.current, 'optionalAccess', _32 => _32.controller, 'access', _33 => _33.abort, 'call', _34 => _34()]),u.current=null},[]);_react.useEffect.call(void 0, ()=>c,[e,n,c]);let b=_react.useCallback.call(void 0, ()=>{c(),s()},[c,s]),f=_react.useCallback.call(void 0, ()=>{c(),l()},[c,l]),m=_react.useCallback.call(void 0, ()=>{let{key:p,state:E}=y.current;if(p===null||E.kind!=="ready"||E.refreshing||E.value.next===null||E.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 h=E.value.next,T={key:p,controller:new AbortController,maps:[]};u.current=T,i(p,_chunkRYHSVWM2cjs.ba),r.current.next(h,T.controller.signal).then(x=>{u.current===T&&(u.current=null,i(p,k=>T.maps.reduce(($,oe)=>_chunkRYHSVWM2cjs.da.call(void 0, $,oe),_chunkRYHSVWM2cjs.ca.call(void 0, k,h,x))))},x=>{u.current===T&&i(p,()=>{throw x})})},[i]),R=_react.useCallback.call(void 0, (p,E)=>{let h=u.current;h!==null&&Object.is(h.key,p)&&h.maps.push(E),d(p,T=>_chunkRYHSVWM2cjs.da.call(void 0, T,E))},[d]);return{state:o,reload:b,refresh:f,loadMore:m,updateList:R}};var va=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",Pa= exports.usePendingPress =()=>{let[e,t]=_react.useState.call(void 0, null),n=_react.useRef.call(void 0, null),r=_react.useCallback.call(void 0, (a,o)=>{let s=o();if(!va(s))return;let l=Symbol(a);n.current=l,t(a);let i=()=>{n.current===l&&(n.current=null,t(null))};s.then(i,i)},[]);return{pendingKey:e,press:r}};var Ca=(e,t,n)=>{let{state:r,reload:a,refresh:o,write:s}=Ie(e,t,n,_chunkRYHSVWM2cjs.Z,_chunkRYHSVWM2cjs._),l=_react.useCallback.call(void 0, (i,d)=>s(i,y=>_chunkRYHSVWM2cjs._.call(void 0, y,{ok:!0,value:d})),[s]);return{state:r,reload:a,refresh:o,put:l}};var ka=({testId:e,children:t})=>(g(),_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden","data-testid":e,children:t}));exports.ANNOUNCE_SETTLE_MS = ge; exports.AccessFailureNotice = rr; exports.AlertMessage = ce; exports.Breadcrumb = or; exports.Button = I; exports.COMPACT_ROW_PX = _chunkRYHSVWM2cjs.u; exports.CONSOLE_UI_LABEL_CATALOGS = _chunkRYHSVWM2cjs.o; exports.CONTRAST_MINIMUM = _chunkXLOWKWIIcjs.f; exports.CONTRAST_PAIRS = _chunkXLOWKWIIcjs.i; exports.Card = We; exports.CardSection = ur; exports.CheckboxGroup = jr; exports.Cluster = Ge; exports.CodeBlock = pr; exports.ComparisonGrid = mr; exports.ConsoleUiRoot = Hn; exports.DataTable = Lr; exports.DescriptionList = Sr; exports.Dialog = Ar; exports.Disclosure = Or; exports.FIGURE_RING_REACH_PX = _chunkRYHSVWM2cjs.L; exports.FLEXIBLE_COLUMN_MIN_PX = _chunkRYHSVWM2cjs.C; exports.FailureMessage = et; exports.Field = qr; exports.Figure = oo; exports.FigureEdge = so; exports.FigureNode = io; exports.FragmentLink = Xn; exports.HTTP_FORBIDDEN = _chunkRYHSVWM2cjs.U; exports.Heading = uo; exports.InlineChange = yo; exports.JobCard = To; exports.LATTICE_PX = _chunkRYHSVWM2cjs.q; exports.Link = Jn; exports.List = vo; exports.ListItem = Po; exports.LoadMore = Lo; exports.MORE_CONTRAST_MINIMUM = _chunkXLOWKWIIcjs.g; exports.MasterDetail = Mo; exports.Measured = Ne; exports.Meter = Io; exports.MetricTile = ua; exports.Notice = Kr; exports.PanelTabs = Ho; exports.PasswordInput = Vr; exports.Pill = rt; exports.ProgressBar = ot; exports.ROW_WITH_CONTROL_PX = _chunkRYHSVWM2cjs.t; exports.RadioGroup = Jr; exports.ResourceFailed = Uo; exports.RowButton = bn; exports.RowLink = Wo; exports.SegmentedControl = qo; exports.Select = zr; exports.SelectableList = zo; exports.Slider = jo; exports.Stack = Zn; exports.Stepper = Yo; exports.Switch = ea; exports.TARGET_PX = _chunkRYHSVWM2cjs.s; exports.TOKENS = _chunkRYHSVWM2cjs.v; exports.TONES = _chunkRYHSVWM2cjs.ia; exports.TONE_HUES = _chunkRYHSVWM2cjs.ga; exports.TONE_ROLES = _chunkRYHSVWM2cjs.ha; exports.Tabs = aa; exports.Text = P; exports.TextArea = Wr; exports.TextInput = Gr; exports.TileGrid = ca; exports.Toolbar = ya; exports.VisuallyHidden = ka; exports.ZonedTimeError = _chunkRYHSVWM2cjs.i; exports.beginPage = _chunkRYHSVWM2cjs.ba; exports.beginPagedReload = _chunkRYHSVWM2cjs.$; exports.beginReload = _chunkRYHSVWM2cjs.Z; exports.ceil8 = _chunkRYHSVWM2cjs.z; exports.ceilToLattice = _chunkRYHSVWM2cjs.r; exports.cellContentInlinePx = _chunkRYHSVWM2cjs.A; exports.comparisonAttributePx = _chunkRYHSVWM2cjs.D; exports.contrastRatio = _chunkXLOWKWIIcjs.e; exports.countSampleText = _chunkRYHSVWM2cjs.F; exports.cssVar = _chunkRYHSVWM2cjs.w; exports.figureBoxPlan = _chunkRYHSVWM2cjs.I; exports.figureDiscLabelPlan = _chunkRYHSVWM2cjs.K; exports.fillLabel = _chunkRYHSVWM2cjs.m; exports.fixedColumnPx = _chunkRYHSVWM2cjs.B; exports.flatMapOutcome = _chunkRYHSVWM2cjs.W; exports.formatByteSize = _chunkRYHSVWM2cjs.d; exports.formatCount = _chunkRYHSVWM2cjs.c; exports.formatInstant = _chunkRYHSVWM2cjs.l; exports.goldenSectionPx = _chunkRYHSVWM2cjs.N; exports.hexToSrgb = _chunkXLOWKWIIcjs.a; exports.instantSampleText = _chunkRYHSVWM2cjs.E; exports.isReadableText = _chunkRYHSVWM2cjs.h; exports.keepLastGood = _chunkRYHSVWM2cjs._; exports.lightDark = _chunkRYHSVWM2cjs.ea; exports.mapOutcome = _chunkRYHSVWM2cjs.V; exports.mapPagedList = _chunkRYHSVWM2cjs.da; exports.masterDetailPlan = _chunkRYHSVWM2cjs.P; exports.monoTextWidthEm = _chunkRYHSVWM2cjs.y; exports.placeholderRule = _chunkRYHSVWM2cjs.fa; exports.pxToRem = _chunkRYHSVWM2cjs.O; exports.readDecimalText = _chunkRYHSVWM2cjs.f; exports.readIntegerText = _chunkRYHSVWM2cjs.g; exports.reasonAside = _chunkRYHSVWM2cjs.n; exports.resolveConsoleUiLabels = _chunkRYHSVWM2cjs.p; exports.settleFirstPage = _chunkRYHSVWM2cjs.aa; exports.settlePage = _chunkRYHSVWM2cjs.ca; exports.spacedTextWidthEm = _chunkRYHSVWM2cjs.H; exports.tableFrameMinInlinePx = _chunkRYHSVWM2cjs.S; exports.tableMinInlinePx = _chunkRYHSVWM2cjs.R; exports.textWidthEm = _chunkRYHSVWM2cjs.x; exports.tileGridPlan = _chunkRYHSVWM2cjs.T; exports.tileMinInlinePx = _chunkRYHSVWM2cjs.G; exports.toOffsetIso = _chunkRYHSVWM2cjs.j; exports.toWallTime = _chunkRYHSVWM2cjs.k; exports.topmostModalOf = _chunkRYHSVWM2cjs.b; exports.useAccessFailure = On; exports.useAnnounce = Be; exports.useConsoleUi = C; exports.useEscapeToClose = dr; exports.useFailureOccurrence = ga; exports.useFocusRescue = le; exports.usePagedResource = Ta; exports.usePendingPress = Pa; exports.useResource = Ca;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkRYHSVWM2cjs = require('./chunk-RYHSVWM2.cjs');var _chunkXLOWKWIIcjs = require('./chunk-XLOWKWII.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var Ke=_react.createContext.call(void 0, null),Dt=" ",It='[inert], [aria-hidden="true" i]',Ue="data-cui-dialog-announcer",In=`:scope > [${Ue}]`,$n=e=>{if(e.closest(It)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=_chunkRYHSVWM2cjs.b.call(void 0, e.ownerDocument);if(t.kind==="none")return{region:e};if(t.kind==="undecidable")return{hidden:"focus is in no open modal dialog and they do not nest, so which one is topmost cannot be told"};let n=t.dialog;if(n.contains(e))return{region:e};let r=n.querySelector(In);return r===null?{hidden:"the topmost open modal dialog neither contains the console nor is a Dialog"}:r.closest(It)!==null?{hidden:'the topmost open modal dialog is a Dialog whose live region has an inert or aria-hidden="true" ancestor'}:{region:r}},Fn=e=>{try{e.querySelectorAll(_chunkRYHSVWM2cjs.a)}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}},ge= exports.ANNOUNCE_SETTLE_MS =150,An=1e3,$t=new WeakMap,Dn=(e,t)=>{let n=_nullishCoalesce($t.get(e), () => (new Set)),r={text:t};$t.set(e,n.add(r)),setTimeout(()=>n.delete(r),ge);let a=e.ownerDocument.createElement("span");a.textContent=[...n].map(o=>o.text).join(Dt),e.replaceChildren(a)},Hn= exports.ConsoleUiRoot =({locale:e,formatLocale:t,timeZone:n,accessFailure:r,contrast:a="standard",reducedMotion:o=!1,testId:s,children:l})=>{if(_react.useContext.call(void 0, Ke)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");if(typeof r!="function")throw new TypeError("ConsoleUiRoot: accessFailure must be the host's presenter of access failures (a function)");if(!_chunkXLOWKWIIcjs.h.includes(a))throw new RangeError(`ConsoleUiRoot: contrast must be one of ${_chunkXLOWKWIIcjs.h.join(", ")}: ${String(a)}`);if(typeof o!="boolean")throw new TypeError(`ConsoleUiRoot: reducedMotion must be a boolean: ${String(o)}`);let d=_chunkRYHSVWM2cjs.p.call(void 0, e),[y]=Intl.getCanonicalLocales(t),u=_react.useMemo.call(void 0, ()=>new Intl.DateTimeFormat(y,{timeZone:n}).resolvedOptions().timeZone,[y,n]),c=_react.useRef.call(void 0, null),b=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{Fn(c.current.ownerDocument)},[]);let f=_react.useCallback.call(void 0, R=>{if(R.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let p=()=>{let{texts:h,settle:T,deadline:v}=b.current;b.current=null,clearTimeout(T),clearTimeout(v);let k=c.current;if(k===null)return;let $=h.join(Dt),oe=$n(k);if("hidden"in oe)throw new Error(`announce: the live region is hidden from assistive technology (${oe.hidden}), so this announcement would be lost: ${$}`);Dn(oe.region,$)},E=b.current;if(E===null){b.current={texts:[R],settle:setTimeout(p,ge),deadline:setTimeout(p,An)};return}E.texts.push(R),clearTimeout(E.settle),E.settle=setTimeout(p,ge)},[]),m=_react.useMemo.call(void 0, ()=>({locale:e,formatLocale:y,timeZone:u,labels:d,announce:f,accessFailure:r}),[e,y,u,d,f,r]);return _jsxruntime.jsx.call(void 0, Ke.Provider,{value:m,children:_jsxruntime.jsxs.call(void 0, "div",{"data-cui-root":"","data-cui-contrast":a,"data-cui-reduced-motion":o?"":void 0,"data-cui-surface":"surface","data-cui-fg":"fg","data-testid":s,children:[l,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${s}-announcer`,ref:c})]})})},C= exports.useConsoleUi =()=>{let e=_react.useContext.call(void 0, Ke);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},g=()=>{C()},Be= exports.useAnnounce =()=>C().announce,On= exports.useAccessFailure =()=>C().accessFailure;var w=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};var ae=e=>{let t=e.currentTarget;t.ownerDocument.activeElement!==t&&t.focus({preventScroll:!0})};var B=(e,t)=>{if(e!==void 0&&e.trim()==="")throw new RangeError(`${t}: the key shortcuts must name at least one shortcut, not a blank text: "${e}"`);return e};var Bn=new Set(["abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","mark","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr"]),_n=e=>{for(let t of e.querySelectorAll("*")){let n=t.localName;if(!Bn.has(n)||t.hasAttribute("tabindex")||t.hasAttribute("contenteditable"))return n}return null},D=(e,{testId:t,part:n,host:r})=>{_react.useLayoutEffect.call(void 0, ()=>{let a=_n(e.current);if(a!==null)throw new RangeError(`${t}: the ${n} is the content of a ${r} and holds only non-interactive phrasing content, not <${a}>`)})};var P=({fg:e,type:t,face:n,as:r="span",space:a,testId:o,id:s,tabIndex:l,ref:i,children:d})=>(g(),_jsxruntime.jsx.call(void 0, r,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":n,"data-cui-space":a,"data-cui-measure":r==="p"?"reading":void 0,"data-testid":o,id:s,tabIndex:l,ref:i,children:d}));var Gn=/\s/,_e=(e,t)=>{if(e===""||Gn.test(e))throw new RangeError(`The id of ${t} must be one token without whitespace: "${e}"`);return e},Y=(e,t)=>{if(e!==void 0){if(e.reason!==void 0){if(e.reason.trim()==="")throw new RangeError("An unavailable control needs a reason that is not blank");return t}return _e(e.reasonId,"an unavailable control's reason")}},_=(...e)=>{let t=e.filter(n=>n!==void 0);return t.length===0?void 0:t.join(" ")};var zn={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"}},qe=({subject:e,children:t})=>{let n=_react.useRef.call(void 0, null);return D(n,e),_jsxruntime.jsx.call(void 0, "span",{ref:n,children:t})},I= exports.Button =({variant:e,children:t,testId:n,type:r="button",onClick:a,unavailable:o,describedBy:s,expanded:l,controls:i,ref:d,dataAttributes:y,keyShortcuts:u,busy:c,busyLabel:b})=>{g();let f=_react.useId.call(void 0, ),m=Y(o,f),R=c===!0||o!==void 0,p=zn[e],E=h=>{if(ae(h),R){h.preventDefault();return}_optionalChain([a, 'optionalCall', _2 => _2(h)])};return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-button-group",children:[_jsxruntime.jsx.call(void 0, "button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":p.fg,"data-cui-surface":p.surface,"data-cui-type":p.type,"data-testid":n,"aria-disabled":R?!0:void 0,"aria-busy":c===!0?!0:void 0,"aria-describedby":_(s,m),"aria-expanded":l,"aria-controls":i,"aria-keyshortcuts":B(u,n),onClick:E,ref:d,...w(y),children:_jsxruntime.jsx.call(void 0, qe,{subject:{testId:n,part:"label",host:"button"},children:c===!0?b:t})}),_optionalChain([o, 'optionalAccess', _3 => _3.reason])===void 0?null:_jsxruntime.jsx.call(void 0, P,{fg:"fg-muted",type:"body",id:f,testId:`${n}-reason`,children:o.reason})]})},Jn= exports.Link =({onNavigate:e,children:t,testId:n,ref:r,keyShortcuts:a})=>(g(),_jsxruntime.jsx.call(void 0, "button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,"aria-keyshortcuts":B(a,n),onClick:e,ref:r,children:_jsxruntime.jsx.call(void 0, qe,{subject:{testId:n,part:"label",host:"button"},children:t})})),jn=/^[^\s#]+$/,Xn= exports.FragmentLink =({targetId:e,children:t,testId:n,onFollow:r,dataAttributes:a,keyShortcuts:o})=>{if(g(),!jn.test(e))throw new RangeError(`A fragment link needs the target's id without "#" or white space: "${e}"`);return _jsxruntime.jsx.call(void 0, "a",{className:"cui-link",href:`#${e}`,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,"aria-keyshortcuts":B(o,n),onClick:r,...w(a),children:_jsxruntime.jsx.call(void 0, qe,{subject:{testId:n,part:"label",host:"link"},children:t})})};var Zn=({gap:e,testId:t,children:n})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:n})),Ge= exports.Cluster =({gap:e,as:t="div",testId:n,children:r})=>(g(),_jsxruntime.jsx.call(void 0, t,{className:"cui-cluster","data-cui-gap":e,"data-testid":n,children:r}));var tr=new Set(["sign-in","sign-in-again","sign-in-again-in-new-window"]),nr=" ",rr= exports.AccessFailureNotice =({view:e,handlers:t,testId:n})=>{let r=Be(),a=e.actions.map(({action:l,label:i})=>{let d=t[l];if(d===void 0)throw new TypeError(`AccessFailureNotice: no handler for the action ${JSON.stringify(l)}`);return{action:l,label:i,handler:d}}),o=e.politeness==="status"?[e.title,...e.sentences].join(nr):null,s=_react.useRef.call(void 0, null);return _react.useEffect.call(void 0, ()=>{o===null||s.current===o||(s.current=o,r(o))},[r,o]),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-access-failure","data-cui-access-failure":e.kind,"data-testid":n,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-notice cui-access-failure-message",role:e.politeness==="alert"?"alert":void 0,"data-cui-tone":"warning","data-cui-surface":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-cui-measure":"reading","data-testid":`${n}-message`,children:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-access-failure-title","data-cui-measure":"reading","data-testid":`${n}-title`,children:e.title}),e.sentences.map(l=>_jsxruntime.jsx.call(void 0, "p",{className:"cui-access-failure-sentence","data-cui-measure":"reading",children:l},l))]}),a.length===0?null:_jsxruntime.jsx.call(void 0, Ge,{gap:"space-2",testId:`${n}-actions`,children:a.map(({action:l,label:i,handler:d})=>_jsxruntime.jsx.call(void 0, I,{variant:tr.has(l)?"primary":"secondary",onClick:d,testId:`${n}-${l}`,children:i},l))})]})};var Z=(e,t,n)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),n(t))};var or=({items:e,current:t,onNavigate:n,testId:r})=>{let{labels:a}=C();if(new Set(e.map(o=>o.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(o=>o.id).join(", ")}`);return _jsxruntime.jsx.call(void 0, "nav",{className:"cui-breadcrumb","aria-label":a.breadcrumb,"data-testid":r,children:_jsxruntime.jsxs.call(void 0, "ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(o=>_jsxruntime.jsxs.call(void 0, "li",{className:"cui-breadcrumb-item",children:[_jsxruntime.jsx.call(void 0, "a",{className:"cui-link",href:o.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${r}-${o.id}`,onClick:s=>Z(s,o.href,n),children:o.label}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},o.id)),_jsxruntime.jsx.call(void 0, "li",{className:"cui-breadcrumb-item",children:_jsxruntime.jsx.call(void 0, "span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${r}-current`,children:t})})]})})};var ir=229,sr=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),he=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&sr.has(e.type)&&(e.value!==""||e.validity.badInput),Ve=e=>e.nativeEvent.isComposing||e.keyCode===ir,q=(e,t)=>{e.key!=="Escape"||e.nativeEvent.defaultPrevented||Ve(e)||he(e.target)||(e.stopPropagation(),t())},dr= exports.useEscapeToClose =e=>_react.useCallback.call(void 0, t=>q(t,e),[e]);var Bt=e=>e===void 0?void 0:t=>q(t,e),We= exports.Card =({id:e,title:t,description:n,actions:r,onEscape:a,testId:o,headingRef:s,ref:l,dataAttributes:i,children:d})=>{g();let y=_react.useId.call(void 0, ),u=Bt(a);return _jsxruntime.jsxs.call(void 0, "section",{className:"cui-card",id:e,"aria-labelledby":y,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:l,onKeyDown:u,...w(i),children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-header",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-heading",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"cui-card-title",id:y,"data-cui-type":"title","data-testid":`${o}-heading`,ref:s,tabIndex:s===void 0?void 0:-1,children:t}),n===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),r===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-actions",children:r})]}),d]})},lr={3:"h3",4:"h4"},ur= exports.CardSection =({id:e,title:t,subtitle:n,level:r=3,region:a=!1,onEscape:o,testId:s,headingRef:l,ref:i,dataAttributes:d,children:y})=>{g();let u=_react.useId.call(void 0, ),c=Bt(o),b=lr[r],f=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-section-heading",children:[_jsxruntime.jsx.call(void 0, b,{className:"cui-card-section-title",id:u,"data-cui-type":"body","data-testid":`${s}-heading`,ref:l,tabIndex:l===void 0?void 0:-1,children:t}),n===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),y]});return a?_jsxruntime.jsx.call(void 0, "section",{className:"cui-card-section",id:e,"aria-labelledby":u,"data-testid":s,ref:i,onKeyDown:c,...w(d),children:f}):_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section",id:e,"data-testid":s,ref:i,...w(d),children:f})};var pr=({label:e,code:t,testId:n})=>(g(),_jsxruntime.jsx.call(void 0, "section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":n,children:_jsxruntime.jsx.call(void 0, "pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${n}-code`,children:t})}));var Q=({ruleKey:e,css:t})=>_jsxruntime.jsx.call(void 0, "style",{href:e,precedence:"cui",children:t});var mr=({caption:e,attributes:t,columns:n,attributePx:r,columnMinPx:a,testId:o})=>{g();let s=_react.useId.call(void 0, );for(let u of[r,a])if(!(Number.isFinite(u)&&u>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${u}`);if(n.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let u of n)for(let c of t)if(!Object.hasOwn(u.cells,c.key))throw new RangeError(`Column "${u.key}" has no value for attribute "${c.key}"`);let l=r+n.length*a,i=`cui-comparison-a${r}-c${a}-n${n.length}`,d=u=>`[data-cui-comparison="${i}"][data-cui-comparison-layout="${u}"]`,y=`${d("table")}{display:none}@container (min-width:${_chunkRYHSVWM2cjs.O.call(void 0, l)}){${d("table")}{display:block}${d("stack")}{display:none}}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-cui-stack-below-px":l,"data-testid":o,children:[_jsxruntime.jsx.call(void 0, Q,{ruleKey:i,css:y}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-frame","data-cui-comparison":i,"data-cui-comparison-layout":"table",children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-comparison-table","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "caption",{className:"cui-visually-hidden",children:e}),_jsxruntime.jsxs.call(void 0, "colgroup",{children:[_jsxruntime.jsx.call(void 0, "col",{style:{width:_chunkRYHSVWM2cjs.O.call(void 0, r)}}),n.map(u=>_jsxruntime.jsx.call(void 0, "col",{},u.key))]}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "td",{}),n.map(u=>_jsxruntime.jsx.call(void 0, "th",{scope:"col",children:u.heading},u.key))]})}),_jsxruntime.jsx.call(void 0, "tbody",{children:t.map(u=>_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "th",{scope:"row",children:u.label}),n.map(c=>_jsxruntime.jsx.call(void 0, "td",{children:c.cells[u.key]("table")},c.key))]},u.key))})]})}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-stack","data-cui-comparison":i,"data-cui-comparison-layout":"stack",children:n.map((u,c)=>{let b=`${s}-column-${c}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-comparison-column",role:"group","aria-labelledby":b,"data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-heading",id:b,children:u.heading}),_jsxruntime.jsx.call(void 0, "dl",{className:"cui-comparison-list",children:t.map(f=>_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "dt",{children:f.label}),_jsxruntime.jsx.call(void 0, "dd",{children:u.cells[f.key]("stack")})]},f.key))})]},u.key)})})]})};var de="[data-cui-row-focus]",ze="[data-cui-row-detail]",gr=e=>e===null?[]:[...e.querySelectorAll(`:scope > ${de}`)],qt=(e,t)=>{let n=new Map;t!==null&&n.set(t,0);let r=-1;for(let a of e===null?[]:e.children)a.matches(de)?(r+=1,n.set(a,r)):r>=0&&a.matches(ze)&&n.set(a,r);return n},Gt=(e,t,n,r)=>{let a=gr(t);if(a.length===0)return n;let o=r.get(e);if(o===void 0)throw new RangeError(`rowFocusTarget: <${e.localName}> left holding focus with no position in the table (only its rows, row details and empty text hold one)`);return a[Math.min(o,a.length-1)]};var Rr=e=>e+1,le= exports.useFocusRescue =e=>{let t=_react.useRef.call(void 0, e),n=_react.useRef.call(void 0, null),r=_react.useRef.call(void 0, !1),[,a]=_react.useReducer.call(void 0, Rr,0),o=_react.useCallback.call(void 0, (s=>()=>{r.current&&s.contains(document.activeElement)&&(n.current=s,a())}),[]);return _react.useLayoutEffect.call(void 0, ()=>(r.current=!0,()=>{r.current=!1,n.current=null}),[]),_react.useLayoutEffect.call(void 0, ()=>{t.current=e}),_react.useLayoutEffect.call(void 0, ()=>{let s=n.current;if(s===null)return;n.current=null;let l=[null,document.body].includes(document.activeElement);s.isConnected||!l||_optionalChain([t, 'access', _4 => _4.current, 'call', _5 => _5(s), 'optionalAccess', _6 => _6.focus, 'call', _7 => _7()])}),o};var xr=new Map,wr='a[href], audio[controls], button, details, embed, iframe, img[usemap], input:not([type="hidden"]), label, select, textarea, video[controls], [tabindex], [contenteditable]',Pr=(e,t,n)=>{_react.useLayoutEffect.call(void 0, ()=>{let r=e.current;if(t!=="row-compact"||r===null)return;let a=[...r.querySelectorAll(wr)].find(o=>o.parentElement!==r);if(a!==void 0)throw new RangeError(`${n}: a compact row holds no control or focus target (a ${_chunkRYHSVWM2cjs.s} px target does not fit its ${_chunkRYHSVWM2cjs.u} px; use row-control), not <${a.localName}>`)})},Nr=(e,t)=>{let n=e.filter(a=>a.rowHeader===!0).map(a=>a.key);if(n.length>1)throw new RangeError(`${t}: a table has at most one row header column, not ${n.length} (${n.join(", ")})`);let r=e.find(a=>a.rowHeader!==!0&&a.rowHeaderNote!==void 0);if(r!==void 0)throw new RangeError(`${t}: a row header note belongs to the row header column, not to ${r.key}`)},Cr=e=>e==null?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-table-header-note",children:e}),kr=(e,t,n,r,a)=>{let o=e.open(t);return _jsxruntime.jsx.call(void 0, "tr",{ref:a,hidden:!o,"data-cui-row-detail":o?"open":"closed","data-testid":`${r}-detail`,children:_jsxruntime.jsx.call(void 0, "td",{colSpan:n,id:e.id(t),children:o?e.render(t):null})})},Lr= exports.DataTable =({caption:e,captionHidden:t,columns:n,rows:r,rowKey:a,rowTestId:o,rowData:s,rowSize:l,rowDetail:i,empty:d,testId:y,ref:u})=>{g();let c=_react.useId.call(void 0, ),b=_react.useRef.call(void 0, null);Pr(b,l,y);let f=_react.useRef.call(void 0, null),m=_react.useRef.call(void 0, xr),R=le(h=>Gt(h,b.current,f.current,m.current));_react.useLayoutEffect.call(void 0, ()=>{m.current=qt(b.current,f.current)});let p=_react.useCallback.call(void 0, h=>{f.current=h;let T=R(h);return()=>{f.current=null,T()}},[R]),E=_chunkRYHSVWM2cjs.R.call(void 0, n);return Nr(n,y),_jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":y,ref:u,children:r.length===0?_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"prose",tabIndex:-1,ref:p,testId:`${y}-empty`,children:d}):_jsxruntime.jsx.call(void 0, "section",{ref:R,className:"cui-table-frame",tabIndex:0,"aria-labelledby":c,"data-testid":`${y}-frame`,children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":l,style:{"--cui-table-min":_chunkRYHSVWM2cjs.O.call(void 0, E)},children:[_jsxruntime.jsx.call(void 0, "caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:c,children:e}),_jsxruntime.jsx.call(void 0, "colgroup",{children:n.map(h=>_jsxruntime.jsx.call(void 0, "col",{style:h.width.fixedPx===void 0?void 0:{width:_chunkRYHSVWM2cjs.O.call(void 0, h.width.fixedPx)}},h.key))}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsx.call(void 0, "tr",{children:n.map(h=>_jsxruntime.jsxs.call(void 0, "th",{scope:"col","data-cui-align":h.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:[h.header,h.note===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-table-header-note",children:h.note})]},h.key))})}),_jsxruntime.jsx.call(void 0, "tbody",{ref:b,children:r.map(h=>_jsxruntime.jsxs.call(void 0, _react.Fragment,{children:[_jsxruntime.jsx.call(void 0, "tr",{ref:R,tabIndex:-1,"data-cui-row-focus":"","data-testid":o,...w(_optionalChain([s, 'optionalCall', _8 => _8(h)])),children:n.map(T=>T.rowHeader===!0?_jsxruntime.jsxs.call(void 0, "th",{scope:"row","data-cui-align":T.align,children:[T.cell(h),T.rowHeaderNote===void 0?null:Cr(T.rowHeaderNote(h))]},T.key):_jsxruntime.jsx.call(void 0, "td",{"data-cui-align":T.align,children:T.cell(h)},T.key))}),i===void 0?null:kr(i,h,n.length,o,R)]},a(h)))})]})})})};var Sr=({items:e,testId:t})=>{if(g(),new Set(e.map(n=>n.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(n=>n.key).join(", ")}`);return _jsxruntime.jsx.call(void 0, "dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(n=>_jsxruntime.jsxs.call(void 0, "div",{className:"cui-description-row","data-testid":`${t}-${n.key}`,children:[_jsxruntime.jsx.call(void 0, "dt",{"data-cui-fg":"fg-secondary",children:n.term}),_jsxruntime.jsx.call(void 0, "dd",{"data-cui-fg":"fg",children:n.description})]},n.key))})};var Jt=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},Ir=(e,t)=>{if(t===null||!e.contains(t))throw new RangeError("A dialog's initial focus must be an element inside the dialog");return t},$r=(e,t)=>{if(t.focus(),e.ownerDocument.activeElement!==t)throw e.close(),new RangeError("A dialog's initial focus must be an element that takes focus")},Fr=e=>e instanceof HTMLInputElement&&e.type==="search",Ar= exports.Dialog =({title:e,description:t,open:n,onClose:r,initialFocus:a,testId:o,children:s})=>{let{labels:l}=C(),i=_react.useId.call(void 0, ),d=_react.useId.call(void 0, ),y=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null),c=_react.useRef.call(void 0, !1);return _react.useLayoutEffect.call(void 0, ()=>{let p=y.current;if(n&&!p.open){let E=a===void 0?null:Ir(p,a.current);u.current=p.ownerDocument.activeElement,p.showModal(),E!==null&&$r(p,E)}else!n&&p.open&&p.close()},[n,a]),_react.useLayoutEffect.call(void 0, ()=>{let p=y.current;return()=>{p.open&&(p.close(),Jt(u.current),u.current=null)}},[]),_jsxruntime.jsxs.call(void 0, "dialog",{className:"cui-dialog","aria-labelledby":i,"aria-describedby":t===void 0?void 0:d,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:y,onClose:p=>{p.currentTarget.open||(Jt(u.current),u.current=null,n&&r())},onCancel:p=>{let E=c.current;c.current=!1,(E||he(p.currentTarget.ownerDocument.activeElement))&&p.preventDefault()},onKeyDownCapture:p=>{let E=Ve(p);c.current=E,p.key==="Escape"&&!E&&he(p.target)&&!Fr(p.target)&&p.preventDefault()},onKeyUpCapture:()=>{c.current=!1},children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-dialog-header",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"cui-dialog-title",id:i,"data-cui-type":"title",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-dialog-actions",children:_jsxruntime.jsx.call(void 0, I,{variant:"secondary",testId:`${o}-close`,onClick:()=>_optionalChain([y, 'access', _9 => _9.current, 'optionalAccess', _10 => _10.close, 'call', _11 => _11()]),children:l.close})})]}),t===void 0?null:_jsxruntime.jsx.call(void 0, "div",{id:d,"data-cui-measure":"reading","data-testid":`${o}-description`,children:t}),s,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[Ue]:"","data-testid":`${o}-announcer`})]})};var Or=({summary:e,open:t,onOpenChange:n,testId:r,children:a})=>{g();let o=_react.useId.call(void 0, ),s=_react.useRef.call(void 0, null);return D(s,{testId:r,part:"summary",host:"button"}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-disclosure","data-testid":r,children:[_jsxruntime.jsxs.call(void 0, "button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":o,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${r}-button`,onClick:()=>n(!t),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),_jsxruntime.jsx.call(void 0, "span",{ref:s,children:e})]}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-disclosure-panel",id:o,hidden:!t,"data-testid":`${r}-panel`,children:a})]})};var _authcore = require('@aiquants/auth-core');var Kr=({tone:e,testId:t,children:n})=>(g(),_jsxruntime.jsx.call(void 0, "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-cui-measure":"reading","data-testid":t,children:n})),ce= exports.AlertMessage =({occurrence:e,testId:t,children:n})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-measure":"reading","data-cui-occurrence":e,"data-testid":t,children:n},e));var et=({failure:e,place:t,deniedSentence:n,failed:r,retry:a,testId:o})=>{let{labels:s,accessFailure:l}=C();if(n.trim()==="")throw new RangeError("FailureMessage: deniedSentence must be a non-empty sentence");let i=e.status===null?null:_authcore.accessFailureKindOfStatus.call(void 0, e.status);return i===null?_jsxruntime.jsx.call(void 0, ce,{occurrence:e.occurrence,testId:o,children:s.failureSentence(e,r)}):_jsxruntime.jsx.call(void 0, _react.Fragment,{children:l({kind:i,place:t,deniedSentence:i==="forbidden"?s.forbiddenBecause(n,e.reason):null,retry:a})},e.occurrence)};var _r=/\s/,tt=e=>{if(e!==void 0&&(typeof e!="string"||e===""||_r.test(e)))throw new RangeError(`A control's name must be one token without whitespace: "${e}"`);return e},Qt=e=>{if(e!==void 0&&!(Number.isInteger(e)&&e>0))throw new RangeError(`A field's maxLength must be a positive integer: ${e}`);return e},te=({description:e,error:t,errorId:n})=>{g();let r=_react.useId.call(void 0, ),a=_react.useId.call(void 0, ),o=_react.useId.call(void 0, ),s=n===void 0?o:_e(n,"a field's error"),l=[e===void 0?null:a,t===void 0?null:s].filter(d=>d!==null).join(" ");return{control:{id:r,"aria-describedby":l===""?void 0:l,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:s}},ne=({description:e,error:t,descriptionId:n,errorId:r,testId:a})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[e===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",id:n,testId:`${a}-description`,children:e}),t===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${a}-error`,children:t})]}),Te=({htmlFor:e,hidden:t,children:n})=>_jsxruntime.jsx.call(void 0, "label",{className:t===!0?"cui-visually-hidden":"cui-field-label",htmlFor:e,"data-cui-type":"body",children:n}),qr= exports.Field =({label:e,description:t,error:n,errorId:r,testId:a,children:o})=>{let{control:s,descriptionId:l,errorId:i}=te({label:e,description:t,error:n,errorId:r});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":a,children:[_jsxruntime.jsx.call(void 0, Te,{htmlFor:s.id,hidden:void 0,children:e}),o(s),_jsxruntime.jsx.call(void 0, ne,{description:t,error:n,descriptionId:l,errorId:i,testId:a})]})},en=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,type:s,name:l,maxLength:i,list:d,autoComplete:y,inputMode:u,prefix:c,labelHidden:b,required:f,testId:m,ref:R})=>{let{control:p,descriptionId:E,errorId:h}=te({label:e,description:t,error:n,errorId:r}),T=_react.useId.call(void 0, );if(c!==void 0&&c.trim()==="")throw new RangeError("An input's prefix must not be blank");if(i!==void 0&&s==="datetime-local")throw new RangeError(`A ${s} input takes no maxLength: ${i}`);let v=s==="password",k=_jsxruntime.jsx.call(void 0, "input",{className:"cui-input",type:s,name:tt(l),maxLength:Qt(i),value:a,list:d,autoComplete:y,inputMode:u,spellCheck:v?!1:void 0,autoCapitalize:v?"none":void 0,required:f,onChange:$=>o($.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":m,ref:R,...p,"aria-describedby":_(c===void 0?void 0:T,p["aria-describedby"])});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${m}-field`,children:[_jsxruntime.jsx.call(void 0, Te,{htmlFor:p.id,hidden:b,children:e}),c===void 0?k:_jsxruntime.jsxs.call(void 0, "div",{className:"cui-input-group",children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-input-prefix",id:T,"data-cui-fg":"fg-secondary","data-cui-surface":"sunken","data-cui-type":"body","data-testid":`${m}-prefix`,children:c}),k]}),_jsxruntime.jsx.call(void 0, ne,{description:t,error:n,descriptionId:E,errorId:h,testId:m})]})},Gr= exports.TextInput =e=>_jsxruntime.jsx.call(void 0, en,{...e}),Vr= exports.PasswordInput =e=>_jsxruntime.jsx.call(void 0, en,{...e,type:"password"}),Wr= exports.TextArea =({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,name:s,maxLength:l,required:i,testId:d,ref:y})=>{let{control:u,descriptionId:c,errorId:b}=te({label:e,description:t,error:n,errorId:r});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${d}-field`,children:[_jsxruntime.jsx.call(void 0, Te,{htmlFor:u.id,hidden:void 0,children:e}),_jsxruntime.jsx.call(void 0, "textarea",{className:"cui-input cui-textarea",name:tt(s),maxLength:Qt(l),value:a,required:i,onChange:f=>o(f.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":d,ref:y,...u}),_jsxruntime.jsx.call(void 0, ne,{description:t,error:n,descriptionId:c,errorId:b,testId:d})]})},zr= exports.Select =({label:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:s,name:l,labelHidden:i,unavailable:d,testId:y,ref:u})=>{let{control:c,descriptionId:b,errorId:f}=te({label:e,description:t,error:n,errorId:r}),m=_react.useId.call(void 0, ),R=Y(d,m);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${y}-field`,children:[_jsxruntime.jsx.call(void 0, Te,{htmlFor:c.id,hidden:i,children:e}),_jsxruntime.jsx.call(void 0, "select",{className:"cui-input",name:tt(l),value:a,onChange:p=>{d===void 0&&s(p.target.value)},"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":y,ref:u,...c,"aria-disabled":d===void 0?void 0:!0,"aria-describedby":_(c["aria-describedby"],R),children:o.map(p=>_jsxruntime.jsx.call(void 0, "option",{value:p.value,children:p.label},p.value))}),_jsxruntime.jsx.call(void 0, ne,{description:t,error:n,descriptionId:b,errorId:f,testId:y}),_optionalChain([d, 'optionalAccess', _12 => _12.reason])===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",id:m,testId:`${y}-reason`,children:d.reason})]})},Jr= exports.RadioGroup =({legend:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:s,testId:l,ref:i})=>{let d=_react.useId.call(void 0, ),{control:y,descriptionId:u,errorId:c}=te({label:e,description:t,error:n,errorId:r});return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-radio-group","aria-describedby":y["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),o.map((b,f)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-radio","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"radio",name:d,value:b.value,checked:b.value===a,onChange:()=>s(b.value),"aria-invalid":y["aria-invalid"],"data-testid":`${l}-option-${b.value}`,ref:f===0?i:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:b.label})]},b.value)),_jsxruntime.jsx.call(void 0, ne,{description:t,error:n,descriptionId:u,errorId:c,testId:l})]})},jr= exports.CheckboxGroup =({legend:e,description:t,error:n,errorId:r,values:a,options:o,onValuesChange:s,testId:l,ref:i})=>{let{control:d,descriptionId:y,errorId:u}=te({label:e,description:t,error:n,errorId:r}),c=o.map(m=>m.value);if(c.length===0||new Set(c).size!==c.length)throw new RangeError(`A check box group needs at least one option with unique values: ${c.join(", ")}`);let b=a.filter(m=>!c.includes(m));if(b.length>0)throw new RangeError(`The chosen values are not options: ${b.join(", ")}`);let f=new Set(a);return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-checkbox-group","aria-describedby":d["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),o.map((m,R)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-checkbox","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"checkbox",value:m.value,checked:f.has(m.value),onChange:()=>s(c.filter(p=>p===m.value?!f.has(p):f.has(p))),"aria-invalid":d["aria-invalid"],"data-testid":`${l}-option-${m.value}`,ref:R===0?i:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:m.label})]},m.value)),_jsxruntime.jsx.call(void 0, ne,{description:t,error:n,descriptionId:y,errorId:u,testId:l})]})};var sn=_react.createContext.call(void 0, null),tn="surface",nn={neutral:{face:"surface",line:"border-control"},info:{face:"info-tint",line:"info-accent"},success:{face:"success-tint",line:"success-accent"},warning:{face:"warning-tint",line:"warning-accent"},danger:{face:"danger-tint",line:"danger-accent"}},rn={face:"info-tint",line:"info-accent"},dn={normal:"border-control",high:"info-accent"},eo=["normal","high"],to=[1,2,3,4],H=_chunkRYHSVWM2cjs.v.space["space-2"],no="fg",ro="fg-secondary",ln=e=>{let t=_react.useContext.call(void 0, sn);if(t===null)throw new Error(`${e} must be rendered inside Figure`);return t},nt=(e,t,n)=>{if(!(Number.isFinite(n)&&n>0&&n%4===0))throw new RangeError(`${e}: ${t} must be a positive multiple of the ${4} px lattice: ${n}`)},oo= exports.Figure =e=>{g();let t=_react.useId.call(void 0, ),{kind:n,widthPx:r,heightPx:a,testId:o,dataAttributes:s,children:l}=e;nt(o,"widthPx",r),nt(o,"heightPx",a);let i=_react.useMemo.call(void 0, ()=>({kind:n,widthPx:r,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[n,r,a,t]),d=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "defs",{children:eo.map(b=>_jsxruntime.jsx.call(void 0, "marker",{id:i.arrowIds[b],viewBox:`0 0 ${H} ${H}`,refX:H,refY:H/2,markerWidth:H,markerHeight:H,markerUnits:"userSpaceOnUse",orient:"auto","data-cui-emphasis":b,children:_jsxruntime.jsx.call(void 0, "path",{d:`M 0 0 L ${H} ${H/2} L 0 ${H} z`,"data-cui-stroke":dn[b],"data-testid":`${o}-arrow-${b}`})},b))}),_jsxruntime.jsx.call(void 0, sn.Provider,{value:i,children:l})]});if(e.kind==="group"){let{label:b,onEscape:f}=e;if(!_chunkRYHSVWM2cjs.h.call(void 0, b))throw new RangeError(`${o}: a group figure's label must hold a readable character: ${JSON.stringify(b)}`);return _jsxruntime.jsx.call(void 0, "div",{className:"cui-figure-frame","data-testid":`${o}-frame`,children:_jsxruntime.jsx.call(void 0, "svg",{className:"cui-figure",role:"group","aria-label":b,viewBox:`0 0 ${r} ${a}`,"data-cui-figure":"group","data-cui-surface":tn,"data-cui-face":"sans",style:{"--cui-figure-inline":_chunkRYHSVWM2cjs.O.call(void 0, r),"--cui-figure-block":_chunkRYHSVWM2cjs.O.call(void 0, a)},onKeyDown:f===void 0?void 0:m=>q(m,f),"data-testid":o,...w(s),children:d})})}let{viewBox:y,pointer:u,svgRef:c}=e;return _jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":`${o}-frame`,children:_jsxruntime.jsx.call(void 0, "svg",{ref:c,className:"cui-figure","aria-hidden":"true",viewBox:y===void 0?`0 0 ${r} ${a}`:y,"data-cui-figure":"decorative","data-cui-surface":tn,"data-cui-face":"sans","data-cui-pan":u===void 0?void 0:"true","data-cui-cursor":_optionalChain([u, 'optionalAccess', _13 => _13.cursor]),style:{"--cui-figure-inline":_chunkRYHSVWM2cjs.O.call(void 0, r),"--cui-figure-ratio":String(a/r)},"data-testid":o,...w(s),..._optionalChain([u, 'optionalAccess', _14 => _14.handlers]),children:d})})},on=(e,t)=>{try{return t()}catch(n){throw new RangeError(`${e}: ${n.message}`,{cause:n})}},ao=(e,t,n)=>{for(let r of t){let a=_chunkXLOWKWIIcjs.i.light[r.fg],o=n.find(s=>a[s]===void 0);if(o!==void 0)throw new RangeError(`${e}: the note ${JSON.stringify(r.text)} in ${r.fg} is not in the contrast table on ${o}, a face the node takes`)}},io= exports.FigureNode =e=>{g();let t=ln("FigureNode"),n=_react.useId.call(void 0, ),{x:r,y:a,shape:o,tone:s,outline:l,selected:i,name:d,title:y,press:u,testId:c,dataAttributes:b}=e,f=e.notes===void 0?[]:e.notes;if(!(Number.isFinite(r)&&Number.isFinite(a)))throw new RangeError(`${c}: a node's position must be finite: ${r}, ${a}`);if(t.kind==="group"&&u===void 0)throw new RangeError(`${c}: every node of a group figure must be pressable (pass press)`);if(t.kind==="decorative"&&u!==void 0)throw new RangeError(`${c}: a node of a decorative figure cannot be pressed (it is hidden from assistive technology)`);if(u!==void 0&&!_chunkRYHSVWM2cjs.h.call(void 0, u.label))throw new RangeError(`${c}: a pressable node's label must hold a readable character: ${JSON.stringify(u.label)}`);let m=i?rn:nn[s];ao(c,f,[nn[s].face,rn.face]);let R,p,E;if(o.kind==="box"){if(d===null)throw new RangeError(`${c}: a box's name is drawn inside the box and sizes it, so it cannot be null (only a disc may be drawn without a name)`);let T=on(c,()=>_chunkRYHSVWM2cjs.I.call(void 0, {name:d,notes:f.map(k=>k.text)}));if(nt(c,"a box's widthPx",o.widthPx),o.widthPx<T.minWidthPx)throw new RangeError(`${c}: a box ${o.widthPx} px wide is narrower than its lines under the widest 1.4.12 spacing (${T.minWidthPx} px)`);R={width:o.widthPx,height:T.heightPx,left:r,top:a};let v=_chunkRYHSVWM2cjs.J.call(void 0, f.length);p=_jsxruntime.jsxs.call(void 0, "g",{"data-cui-surface":m.face,children:[_jsxruntime.jsx.call(void 0, "rect",{className:"cui-figure-plate",width:o.widthPx,height:T.heightPx,rx:_chunkRYHSVWM2cjs.v.radius["radius-item"],"data-cui-fill":m.face,"data-cui-stroke":m.line,"data-testid":`${c}-plate`}),_jsxruntime.jsx.call(void 0, "text",{className:"cui-figure-name",x:v.insetPx,y:v.namePx,fontSize:_chunkRYHSVWM2cjs.v.type.body.size,"data-cui-fg":no,"data-cui-figure-type":"body","data-testid":`${c}-name`,children:d}),f.map((k,$)=>_jsxruntime.jsx.call(void 0, "text",{x:v.insetPx,y:v.notesPx[$],fontSize:_chunkRYHSVWM2cjs.v.type.caption.size,"data-cui-fg":k.fg,"data-cui-figure-type":"caption","data-testid":`${c}-note-${$}`,children:k.text},$))]}),E=_jsxruntime.jsx.call(void 0, "rect",{className:"cui-figure-ring",x:-_chunkRYHSVWM2cjs.M,y:-_chunkRYHSVWM2cjs.M,width:o.widthPx+2*_chunkRYHSVWM2cjs.M,height:T.heightPx+2*_chunkRYHSVWM2cjs.M,rx:_chunkRYHSVWM2cjs.v.radius["radius-item"]+_chunkRYHSVWM2cjs.M,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}else{let T=on(c,()=>_chunkRYHSVWM2cjs.K.call(void 0, d,o.radiusPx));R={width:2*o.radiusPx,height:2*o.radiusPx,left:r-o.radiusPx,top:a-o.radiusPx},p=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "g",{"data-cui-surface":m.face,children:_jsxruntime.jsx.call(void 0, "circle",{className:"cui-figure-plate",r:o.radiusPx,"data-cui-fill":m.face,"data-cui-stroke":m.line,"data-testid":`${c}-plate`})}),d===null?null:_jsxruntime.jsx.call(void 0, "text",{className:"cui-figure-label",x:0,y:T.extentBelowPx-_chunkRYHSVWM2cjs.v.type.caption.lineHeight/2,fontSize:_chunkRYHSVWM2cjs.v.type.caption.size,"data-cui-fg":ro,"data-cui-figure-type":"caption","data-testid":`${c}-name`,children:d})]}),E=_jsxruntime.jsx.call(void 0, "circle",{className:"cui-figure-ring",r:o.radiusPx+_chunkRYHSVWM2cjs.M,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}if(u!==void 0){if(R.width<_chunkRYHSVWM2cjs.s||R.height<_chunkRYHSVWM2cjs.s)throw new RangeError(`${c}: a pressable node must be at least the ${_chunkRYHSVWM2cjs.s} px target: ${R.width} \xD7 ${R.height}`);if(R.left<_chunkRYHSVWM2cjs.L||R.top<_chunkRYHSVWM2cjs.L||R.left+R.width+_chunkRYHSVWM2cjs.L>t.widthPx||R.top+R.height+_chunkRYHSVWM2cjs.L>t.heightPx)throw new RangeError(`${c}: a pressable node must keep ${_chunkRYHSVWM2cjs.L} px to the figure's edge for its focus ring`)}let h=u===void 0?{}:{role:"button",tabIndex:0,"aria-label":u.label,"aria-describedby":u.description===void 0?void 0:n,"aria-expanded":u.expanded,"aria-controls":u.expanded?u.controls:void 0,onClick:T=>{T.currentTarget.focus(),u.onPress()},onKeyDown:T=>{T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),T.repeat||u.onPress())}};return _jsxruntime.jsxs.call(void 0, "g",{className:"cui-figure-node",transform:`translate(${r} ${a})`,"data-cui-tone":s,"data-cui-outline":l,"data-selected":String(i),...h,"data-testid":c,...w(b),children:[y===void 0?null:_jsxruntime.jsx.call(void 0, "title",{children:y}),_optionalChain([u, 'optionalAccess', _15 => _15.description])===void 0?null:_jsxruntime.jsx.call(void 0, "desc",{id:n,"data-testid":`${c}-description`,children:u.description}),u===void 0?null:E,p]})},so= exports.FigureEdge =({d:e,emphasis:t,weight:n,arrow:r,title:a,testId:o,dataAttributes:s})=>{g();let l=ln("FigureEdge");if(!to.includes(n))throw new RangeError(`${o}: an edge's weight must be 1, 2, 3 or 4: ${n}`);return _jsxruntime.jsx.call(void 0, "path",{className:"cui-figure-edge",d:e,markerEnd:r?`url(#${l.arrowIds[t]})`:void 0,"data-cui-stroke":dn[t],"data-cui-weight":n,"data-cui-emphasis":t,"data-testid":o,...w(s),children:a===void 0?null:_jsxruntime.jsx.call(void 0, "title",{children:a})})};var lo={1:"h1",2:"h2",3:"h3"},uo= exports.Heading =({level:e,type:t,testId:n,headingRef:r,children:a})=>{g();let o=lo[e];return _jsxruntime.jsx.call(void 0, o,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":n,ref:r,tabIndex:r===void 0?void 0:-1,children:a})};var po={removed:"danger-tint",added:"success-tint"},yo= exports.InlineChange =({kind:e,testId:t,children:n})=>{if(g(),n==="")throw new RangeError(`${t}: a changed fragment must hold at least one character`);return _jsxruntime.jsx.call(void 0, e==="removed"?"del":"ins",{className:"cui-change","data-cui-change":e,"data-cui-surface":po[e],"data-cui-fg":"fg","data-testid":t,children:n})};var mo={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"}},go={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},rt= exports.Pill =({tone:e,variant:t,testId:n,dataAttributes:r,children:a})=>{g();let o=t==="tint"?mo[e]:{fg:"on-solid",surface:go[e]};return _jsxruntime.jsx.call(void 0, "span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":o.fg,"data-cui-surface":o.surface,"data-cui-type":"caption","data-testid":n,...w(r),children:a})};var ot=({label:e,valueText:t,value:n,max:r,testId:a})=>{g();let o=_react.useId.call(void 0, );if(r!==null){if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Progress maximum must be positive: ${r}`);if(n===null||!(Number.isFinite(n)&&n>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${n}`)}let s=r===null?null:{max:r,now:Math.min(n,r)};return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-progress","data-testid":a,children:[_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg",type:"body",id:o,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":o,"aria-valuetext":t,"aria-valuemin":s===null?void 0:0,"aria-valuemax":_optionalChain([s, 'optionalAccess', _16 => _16.max]),"aria-valuenow":_optionalChain([s, 'optionalAccess', _17 => _17.now]),"data-cui-surface":"sunken","data-cui-indeterminate":s===null,"data-testid":`${a}-bar`,children:_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:s===null?void 0:{inlineSize:`${s.now/s.max*100}%`},"data-testid":`${a}-fill`})}),_jsxruntime.jsx.call(void 0, "div",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-secondary",type:"body",testId:`${a}-value`,children:t})})]})};var To=({title:e,status:t,progress:n,cancel:r,testId:a,children:o})=>_jsxruntime.jsxs.call(void 0, We,{title:e,actions:r===void 0?void 0:_jsxruntime.jsx.call(void 0, I,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${a}-cancel`,children:r.label}),testId:a,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-status`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:`${e} `}),_jsxruntime.jsx.call(void 0, rt,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),n===void 0?null:_jsxruntime.jsx.call(void 0, ot,{...n,testId:`${a}-progress`}),o]});var at=_react.createContext.call(void 0, null),xo="space-2",wo= exports.List =e=>{g();let{gap:t,label:n,id:r,hidden:a,testId:o,children:s}=e;if(n!==void 0&&!_chunkRYHSVWM2cjs.h.call(void 0, n))throw new RangeError(`${o}: a list's label must hold a readable character: ${JSON.stringify(n)}`);let l=e.marker==="none"?void 0:e.type,i=l!==void 0,d=e.marker==="number"||e.marker==="none"&&e.ordered?"ol":"ul";return _jsxruntime.jsx.call(void 0, at.Provider,{value:e.marker,children:_jsxruntime.jsx.call(void 0, d,{className:"cui-list",role:"list","aria-label":n,id:r,hidden:a,"data-cui-gap":i?void 0:t,"data-cui-row-gap":i?t:void 0,"data-cui-column-gap":i?xo:void 0,"data-cui-marker":i?e.marker:void 0,"data-cui-type":l,"data-testid":o,children:s})})},Po= exports.ListItem =({testId:e,dataAttributes:t,children:n})=>{g();let r=_react.useContext.call(void 0, at);if(r===null)throw new Error("ListItem must be rendered inside List, not inside another ListItem");return _jsxruntime.jsx.call(void 0, "li",{className:"cui-list-item","data-testid":e,...w(t),children:_jsxruntime.jsx.call(void 0, "div",{className:"cui-list-body","data-cui-measure":r==="none"?void 0:"reading",children:_jsxruntime.jsx.call(void 0, at.Provider,{value:null,children:n})})})};var yn=e=>[...e.querySelectorAll(de)].filter(t=>{let n=t.closest(ze);return n===null||!e.contains(n)}),Co=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 n=yn(t);if(n.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${n.length} ${de} elements for ${e.count} rows`);return n},ko=(e,t)=>{let n=-1;return e.forEach((r,a)=>{t.has(r)&&(n=a)}),e[n+1]},Lo= exports.LoadMore =({onLoad:e,busy:t,done:n,failure:r,limit:a,rows:o,testId:s})=>{let{formatLocale:l,labels:i}=C(),d=_react.useRef.call(void 0, null),y=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null),c=_react.useRef.call(void 0, !1),b=()=>{let p=o.ref.current;d.current={shown:new Set(p===null?[]:yn(p)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};_react.useLayoutEffect.call(void 0, ()=>{let p=c.current;c.current=!1;let E=d.current;if(E===null)return;let h=Co(o);if(t){E.busySeen=!0,E.shown=new Set(h);return}let T=ko(h,E.shown),v=r!==null&&r.occurrence!==E.failureOccurrence;if(!(E.busySeen||T!==void 0||v||n)||(d.current=null,v||T===void 0))return;let k=[null,document.body].includes(document.activeElement);(u.current!==null&&document.activeElement===u.current||p&&k)&&T.focus()});let f=le(()=>n?y.current:u.current),m=_react.useCallback.call(void 0, (p=>{u.current=p;let E=f(p);return()=>{u.current=null,c.current=p===document.activeElement,E()}}),[f]),R=_react.useCallback.call(void 0, (p=>{y.current=p;let E=f(p);return()=>{y.current=null,E()}}),[f]);return n?_jsxruntime.jsx.call(void 0, "div",{className:"cui-load-more","data-testid":s,children:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:R,testId:`${s}-end`,children:i.endOfRecords})}):_jsxruntime.jsxs.call(void 0, "div",{className:"cui-load-more","data-testid":s,children:[_jsxruntime.jsx.call(void 0, I,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:b,ref:m,testId:`${s}-button`,children:i.loadMore(_chunkRYHSVWM2cjs.c.call(void 0, a,l))}),r===null?null:_jsxruntime.jsx.call(void 0, ce,{occurrence:r.occurrence,testId:`${s}-failure`,children:i.loadFailed(r.reason)})]})};var Mo=({master:e,detail:t,masterMinPx:n,detailMinPx:r,testId:a})=>{g();let o=_chunkRYHSVWM2cjs.Q.call(void 0, {masterMinPx:n,detailMinPx:r,gapPx:_chunkRYHSVWM2cjs.v.space["space-6"]});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":a,children:[_jsxruntime.jsx.call(void 0, Q,{ruleKey:o.key,css:o.css}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-master-detail","data-cui-master-detail":o.key,children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${a}-master`,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${a}-detail`,children:t})]})]})};var Ne=e=>{let{formatLocale:t,labels:n}=C(),{testId:r}=e;if(e.keep===void 0){let{value:s,unit:l}=e;if(l!==void 0&&!_chunkRYHSVWM2cjs.h.call(void 0, l))throw new RangeError(`${r}: a unit must hold a readable character: ${JSON.stringify(l)}`);if(s===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-testid":r,children:n.unmeasured});let i=_chunkRYHSVWM2cjs.c.call(void 0, s,t);return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-testid":r,children:_chunkRYHSVWM2cjs.e.call(void 0, i,l)})}let{text:a,keep:o}=e;if(a===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-cui-keep":o,"data-testid":r,children:n.unmeasured});if(!_chunkRYHSVWM2cjs.h.call(void 0, a))throw new RangeError(`${r}: a measured text must hold a readable character (pass null when the value was not measured): ${JSON.stringify(a)}`);return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-cui-keep":o,"data-testid":r,children:a})};var Io=({label:e,value:t,min:n,max:r,valueText:a,testId:o})=>{if(g(),!(Number.isFinite(n)&&Number.isFinite(r)&&n<r))throw new RangeError(`Meter needs a finite range with min below max: min ${n}, max ${r}`);if(!(Number.isFinite(t)&&t>=n&&t<=r))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${n}, max ${r}`);return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-meter","data-testid":o,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":t,"aria-valuetext":a,"data-cui-surface":"sunken","data-testid":`${o}-bar`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-n)/(r-n)*100}%`},"data-testid":`${o}-fill`})}),_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{fg:"fg",type:"body",testId:`${o}-value`,children:a})})]})};var Do={ArrowLeft:-1,ArrowRight:1},Ho= exports.PanelTabs =({label:e,items:t,value:n,onValueChange:r,testId:a,panelDescribedBy:o,children:s})=>{g();let l=_react.useId.call(void 0, ),i=_react.useRef.call(void 0, new Map);if(t.length===0)throw new RangeError("PanelTabs needs at least one tab");let d=t.map(m=>m.id);if(new Set(d).size!==d.length)throw new RangeError(`Tab keys must be unique: ${d.join(", ")}`);let y=d.indexOf(n);if(y<0)throw new RangeError(`The selected tab "${n}" is not one of the tabs: ${d.join(", ")}`);let u=m=>`${l}-tab-${m}`,c=`${l}-panel`,b=m=>{let R=t[m];R.id!==n&&r(R.id),_optionalChain([i, 'access', _18 => _18.current, 'access', _19 => _19.get, 'call', _20 => _20(R.id), 'optionalAccess', _21 => _21.focus, 'call', _22 => _22()])};return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-panel-tabs","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-tabs-list",role:"tablist","aria-label":e,onKeyDown:m=>{let R=t.findIndex(T=>i.current.get(T.id)===m.target),p=R<0?y:R,E=Do[m.key],h;if(E!==void 0){let T=getComputedStyle(m.currentTarget).direction==="rtl"?-E:E;h=(p+T+t.length)%t.length}else if(m.key==="Home")h=0;else if(m.key==="End")h=t.length-1;else return;m.preventDefault(),b(h)},children:t.map((m,R)=>{let p=R===y;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-tab cui-panel-tab",type:"button",role:"tab",id:u(R),"aria-selected":p,"aria-controls":c,tabIndex:p?0:-1,"data-cui-fg":p?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${m.id}`,ref:E=>{E===null?i.current.delete(m.id):i.current.set(m.id,E)},onClick:()=>b(R),children:m.label},m.id)})}),_jsxruntime.jsx.call(void 0, "div",{role:"tabpanel",id:c,"aria-labelledby":u(y),"aria-describedby":o,"data-testid":`${a}-panel`,children:s})]})};var Uo=({failure:e,onReload:t,deniedSentence:n,failureMessage:r,rescueRef:a,testId:o})=>{let{labels:s}=C(),l=_jsxruntime.jsx.call(void 0, et,{failure:e,place:"read",deniedSentence:n,failed:r===void 0?s.loadFailed:r,retry:t,testId:`${o}-alert`});return e.status!==null&&_authcore.accessFailureKindOfStatus.call(void 0, e.status)!==null?_jsxruntime.jsx.call(void 0, "div",{className:"cui-resource-failed",ref:a,"data-testid":o,children:l},e.occurrence):_jsxruntime.jsxs.call(void 0, "div",{className:"cui-resource-failed","data-testid":o,children:[l,_jsxruntime.jsx.call(void 0, I,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:a,testId:`${o}-reload`,children:s.reload})]})};var qo=({label:e,options:t,value:n,onValueChange:r,testId:a,density:o="regular"})=>{g();let s=_react.useId.call(void 0, ),l=new Set(t.map(i=>i.value));if(t.length<2||l.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(i=>i.value).join(", ")}`);if(!l.has(n))throw new RangeError(`The pressed value "${n}" is not one of the options: ${[...l].join(", ")}`);if(o!=="regular"&&o!=="compact")throw new RangeError(`A segmented control's density is "regular" or "compact", not ${JSON.stringify(o)}`);return o==="compact"?_jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-segmented-group","aria-labelledby":s,"data-cui-density":"compact","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-segmented-label",id:s,"data-cui-type":"caption",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===n;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-segment",type:"button","aria-pressed":d,"data-testid":`${a}-${i.value}`,onClick:()=>{d||r(i.value)},children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-segment-face","data-cui-fg":d?"on-solid":"fg","data-cui-surface":d?"info-solid":void 0,"data-cui-type":"caption","data-testid":`${a}-${i.value}-face`,children:i.label})},i.value)})})]}):_jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-segmented-group","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===n;return _jsxruntime.jsx.call(void 0, "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":`${a}-${i.value}`,onClick:()=>{d||r(i.value)},children:i.label},i.value)})})]})};var gn=e=>{let t=_react.useRef.call(void 0, null),n=_react.useCallback.call(void 0, r=>{if(t.current=r,typeof e=="function")return e(r);e!=null&&(e.current=r)},[e]);return{row:t,bindRow:n}},bn= exports.RowButton =({selected:e,controls:t,onSelect:n,testId:r,dataAttributes:a,ref:o,keyShortcuts:s,children:l})=>{g();let{row:i,bindRow:d}=gn(o);D(i,{testId:r,part:"row",host:"button"});let y=u=>{ae(u),n()};return _jsxruntime.jsx.call(void 0, "button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"aria-keyshortcuts":B(s,r),"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:y,ref:d,...w(a),children:l})},Wo= exports.RowLink =({href:e,current:t,onNavigate:n,testId:r,dataAttributes:a,ref:o,keyShortcuts:s,children:l})=>{g();let{row:i,bindRow:d}=gn(o);D(i,{testId:r,part:"row",host:"link"});let y=u=>{ae(u),Z(u,e,n)};return _jsxruntime.jsx.call(void 0, "a",{className:"cui-row-link",href:e,"aria-current":t?"page":void 0,"aria-keyshortcuts":B(s,r),"data-cui-row-focus":"","data-cui-surface":t?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:y,ref:d,...w(a),children:l})},zo= exports.SelectableList =({label:e,items:t,itemKey:n,selectedKey:r,onSelect:a,detailId:o,renderRow:s,rowTestId:l,rowData:i,empty:d,testId:y,ref:u})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-selectable","data-testid":y,ref:u,children:t.length===0?_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"prose",testId:`${y}-empty`,children:d}):_jsxruntime.jsx.call(void 0, "ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(c=>{let b=n(c);return _jsxruntime.jsx.call(void 0, "li",{children:_jsxruntime.jsx.call(void 0, bn,{selected:b===r,controls:o,onSelect:()=>a(c),testId:l,dataAttributes:_optionalChain([i, 'optionalCall', _23 => _23(c)]),children:s(c)})},b)})})}));var jo=({label:e,value:t,min:n,max:r,step:a,valueText:o,onValueChange:s,testId:l})=>{g();let i=_react.useId.call(void 0, );if(!([t,n,r,a].every(Number.isFinite)&&n<r&&a>0&&n<=t&&t<=r))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${n}, max ${r}, step ${a}`);let d=o(t);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-testid":`${l}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:i,"data-cui-type":"body",children:e}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-slider",children:[_jsxruntime.jsx.call(void 0, "input",{className:"cui-slider-input",id:i,type:"range",min:n,max:r,step:a,value:t,"aria-valuetext":d,"data-testid":l,onChange:y=>s(y.currentTarget.valueAsNumber)}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-slider-value","aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{fg:"fg",type:"body",testId:`${l}-value`,children:d})})]})]})};var Rn={done:0,current:1,pending:2},Xo={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Yo= exports.Stepper =({label:e,steps:t,testId:n})=>{let{labels:r}=C();if(t.length===0||new Set(t.map(o=>o.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(o=>o.id).join(", ")}`);if(t.filter(o=>o.state==="current").length>1||t.some((o,s)=>s>0&&Rn[o.state]<Rn[t[s-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(o=>o.state).join(", ")}`);let a={done:r.stepDone,current:null,pending:r.stepPending};return _jsxruntime.jsx.call(void 0, "ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":n,children:t.map((o,s)=>{let l=Xo[o.state],i=a[o.state];return _jsxruntime.jsxs.call(void 0, "li",{className:"cui-step","aria-current":o.state==="current"?"step":void 0,"data-cui-step":o.state,"data-testid":`${n}-${o.id}`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":l.fg,"data-cui-surface":l.surface,"data-cui-type":"caption",children:o.state==="done"?"\u2713":s+1}),_jsxruntime.jsxs.call(void 0, "span",{className:"cui-step-label","data-cui-fg":"fg",children:[o.label,i===null?null:_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:` (${i})`})]})]},o.id)})})};var ea=({label:e,labelHidden:t,checked:n,onCheckedChange:r,unavailable:a,testId:o,ref:s,dataAttributes:l})=>{g();let i=_react.useId.call(void 0, ),d=_react.useRef.call(void 0, null);D(d,{testId:o,part:"label",host:"button"});let y=Y(a,i),u=a!==void 0,c=_jsxruntime.jsxs.call(void 0, "button",{className:"cui-switch",type:"button",role:"switch","aria-checked":n,"aria-disabled":u?!0:void 0,"aria-describedby":_(y),"data-cui-fg":"fg","data-cui-type":"body","data-testid":o,ref:s,onClick:()=>{u||r(!n)},...w(l),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":n?"info-solid":"sunken","data-testid":`${o}-track`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-thumb","data-cui-surface":n?"surface":"neutral-solid","data-testid":`${o}-thumb`})}),_jsxruntime.jsx.call(void 0, "span",{className:t===!0?"cui-visually-hidden":void 0,ref:d,children:e})]});return _optionalChain([a, 'optionalAccess', _24 => _24.reason])===void 0?c:_jsxruntime.jsxs.call(void 0, "span",{className:"cui-button-group",children:[c,_jsxruntime.jsx.call(void 0, P,{fg:"fg-muted",type:"body",id:i,testId:`${o}-reason`,children:a.reason})]})};var aa=({label:e,items:t,currentId:n,onNavigate:r,testId:a,collapsible:o=!1})=>{if(g(),t.length===0)throw new RangeError("Tabs needs at least one tab");let s=new Set(t.map(f=>f.id));if(s.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(f=>f.id).join(", ")}`);let l=t.find(f=>f.id===n);if(l===void 0)throw new RangeError(`The current tab "${n}" is not one of the tabs: ${[...s].join(", ")}`);let[i,d]=_react.useState.call(void 0, !1),y=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null),c=_react.useId.call(void 0, ),b=_react.useCallback.call(void 0, f=>{d(!1),f&&_optionalChain([y, 'access', _25 => _25.current, 'optionalAccess', _26 => _26.contains, 'call', _27 => _27(document.activeElement)])&&_optionalChain([u, 'access', _28 => _28.current, 'optionalAccess', _29 => _29.focus, 'call', _30 => _30()])},[]);return _react.useEffect.call(void 0, ()=>{if(!(o&&i))return;let f=p=>y.current!==null&&!y.current.contains(p),m=p=>{f(p.target)&&b(!0)},R=p=>{f(p.target)&&b(!1)};return document.addEventListener("pointerdown",m,!0),document.addEventListener("focusin",R,!0),()=>{document.removeEventListener("pointerdown",m,!0),document.removeEventListener("focusin",R,!0)}},[o,i,b]),_jsxruntime.jsxs.call(void 0, "nav",{ref:y,className:"cui-tabs","aria-label":e,"data-testid":a,"data-cui-collapsible":o?"":void 0,"data-cui-open":o&&i?"":void 0,onKeyDown:o&&i?f=>q(f,()=>b(!0)):void 0,children:[o?_jsxruntime.jsxs.call(void 0, "button",{ref:u,type:"button",className:"cui-tabs-summary","aria-expanded":i,"aria-controls":c,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${a}-summary`,onClick:()=>d(f=>!f),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-tabs-summary-label",children:l.label}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-tabs-summary-marker","aria-hidden":"true",children:i?"\u25B4":"\u25BE"})]}):null,_jsxruntime.jsx.call(void 0, "ul",{className:"cui-tabs-list",id:c,role:"list","data-cui-surface":o?"surface":void 0,children:t.map(f=>{let m=f.id===n;return _jsxruntime.jsx.call(void 0, "li",{className:"cui-tabs-item",children:_jsxruntime.jsx.call(void 0, "a",{className:"cui-tab",href:f.href,"aria-current":m?"page":void 0,"data-cui-fg":m?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${f.id}`,onClick:R=>{Z(R,f.href,r),R.defaultPrevented&&b(!1)},children:f.label})},f.id)})})]})};var la={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},ua= exports.MetricTile =e=>{g();let{label:t,sublabel:n,tone:r,testId:a,dataAttributes:o}=e;if((e.text===void 0?e.value===null:e.text===null)&&r!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${r}`);let l=`${a}-value`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":a,...w(o),children:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-label","data-cui-type":"caption","data-cui-measure":"reading",children:t}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption","data-cui-measure":"reading",children:n}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-value","data-cui-fg":la[r],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?_jsxruntime.jsx.call(void 0, Ne,{value:e.value,unit:e.unit,testId:l}):_jsxruntime.jsx.call(void 0, Ne,{text:e.text,keep:"wrap",testId:l})})]})},wn=e=>_react.Children.toArray(e).flatMap(t=>{if(!_react.isValidElement.call(void 0, t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===_react.Fragment?wn(t.props.children):[t]}),ca= exports.TileGrid =({count:e,minInlinePx:t,testId:n,children:r})=>{g();let a=_chunkRYHSVWM2cjs.T.call(void 0, e,t,_chunkRYHSVWM2cjs.v.space["space-2"]),o=wn(r).length;if(o!==e)throw new RangeError(`TileGrid has ${o} tiles but count is ${e}`);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":n,children:[_jsxruntime.jsx.call(void 0, Q,{ruleKey:a.key,css:a.css}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-tile-grid","data-cui-tile-grid":a.key,"data-cui-gap":"space-2",children:r})]})};var Se=e=>[...e.querySelectorAll("button")],ya= exports.Toolbar =({label:e,testId:t,children:n})=>{g();let r=_react.useRef.call(void 0, null),a=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{let i=Se(r.current),d=a.current!==null&&i.includes(a.current)?a.current:_nullishCoalesce(i[0], () => (null));a.current=d;for(let y of i)y.tabIndex=y===d?0:-1});let o=i=>{for(let d of Se(r.current))d.tabIndex=d===i?0:-1;a.current=i};return _jsxruntime.jsx.call(void 0, "div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:r,onFocus:i=>{let d=Se(i.currentTarget).find(y=>y.contains(i.target));d!==void 0&&o(d)},onKeyDown:i=>{let d=Se(i.currentTarget),y=d.indexOf(i.target);if(y===-1)return;let u=getComputedStyle(i.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",c=u==="ArrowRight"?"ArrowLeft":"ArrowRight",f={[u]:(y+1)%d.length,[c]:(y-1+d.length)%d.length,Home:0,End:d.length-1}[i.key];if(f===void 0)return;i.preventDefault();let m=d[f];o(m),m.focus()},children:n})};var ga=e=>{let[t,n]=_react.useState.call(void 0, {failure:null,count:0});return e!==null&&e!==t.failure?(n({failure:e,count:t.count+1}),t.count+1):t.count};var Cn=e=>e===null?_chunkRYHSVWM2cjs.X:_chunkRYHSVWM2cjs.Y,Ie=(e,t,n,r,a)=>{let[o,s]=_react.useState.call(void 0, ()=>({key:e,state:Cn(e)})),[l,i]=_react.useState.call(void 0, 0),[d,y]=_react.useState.call(void 0, 0),u=_react.useRef.call(void 0, t),c=_react.useRef.call(void 0, null),b=_react.useRef.call(void 0, l);_react.useLayoutEffect.call(void 0, ()=>{u.current=t}),_react.useEffect.call(void 0, ()=>{if(e===null){s({key:null,state:_chunkRYHSVWM2cjs.X});return}let h=new AbortController;c.current=e;let T=l===b.current?"revision":"reload";return b.current=l,s(v=>Object.is(v.key,e)?{key:e,state:r(v.state,T)}:{key:e,state:_chunkRYHSVWM2cjs.Y}),u.current(h.signal).then(v=>{h.signal.aborted||(c.current=null,s(k=>({key:e,state:a(k.state,v)})))},v=>{h.signal.aborted||s(()=>{throw v})}),()=>{h.abort(),c.current=null}},[e,n,l,d]);let f=_react.useCallback.call(void 0, ()=>i(h=>h+1),[]),m=_react.useCallback.call(void 0, ()=>y(h=>h+1),[]),R=_react.useCallback.call(void 0, (h,T)=>{s(v=>Object.is(v.key,h)?{key:h,state:T(v.state)}:v)},[]),p=_react.useCallback.call(void 0, (h,T)=>{R(h,T),Object.is(c.current,h)&&m()},[R,m]);return{state:Object.is(o.key,e)?o.state:Cn(e),reload:f,refresh:m,update:R,write:p}};var Ta=(e,t,n)=>{let r=_react.useRef.call(void 0, t);_react.useLayoutEffect.call(void 0, ()=>{r.current=t});let a=_react.useCallback.call(void 0, p=>r.current.first(p),[]),{state:o,reload:s,refresh:l,update:i,write:d}=Ie(e,a,n,_chunkRYHSVWM2cjs.$,_chunkRYHSVWM2cjs.aa),y=_react.useRef.call(void 0, {key:e,state:o});_react.useLayoutEffect.call(void 0, ()=>{y.current={key:e,state:o}});let u=_react.useRef.call(void 0, null),c=_react.useCallback.call(void 0, ()=>{_optionalChain([u, 'access', _31 => _31.current, 'optionalAccess', _32 => _32.controller, 'access', _33 => _33.abort, 'call', _34 => _34()]),u.current=null},[]);_react.useEffect.call(void 0, ()=>c,[e,n,c]);let b=_react.useCallback.call(void 0, ()=>{c(),s()},[c,s]),f=_react.useCallback.call(void 0, ()=>{c(),l()},[c,l]),m=_react.useCallback.call(void 0, ()=>{let{key:p,state:E}=y.current;if(p===null||E.kind!=="ready"||E.refreshing||E.value.next===null||E.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 h=E.value.next,T={key:p,controller:new AbortController,maps:[]};u.current=T,i(p,_chunkRYHSVWM2cjs.ba),r.current.next(h,T.controller.signal).then(v=>{u.current===T&&(u.current=null,i(p,k=>T.maps.reduce(($,oe)=>_chunkRYHSVWM2cjs.da.call(void 0, $,oe),_chunkRYHSVWM2cjs.ca.call(void 0, k,h,v))))},v=>{u.current===T&&i(p,()=>{throw v})})},[i]),R=_react.useCallback.call(void 0, (p,E)=>{let h=u.current;h!==null&&Object.is(h.key,p)&&h.maps.push(E),d(p,T=>_chunkRYHSVWM2cjs.da.call(void 0, T,E))},[d]);return{state:o,reload:b,refresh:f,loadMore:m,updateList:R}};var wa=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",Pa= exports.usePendingPress =()=>{let[e,t]=_react.useState.call(void 0, null),n=_react.useRef.call(void 0, null),r=_react.useCallback.call(void 0, (a,o)=>{let s=o();if(!wa(s))return;let l=Symbol(a);n.current=l,t(a);let i=()=>{n.current===l&&(n.current=null,t(null))};s.then(i,i)},[]);return{pendingKey:e,press:r}};var Ca=(e,t,n)=>{let{state:r,reload:a,refresh:o,write:s}=Ie(e,t,n,_chunkRYHSVWM2cjs.Z,_chunkRYHSVWM2cjs._),l=_react.useCallback.call(void 0, (i,d)=>s(i,y=>_chunkRYHSVWM2cjs._.call(void 0, y,{ok:!0,value:d})),[s]);return{state:r,reload:a,refresh:o,put:l}};var ka=({testId:e,children:t})=>(g(),_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden","data-testid":e,children:t}));exports.ANNOUNCE_SETTLE_MS = ge; exports.AccessFailureNotice = rr; exports.AlertMessage = ce; exports.Breadcrumb = or; exports.Button = I; exports.COMPACT_ROW_PX = _chunkRYHSVWM2cjs.u; exports.CONSOLE_UI_LABEL_CATALOGS = _chunkRYHSVWM2cjs.o; exports.CONTRAST_MINIMUM = _chunkXLOWKWIIcjs.f; exports.CONTRAST_PAIRS = _chunkXLOWKWIIcjs.i; exports.Card = We; exports.CardSection = ur; exports.CheckboxGroup = jr; exports.Cluster = Ge; exports.CodeBlock = pr; exports.ComparisonGrid = mr; exports.ConsoleUiRoot = Hn; exports.DataTable = Lr; exports.DescriptionList = Sr; exports.Dialog = Ar; exports.Disclosure = Or; exports.FIGURE_RING_REACH_PX = _chunkRYHSVWM2cjs.L; exports.FLEXIBLE_COLUMN_MIN_PX = _chunkRYHSVWM2cjs.C; exports.FailureMessage = et; exports.Field = qr; exports.Figure = oo; exports.FigureEdge = so; exports.FigureNode = io; exports.FragmentLink = Xn; exports.HTTP_FORBIDDEN = _chunkRYHSVWM2cjs.U; exports.Heading = uo; exports.InlineChange = yo; exports.JobCard = To; exports.LATTICE_PX = _chunkRYHSVWM2cjs.q; exports.Link = Jn; exports.List = wo; exports.ListItem = Po; exports.LoadMore = Lo; exports.MORE_CONTRAST_MINIMUM = _chunkXLOWKWIIcjs.g; exports.MasterDetail = Mo; exports.Measured = Ne; exports.Meter = Io; exports.MetricTile = ua; exports.Notice = Kr; exports.PanelTabs = Ho; exports.PasswordInput = Vr; exports.Pill = rt; exports.ProgressBar = ot; exports.ROW_WITH_CONTROL_PX = _chunkRYHSVWM2cjs.t; exports.RadioGroup = Jr; exports.ResourceFailed = Uo; exports.RowButton = bn; exports.RowLink = Wo; exports.SegmentedControl = qo; exports.Select = zr; exports.SelectableList = zo; exports.Slider = jo; exports.Stack = Zn; exports.Stepper = Yo; exports.Switch = ea; exports.TARGET_PX = _chunkRYHSVWM2cjs.s; exports.TOKENS = _chunkRYHSVWM2cjs.v; exports.TONES = _chunkRYHSVWM2cjs.ia; exports.TONE_HUES = _chunkRYHSVWM2cjs.ga; exports.TONE_ROLES = _chunkRYHSVWM2cjs.ha; exports.Tabs = aa; exports.Text = P; exports.TextArea = Wr; exports.TextInput = Gr; exports.TileGrid = ca; exports.Toolbar = ya; exports.VisuallyHidden = ka; exports.ZonedTimeError = _chunkRYHSVWM2cjs.i; exports.beginPage = _chunkRYHSVWM2cjs.ba; exports.beginPagedReload = _chunkRYHSVWM2cjs.$; exports.beginReload = _chunkRYHSVWM2cjs.Z; exports.ceil8 = _chunkRYHSVWM2cjs.z; exports.ceilToLattice = _chunkRYHSVWM2cjs.r; exports.cellContentInlinePx = _chunkRYHSVWM2cjs.A; exports.comparisonAttributePx = _chunkRYHSVWM2cjs.D; exports.contrastRatio = _chunkXLOWKWIIcjs.e; exports.countSampleText = _chunkRYHSVWM2cjs.F; exports.cssVar = _chunkRYHSVWM2cjs.w; exports.figureBoxPlan = _chunkRYHSVWM2cjs.I; exports.figureDiscLabelPlan = _chunkRYHSVWM2cjs.K; exports.fillLabel = _chunkRYHSVWM2cjs.m; exports.fixedColumnPx = _chunkRYHSVWM2cjs.B; exports.flatMapOutcome = _chunkRYHSVWM2cjs.W; exports.formatByteSize = _chunkRYHSVWM2cjs.d; exports.formatCount = _chunkRYHSVWM2cjs.c; exports.formatInstant = _chunkRYHSVWM2cjs.l; exports.goldenSectionPx = _chunkRYHSVWM2cjs.N; exports.hexToSrgb = _chunkXLOWKWIIcjs.a; exports.instantSampleText = _chunkRYHSVWM2cjs.E; exports.isReadableText = _chunkRYHSVWM2cjs.h; exports.keepLastGood = _chunkRYHSVWM2cjs._; exports.lightDark = _chunkRYHSVWM2cjs.ea; exports.mapOutcome = _chunkRYHSVWM2cjs.V; exports.mapPagedList = _chunkRYHSVWM2cjs.da; exports.masterDetailPlan = _chunkRYHSVWM2cjs.P; exports.monoTextWidthEm = _chunkRYHSVWM2cjs.y; exports.placeholderRule = _chunkRYHSVWM2cjs.fa; exports.pxToRem = _chunkRYHSVWM2cjs.O; exports.readDecimalText = _chunkRYHSVWM2cjs.f; exports.readIntegerText = _chunkRYHSVWM2cjs.g; exports.reasonAside = _chunkRYHSVWM2cjs.n; exports.resolveConsoleUiLabels = _chunkRYHSVWM2cjs.p; exports.settleFirstPage = _chunkRYHSVWM2cjs.aa; exports.settlePage = _chunkRYHSVWM2cjs.ca; exports.spacedTextWidthEm = _chunkRYHSVWM2cjs.H; exports.tableFrameMinInlinePx = _chunkRYHSVWM2cjs.S; exports.tableMinInlinePx = _chunkRYHSVWM2cjs.R; exports.textWidthEm = _chunkRYHSVWM2cjs.x; exports.tileGridPlan = _chunkRYHSVWM2cjs.T; exports.tileMinInlinePx = _chunkRYHSVWM2cjs.G; exports.toOffsetIso = _chunkRYHSVWM2cjs.j; exports.toWallTime = _chunkRYHSVWM2cjs.k; exports.topmostModalOf = _chunkRYHSVWM2cjs.b; exports.useAccessFailure = On; exports.useAnnounce = Be; exports.useConsoleUi = C; exports.useEscapeToClose = dr; exports.useFailureOccurrence = ga; exports.useFocusRescue = le; exports.usePagedResource = Ta; exports.usePendingPress = Pa; exports.useResource = Ca;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as Nt,A as Xa,B as Ya,C as Za,D as Qa,E as ei,F as ti,G as ni,H as ri,I as Rt,J as Tt,K as Et,L as X,M as U,N as oi,O as F,P as ai,Q as xt,R as wt,S as ii,T as vt,U as si,V as di,W as li,X as Ae,Y as De,Z as Pt,_ as He,a as yt,aa as Ct,b as ft,ba as kt,c as me,ca as Lt,d as Sa,da as Oe,e as mt,ea as ui,f as Ma,fa as ci,g as Ia,ga as pi,h as O,ha as yi,i as $a,ia as fi,j as Fa,k as Aa,l as Da,m as Ha,n as Oa,o as Ka,p as gt,q as Fe,r as Ga,s as j,t as Va,u as ht,v as M,w as Wa,x as za,y as Ja,z as ja}from"./chunk-HROMRBBM.js";import{a as Ua,e as Ba,f as _a,g as qa,h as $e,i as bt}from"./chunk-RA33TN5N.js";import{useEffect as Qn,useRef as er}from"react";import{useId as Vn,useRef as Wn}from"react";import{createContext as Ln,useCallback as Sn,useContext as At,useLayoutEffect as Mn,useMemo as St,useRef as Mt}from"react";import{jsx as Ft,jsxs as Kn}from"react/jsx-runtime";var Ke=Ln(null),Dt=" ",It='[inert], [aria-hidden="true" i]',Ue="data-cui-dialog-announcer",In=`:scope > [${Ue}]`,$n=e=>{if(e.closest(It)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=ft(e.ownerDocument);if(t.kind==="none")return{region:e};if(t.kind==="undecidable")return{hidden:"focus is in no open modal dialog and they do not nest, so which one is topmost cannot be told"};let n=t.dialog;if(n.contains(e))return{region:e};let r=n.querySelector(In);return r===null?{hidden:"the topmost open modal dialog neither contains the console nor is a Dialog"}:r.closest(It)!==null?{hidden:'the topmost open modal dialog is a Dialog whose live region has an inert or aria-hidden="true" ancestor'}:{region:r}},Fn=e=>{try{e.querySelectorAll(yt)}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}},ge=150,An=1e3,$t=new WeakMap,Dn=(e,t)=>{let n=$t.get(e)??new Set,r={text:t};$t.set(e,n.add(r)),setTimeout(()=>n.delete(r),ge);let a=e.ownerDocument.createElement("span");a.textContent=[...n].map(o=>o.text).join(Dt),e.replaceChildren(a)},Hn=({locale:e,formatLocale:t,timeZone:n,accessFailure:r,contrast:a="standard",reducedMotion:o=!1,testId:s,children:l})=>{if(At(Ke)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");if(typeof r!="function")throw new TypeError("ConsoleUiRoot: accessFailure must be the host's presenter of access failures (a function)");if(!$e.includes(a))throw new RangeError(`ConsoleUiRoot: contrast must be one of ${$e.join(", ")}: ${String(a)}`);if(typeof o!="boolean")throw new TypeError(`ConsoleUiRoot: reducedMotion must be a boolean: ${String(o)}`);let d=gt(e),[y]=Intl.getCanonicalLocales(t),u=St(()=>new Intl.DateTimeFormat(y,{timeZone:n}).resolvedOptions().timeZone,[y,n]),c=Mt(null),b=Mt(null);Mn(()=>{Fn(c.current.ownerDocument)},[]);let f=Sn(R=>{if(R.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let p=()=>{let{texts:h,settle:T,deadline:x}=b.current;b.current=null,clearTimeout(T),clearTimeout(x);let k=c.current;if(k===null)return;let $=h.join(Dt),oe=$n(k);if("hidden"in oe)throw new Error(`announce: the live region is hidden from assistive technology (${oe.hidden}), so this announcement would be lost: ${$}`);Dn(oe.region,$)},E=b.current;if(E===null){b.current={texts:[R],settle:setTimeout(p,ge),deadline:setTimeout(p,An)};return}E.texts.push(R),clearTimeout(E.settle),E.settle=setTimeout(p,ge)},[]),m=St(()=>({locale:e,formatLocale:y,timeZone:u,labels:d,announce:f,accessFailure:r}),[e,y,u,d,f,r]);return Ft(Ke.Provider,{value:m,children:Kn("div",{"data-cui-root":"","data-cui-contrast":a,"data-cui-reduced-motion":o?"":void 0,"data-cui-surface":"surface","data-cui-fg":"fg","data-testid":s,children:[l,Ft("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${s}-announcer`,ref:c})]})})},C=()=>{let e=At(Ke);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},g=()=>{C()},Be=()=>C().announce,On=()=>C().accessFailure;var v=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};var ae=e=>{let t=e.currentTarget;t.ownerDocument.activeElement!==t&&t.focus({preventScroll:!0})};var B=(e,t)=>{if(e!==void 0&&e.trim()==="")throw new RangeError(`${t}: the key shortcuts must name at least one shortcut, not a blank text: "${e}"`);return e};import{useLayoutEffect as Un}from"react";var Bn=new Set(["abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","mark","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr"]),_n=e=>{for(let t of e.querySelectorAll("*")){let n=t.localName;if(!Bn.has(n)||t.hasAttribute("tabindex")||t.hasAttribute("contenteditable"))return n}return null},D=(e,{testId:t,part:n,host:r})=>{Un(()=>{let a=_n(e.current);if(a!==null)throw new RangeError(`${t}: the ${n} is the content of a ${r} and holds only non-interactive phrasing content, not <${a}>`)})};import{jsx as qn}from"react/jsx-runtime";var P=({fg:e,type:t,face:n,as:r="span",space:a,testId:o,id:s,tabIndex:l,ref:i,children:d})=>(g(),qn(r,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":n,"data-cui-space":a,"data-cui-measure":r==="p"?"reading":void 0,"data-testid":o,id:s,tabIndex:l,ref:i,children:d}));var Gn=/\s/,_e=(e,t)=>{if(e===""||Gn.test(e))throw new RangeError(`The id of ${t} must be one token without whitespace: "${e}"`);return e},Y=(e,t)=>{if(e!==void 0){if(e.reason!==void 0){if(e.reason.trim()==="")throw new RangeError("An unavailable control needs a reason that is not blank");return t}return _e(e.reasonId,"an unavailable control's reason")}},_=(...e)=>{let t=e.filter(n=>n!==void 0);return t.length===0?void 0:t.join(" ")};import{jsx as K,jsxs as Yn}from"react/jsx-runtime";var zn={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"}},qe=({subject:e,children:t})=>{let n=Wn(null);return D(n,e),K("span",{ref:n,children:t})},I=({variant:e,children:t,testId:n,type:r="button",onClick:a,unavailable:o,describedBy:s,expanded:l,controls:i,ref:d,dataAttributes:y,keyShortcuts:u,busy:c,busyLabel:b})=>{g();let f=Vn(),m=Y(o,f),R=c===!0||o!==void 0,p=zn[e],E=h=>{if(ae(h),R){h.preventDefault();return}a?.(h)};return Yn("span",{className:"cui-button-group",children:[K("button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":p.fg,"data-cui-surface":p.surface,"data-cui-type":p.type,"data-testid":n,"aria-disabled":R?!0:void 0,"aria-busy":c===!0?!0:void 0,"aria-describedby":_(s,m),"aria-expanded":l,"aria-controls":i,"aria-keyshortcuts":B(u,n),onClick:E,ref:d,...v(y),children:K(qe,{subject:{testId:n,part:"label",host:"button"},children:c===!0?b:t})}),o?.reason===void 0?null:K(P,{fg:"fg-muted",type:"body",id:f,testId:`${n}-reason`,children:o.reason})]})},Jn=({onNavigate:e,children:t,testId:n,ref:r,keyShortcuts:a})=>(g(),K("button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,"aria-keyshortcuts":B(a,n),onClick:e,ref:r,children:K(qe,{subject:{testId:n,part:"label",host:"button"},children:t})})),jn=/^[^\s#]+$/,Xn=({targetId:e,children:t,testId:n,onFollow:r,dataAttributes:a,keyShortcuts:o})=>{if(g(),!jn.test(e))throw new RangeError(`A fragment link needs the target's id without "#" or white space: "${e}"`);return K("a",{className:"cui-link",href:`#${e}`,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,"aria-keyshortcuts":B(o,n),onClick:r,...v(a),children:K(qe,{subject:{testId:n,part:"label",host:"link"},children:t})})};import{jsx as Ht}from"react/jsx-runtime";var Zn=({gap:e,testId:t,children:n})=>(g(),Ht("div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:n})),Ge=({gap:e,as:t="div",testId:n,children:r})=>(g(),Ht(t,{className:"cui-cluster","data-cui-gap":e,"data-testid":n,children:r}));import{jsx as be,jsxs as Ot}from"react/jsx-runtime";var tr=new Set(["sign-in","sign-in-again","sign-in-again-in-new-window"]),nr=" ",rr=({view:e,handlers:t,testId:n})=>{let r=Be(),a=e.actions.map(({action:l,label:i})=>{let d=t[l];if(d===void 0)throw new TypeError(`AccessFailureNotice: no handler for the action ${JSON.stringify(l)}`);return{action:l,label:i,handler:d}}),o=e.politeness==="status"?[e.title,...e.sentences].join(nr):null,s=er(null);return Qn(()=>{o===null||s.current===o||(s.current=o,r(o))},[r,o]),Ot("div",{className:"cui-access-failure","data-cui-access-failure":e.kind,"data-testid":n,children:[Ot("div",{className:"cui-notice cui-access-failure-message",role:e.politeness==="alert"?"alert":void 0,"data-cui-tone":"warning","data-cui-surface":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-cui-measure":"reading","data-testid":`${n}-message`,children:[be("p",{className:"cui-access-failure-title","data-cui-measure":"reading","data-testid":`${n}-title`,children:e.title}),e.sentences.map(l=>be("p",{className:"cui-access-failure-sentence","data-cui-measure":"reading",children:l},l))]}),a.length===0?null:be(Ge,{gap:"space-2",testId:`${n}-actions`,children:a.map(({action:l,label:i,handler:d})=>be(I,{variant:tr.has(l)?"primary":"secondary",onClick:d,testId:`${n}-${l}`,children:i},l))})]})};var Z=(e,t,n)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),n(t))};import{jsx as ie,jsxs as Kt}from"react/jsx-runtime";var or=({items:e,current:t,onNavigate:n,testId:r})=>{let{labels:a}=C();if(new Set(e.map(o=>o.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(o=>o.id).join(", ")}`);return ie("nav",{className:"cui-breadcrumb","aria-label":a.breadcrumb,"data-testid":r,children:Kt("ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(o=>Kt("li",{className:"cui-breadcrumb-item",children:[ie("a",{className:"cui-link",href:o.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${r}-${o.id}`,onClick:s=>Z(s,o.href,n),children:o.label}),ie("span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},o.id)),ie("li",{className:"cui-breadcrumb-item",children:ie("span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${r}-current`,children:t})})]})})};import{useId as Ut}from"react";import{useCallback as ar}from"react";var ir=229,sr=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),he=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&sr.has(e.type)&&(e.value!==""||e.validity.badInput),Ve=e=>e.nativeEvent.isComposing||e.keyCode===ir,q=(e,t)=>{e.key!=="Escape"||Ve(e)||he(e.target)||(e.stopPropagation(),t())},dr=e=>ar(t=>q(t,e),[e]);import{Fragment as cr,jsx as G,jsxs as se}from"react/jsx-runtime";var Bt=e=>e===void 0?void 0:t=>q(t,e),We=({id:e,title:t,description:n,actions:r,onEscape:a,testId:o,headingRef:s,ref:l,dataAttributes:i,children:d})=>{g();let y=Ut(),u=Bt(a);return se("section",{className:"cui-card",id:e,"aria-labelledby":y,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:l,onKeyDown:u,...v(i),children:[se("div",{className:"cui-card-header",children:[se("div",{className:"cui-card-heading",children:[G("h2",{className:"cui-card-title",id:y,"data-cui-type":"title","data-testid":`${o}-heading`,ref:s,tabIndex:s===void 0?void 0:-1,children:t}),n===void 0?null:G("div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),r===void 0?null:G("div",{className:"cui-card-actions",children:r})]}),d]})},lr={3:"h3",4:"h4"},ur=({id:e,title:t,subtitle:n,level:r=3,region:a=!1,onEscape:o,testId:s,headingRef:l,ref:i,dataAttributes:d,children:y})=>{g();let u=Ut(),c=Bt(o),b=lr[r],f=se(cr,{children:[se("div",{className:"cui-card-section-heading",children:[G(b,{className:"cui-card-section-title",id:u,"data-cui-type":"body","data-testid":`${s}-heading`,ref:l,tabIndex:l===void 0?void 0:-1,children:t}),n===void 0?null:G("div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),y]});return a?G("section",{className:"cui-card-section",id:e,"aria-labelledby":u,"data-testid":s,ref:i,onKeyDown:c,...v(d),children:f}):G("div",{className:"cui-card-section",id:e,"data-testid":s,ref:i,...v(d),children:f})};import{jsx as _t}from"react/jsx-runtime";var pr=({label:e,code:t,testId:n})=>(g(),_t("section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":n,children:_t("pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${n}-code`,children:t})}));import{useId as fr}from"react";import{jsx as yr}from"react/jsx-runtime";var Q=({ruleKey:e,css:t})=>yr("style",{href:e,precedence:"cui",children:t});import{jsx as L,jsxs as V}from"react/jsx-runtime";var mr=({caption:e,attributes:t,columns:n,attributePx:r,columnMinPx:a,testId:o})=>{g();let s=fr();for(let u of[r,a])if(!(Number.isFinite(u)&&u>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${u}`);if(n.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let u of n)for(let c of t)if(!Object.hasOwn(u.cells,c.key))throw new RangeError(`Column "${u.key}" has no value for attribute "${c.key}"`);let l=r+n.length*a,i=`cui-comparison-a${r}-c${a}-n${n.length}`,d=u=>`[data-cui-comparison="${i}"][data-cui-comparison-layout="${u}"]`,y=`${d("table")}{display:none}@container (min-width:${F(l)}){${d("table")}{display:block}${d("stack")}{display:none}}`;return V("div",{className:"cui-container","data-cui-stack-below-px":l,"data-testid":o,children:[L(Q,{ruleKey:i,css:y}),L("div",{className:"cui-comparison-frame","data-cui-comparison":i,"data-cui-comparison-layout":"table",children:V("table",{className:"cui-comparison-table","data-cui-type":"body",children:[L("caption",{className:"cui-visually-hidden",children:e}),V("colgroup",{children:[L("col",{style:{width:F(r)}}),n.map(u=>L("col",{},u.key))]}),L("thead",{children:V("tr",{children:[L("td",{}),n.map(u=>L("th",{scope:"col",children:u.heading},u.key))]})}),L("tbody",{children:t.map(u=>V("tr",{children:[L("th",{scope:"row",children:u.label}),n.map(c=>L("td",{children:c.cells[u.key]("table")},c.key))]},u.key))})]})}),L("div",{className:"cui-comparison-stack","data-cui-comparison":i,"data-cui-comparison-layout":"stack",children:n.map((u,c)=>{let b=`${s}-column-${c}`;return V("div",{className:"cui-comparison-column",role:"group","aria-labelledby":b,"data-cui-type":"body",children:[L("div",{className:"cui-comparison-heading",id:b,children:u.heading}),L("dl",{className:"cui-comparison-list",children:t.map(f=>V("div",{children:[L("dt",{children:f.label}),L("dd",{children:u.cells[f.key]("stack")})]},f.key))})]},u.key)})})]})};import{Fragment as Tr,useCallback as Er,useId as xr,useLayoutEffect as Vt,useRef as Xe}from"react";var de="[data-cui-row-focus]",ze="[data-cui-row-detail]",gr=e=>e===null?[]:[...e.querySelectorAll(`:scope > ${de}`)],qt=(e,t)=>{let n=new Map;t!==null&&n.set(t,0);let r=-1;for(let a of e===null?[]:e.children)a.matches(de)?(r+=1,n.set(a,r)):r>=0&&a.matches(ze)&&n.set(a,r);return n},Gt=(e,t,n,r)=>{let a=gr(t);if(a.length===0)return n;let o=r.get(e);if(o===void 0)throw new RangeError(`rowFocusTarget: <${e.localName}> left holding focus with no position in the table (only its rows, row details and empty text hold one)`);return a[Math.min(o,a.length-1)]};import{useCallback as br,useLayoutEffect as Je,useReducer as hr,useRef as je}from"react";var Rr=e=>e+1,le=e=>{let t=je(e),n=je(null),r=je(!1),[,a]=hr(Rr,0),o=br((s=>()=>{r.current&&s.contains(document.activeElement)&&(n.current=s,a())}),[]);return Je(()=>(r.current=!0,()=>{r.current=!1,n.current=null}),[]),Je(()=>{t.current=e}),Je(()=>{let s=n.current;if(s===null)return;n.current=null;let l=[null,document.body].includes(document.activeElement);s.isConnected||!l||t.current(s)?.focus()}),o};import{jsx as S,jsxs as Re}from"react/jsx-runtime";var wr=new Map,vr='a[href], audio[controls], button, details, embed, iframe, img[usemap], input:not([type="hidden"]), label, select, textarea, video[controls], [tabindex], [contenteditable]',Pr=(e,t,n)=>{Vt(()=>{let r=e.current;if(t!=="row-compact"||r===null)return;let a=[...r.querySelectorAll(vr)].find(o=>o.parentElement!==r);if(a!==void 0)throw new RangeError(`${n}: a compact row holds no control or focus target (a ${j} px target does not fit its ${ht} px; use row-control), not <${a.localName}>`)})},Nr=(e,t)=>{let n=e.filter(a=>a.rowHeader===!0).map(a=>a.key);if(n.length>1)throw new RangeError(`${t}: a table has at most one row header column, not ${n.length} (${n.join(", ")})`);let r=e.find(a=>a.rowHeader!==!0&&a.rowHeaderNote!==void 0);if(r!==void 0)throw new RangeError(`${t}: a row header note belongs to the row header column, not to ${r.key}`)},Cr=e=>e==null?null:S("div",{className:"cui-table-header-note",children:e}),kr=(e,t,n,r,a)=>{let o=e.open(t);return S("tr",{ref:a,hidden:!o,"data-cui-row-detail":o?"open":"closed","data-testid":`${r}-detail`,children:S("td",{colSpan:n,id:e.id(t),children:o?e.render(t):null})})},Lr=({caption:e,captionHidden:t,columns:n,rows:r,rowKey:a,rowTestId:o,rowData:s,rowSize:l,rowDetail:i,empty:d,testId:y,ref:u})=>{g();let c=xr(),b=Xe(null);Pr(b,l,y);let f=Xe(null),m=Xe(wr),R=le(h=>Gt(h,b.current,f.current,m.current));Vt(()=>{m.current=qt(b.current,f.current)});let p=Er(h=>{f.current=h;let T=R(h);return()=>{f.current=null,T()}},[R]),E=wt(n);return Nr(n,y),S("div",{className:"cui-container","data-testid":y,ref:u,children:r.length===0?S(P,{as:"p",fg:"fg-muted",type:"prose",tabIndex:-1,ref:p,testId:`${y}-empty`,children:d}):S("section",{ref:R,className:"cui-table-frame",tabIndex:0,"aria-labelledby":c,"data-testid":`${y}-frame`,children:Re("table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":l,style:{"--cui-table-min":F(E)},children:[S("caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:c,children:e}),S("colgroup",{children:n.map(h=>S("col",{style:h.width.fixedPx===void 0?void 0:{width:F(h.width.fixedPx)}},h.key))}),S("thead",{children:S("tr",{children:n.map(h=>Re("th",{scope:"col","data-cui-align":h.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:[h.header,h.note===void 0?null:S("div",{className:"cui-table-header-note",children:h.note})]},h.key))})}),S("tbody",{ref:b,children:r.map(h=>Re(Tr,{children:[S("tr",{ref:R,tabIndex:-1,"data-cui-row-focus":"","data-testid":o,...v(s?.(h)),children:n.map(T=>T.rowHeader===!0?Re("th",{scope:"row","data-cui-align":T.align,children:[T.cell(h),T.rowHeaderNote===void 0?null:Cr(T.rowHeaderNote(h))]},T.key):S("td",{"data-cui-align":T.align,children:T.cell(h)},T.key))}),i===void 0?null:kr(i,h,n.length,o,R)]},a(h)))})]})})})};import{jsx as Ye,jsxs as Mr}from"react/jsx-runtime";var Sr=({items:e,testId:t})=>{if(g(),new Set(e.map(n=>n.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(n=>n.key).join(", ")}`);return Ye("dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(n=>Mr("div",{className:"cui-description-row","data-testid":`${t}-${n.key}`,children:[Ye("dt",{"data-cui-fg":"fg-secondary",children:n.term}),Ye("dd",{"data-cui-fg":"fg",children:n.description})]},n.key))})};import{useId as Wt,useLayoutEffect as zt,useRef as Ze}from"react";import{jsx as ue,jsxs as jt}from"react/jsx-runtime";var Jt=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},Ir=(e,t)=>{if(t===null||!e.contains(t))throw new RangeError("A dialog's initial focus must be an element inside the dialog");return t},$r=(e,t)=>{if(t.focus(),e.ownerDocument.activeElement!==t)throw e.close(),new RangeError("A dialog's initial focus must be an element that takes focus")},Fr=e=>e instanceof HTMLInputElement&&e.type==="search",Ar=({title:e,description:t,open:n,onClose:r,initialFocus:a,testId:o,children:s})=>{let{labels:l}=C(),i=Wt(),d=Wt(),y=Ze(null),u=Ze(null),c=Ze(!1);return zt(()=>{let p=y.current;if(n&&!p.open){let E=a===void 0?null:Ir(p,a.current);u.current=p.ownerDocument.activeElement,p.showModal(),E!==null&&$r(p,E)}else!n&&p.open&&p.close()},[n,a]),zt(()=>{let p=y.current;return()=>{p.open&&(p.close(),Jt(u.current),u.current=null)}},[]),jt("dialog",{className:"cui-dialog","aria-labelledby":i,"aria-describedby":t===void 0?void 0:d,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:y,onClose:p=>{p.currentTarget.open||(Jt(u.current),u.current=null,n&&r())},onCancel:p=>{let E=c.current;c.current=!1,(E||he(p.currentTarget.ownerDocument.activeElement))&&p.preventDefault()},onKeyDownCapture:p=>{let E=Ve(p);c.current=E,p.key==="Escape"&&!E&&he(p.target)&&!Fr(p.target)&&p.preventDefault()},onKeyUpCapture:()=>{c.current=!1},children:[jt("div",{className:"cui-dialog-header",children:[ue("h2",{className:"cui-dialog-title",id:i,"data-cui-type":"title",children:e}),ue("div",{className:"cui-dialog-actions",children:ue(I,{variant:"secondary",testId:`${o}-close`,onClick:()=>y.current?.close(),children:l.close})})]}),t===void 0?null:ue("div",{id:d,"data-cui-measure":"reading","data-testid":`${o}-description`,children:t}),s,ue("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[Ue]:"","data-testid":`${o}-announcer`})]})};import{useId as Dr,useRef as Hr}from"react";import{jsx as Qe,jsxs as Xt}from"react/jsx-runtime";var Or=({summary:e,open:t,onOpenChange:n,testId:r,children:a})=>{g();let o=Dr(),s=Hr(null);return D(s,{testId:r,part:"summary",host:"button"}),Xt("div",{className:"cui-disclosure","data-testid":r,children:[Xt("button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":o,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${r}-button`,onClick:()=>n(!t),children:[Qe("span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),Qe("span",{ref:s,children:e})]}),Qe("div",{className:"cui-disclosure-panel",id:o,hidden:!t,"data-testid":`${r}-panel`,children:a})]})};import{accessFailureKindOfStatus as Ur}from"@aiquants/auth-core";import{Fragment as Br}from"react";import{jsx as Yt}from"react/jsx-runtime";var Kr=({tone:e,testId:t,children:n})=>(g(),Yt("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-cui-measure":"reading","data-testid":t,children:n})),ce=({occurrence:e,testId:t,children:n})=>(g(),Yt("div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-measure":"reading","data-cui-occurrence":e,"data-testid":t,children:n},e));import{jsx as Zt}from"react/jsx-runtime";var et=({failure:e,place:t,deniedSentence:n,failed:r,retry:a,testId:o})=>{let{labels:s,accessFailure:l}=C();if(n.trim()==="")throw new RangeError("FailureMessage: deniedSentence must be a non-empty sentence");let i=e.status===null?null:Ur(e.status);return i===null?Zt(ce,{occurrence:e.occurrence,testId:o,children:s.failureSentence(e,r)}):Zt(Br,{children:l({kind:i,place:t,deniedSentence:i==="forbidden"?s.forbiddenBecause(n,e.reason):null,retry:a})},e.occurrence)};import{useId as ee}from"react";import{Fragment as Xr,jsx as w,jsxs as A}from"react/jsx-runtime";var _r=/\s/,tt=e=>{if(e!==void 0&&(typeof e!="string"||e===""||_r.test(e)))throw new RangeError(`A control's name must be one token without whitespace: "${e}"`);return e},Qt=e=>{if(e!==void 0&&!(Number.isInteger(e)&&e>0))throw new RangeError(`A field's maxLength must be a positive integer: ${e}`);return e},te=({description:e,error:t,errorId:n})=>{g();let r=ee(),a=ee(),o=ee(),s=n===void 0?o:_e(n,"a field's error"),l=[e===void 0?null:a,t===void 0?null:s].filter(d=>d!==null).join(" ");return{control:{id:r,"aria-describedby":l===""?void 0:l,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:s}},ne=({description:e,error:t,descriptionId:n,errorId:r,testId:a})=>A(Xr,{children:[e===void 0?null:w(P,{as:"p",fg:"fg-muted",type:"body",id:n,testId:`${a}-description`,children:e}),t===void 0?null:w(P,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${a}-error`,children:t})]}),Te=({htmlFor:e,hidden:t,children:n})=>w("label",{className:t===!0?"cui-visually-hidden":"cui-field-label",htmlFor:e,"data-cui-type":"body",children:n}),qr=({label:e,description:t,error:n,errorId:r,testId:a,children:o})=>{let{control:s,descriptionId:l,errorId:i}=te({label:e,description:t,error:n,errorId:r});return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":a,children:[w(Te,{htmlFor:s.id,hidden:void 0,children:e}),o(s),w(ne,{description:t,error:n,descriptionId:l,errorId:i,testId:a})]})},en=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,type:s,name:l,maxLength:i,list:d,autoComplete:y,inputMode:u,prefix:c,labelHidden:b,required:f,testId:m,ref:R})=>{let{control:p,descriptionId:E,errorId:h}=te({label:e,description:t,error:n,errorId:r}),T=ee();if(c!==void 0&&c.trim()==="")throw new RangeError("An input's prefix must not be blank");if(i!==void 0&&s==="datetime-local")throw new RangeError(`A ${s} input takes no maxLength: ${i}`);let x=s==="password",k=w("input",{className:"cui-input",type:s,name:tt(l),maxLength:Qt(i),value:a,list:d,autoComplete:y,inputMode:u,spellCheck:x?!1:void 0,autoCapitalize:x?"none":void 0,required:f,onChange:$=>o($.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":m,ref:R,...p,"aria-describedby":_(c===void 0?void 0:T,p["aria-describedby"])});return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${m}-field`,children:[w(Te,{htmlFor:p.id,hidden:b,children:e}),c===void 0?k:A("div",{className:"cui-input-group",children:[w("span",{className:"cui-input-prefix",id:T,"data-cui-fg":"fg-secondary","data-cui-surface":"sunken","data-cui-type":"body","data-testid":`${m}-prefix`,children:c}),k]}),w(ne,{description:t,error:n,descriptionId:E,errorId:h,testId:m})]})},Gr=e=>w(en,{...e}),Vr=e=>w(en,{...e,type:"password"}),Wr=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,name:s,maxLength:l,required:i,testId:d,ref:y})=>{let{control:u,descriptionId:c,errorId:b}=te({label:e,description:t,error:n,errorId:r});return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${d}-field`,children:[w(Te,{htmlFor:u.id,hidden:void 0,children:e}),w("textarea",{className:"cui-input cui-textarea",name:tt(s),maxLength:Qt(l),value:a,required:i,onChange:f=>o(f.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":d,ref:y,...u}),w(ne,{description:t,error:n,descriptionId:c,errorId:b,testId:d})]})},zr=({label:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:s,name:l,labelHidden:i,unavailable:d,testId:y,ref:u})=>{let{control:c,descriptionId:b,errorId:f}=te({label:e,description:t,error:n,errorId:r}),m=ee(),R=Y(d,m);return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${y}-field`,children:[w(Te,{htmlFor:c.id,hidden:i,children:e}),w("select",{className:"cui-input",name:tt(l),value:a,onChange:p=>{d===void 0&&s(p.target.value)},"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":y,ref:u,...c,"aria-disabled":d===void 0?void 0:!0,"aria-describedby":_(c["aria-describedby"],R),children:o.map(p=>w("option",{value:p.value,children:p.label},p.value))}),w(ne,{description:t,error:n,descriptionId:b,errorId:f,testId:y}),d?.reason===void 0?null:w(P,{as:"p",fg:"fg-muted",type:"body",id:m,testId:`${y}-reason`,children:d.reason})]})},Jr=({legend:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:s,testId:l,ref:i})=>{let d=ee(),{control:y,descriptionId:u,errorId:c}=te({label:e,description:t,error:n,errorId:r});return A("fieldset",{className:"cui-radio-group","aria-describedby":y["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[w("legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),o.map((b,f)=>A("label",{className:"cui-radio","data-cui-type":"body",children:[w("input",{type:"radio",name:d,value:b.value,checked:b.value===a,onChange:()=>s(b.value),"aria-invalid":y["aria-invalid"],"data-testid":`${l}-option-${b.value}`,ref:f===0?i:void 0}),w("span",{children:b.label})]},b.value)),w(ne,{description:t,error:n,descriptionId:u,errorId:c,testId:l})]})},jr=({legend:e,description:t,error:n,errorId:r,values:a,options:o,onValuesChange:s,testId:l,ref:i})=>{let{control:d,descriptionId:y,errorId:u}=te({label:e,description:t,error:n,errorId:r}),c=o.map(m=>m.value);if(c.length===0||new Set(c).size!==c.length)throw new RangeError(`A check box group needs at least one option with unique values: ${c.join(", ")}`);let b=a.filter(m=>!c.includes(m));if(b.length>0)throw new RangeError(`The chosen values are not options: ${b.join(", ")}`);let f=new Set(a);return A("fieldset",{className:"cui-checkbox-group","aria-describedby":d["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[w("legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),o.map((m,R)=>A("label",{className:"cui-checkbox","data-cui-type":"body",children:[w("input",{type:"checkbox",value:m.value,checked:f.has(m.value),onChange:()=>s(c.filter(p=>p===m.value?!f.has(p):f.has(p))),"aria-invalid":d["aria-invalid"],"data-testid":`${l}-option-${m.value}`,ref:R===0?i:void 0}),w("span",{children:m.label})]},m.value)),w(ne,{description:t,error:n,descriptionId:y,errorId:u,testId:l})]})};import{createContext as Yr,useContext as Zr,useId as an,useMemo as Qr}from"react";import{Fragment as un,jsx as N,jsxs as Ee}from"react/jsx-runtime";var sn=Yr(null),tn="surface",nn={neutral:{face:"surface",line:"border-control"},info:{face:"info-tint",line:"info-accent"},success:{face:"success-tint",line:"success-accent"},warning:{face:"warning-tint",line:"warning-accent"},danger:{face:"danger-tint",line:"danger-accent"}},rn={face:"info-tint",line:"info-accent"},dn={normal:"border-control",high:"info-accent"},eo=["normal","high"],to=[1,2,3,4],H=M.space["space-2"],no="fg",ro="fg-secondary",ln=e=>{let t=Zr(sn);if(t===null)throw new Error(`${e} must be rendered inside Figure`);return t},nt=(e,t,n)=>{if(!(Number.isFinite(n)&&n>0&&n%4===0))throw new RangeError(`${e}: ${t} must be a positive multiple of the ${4} px lattice: ${n}`)},oo=e=>{g();let t=an(),{kind:n,widthPx:r,heightPx:a,testId:o,dataAttributes:s,children:l}=e;nt(o,"widthPx",r),nt(o,"heightPx",a);let i=Qr(()=>({kind:n,widthPx:r,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[n,r,a,t]),d=Ee(un,{children:[N("defs",{children:eo.map(b=>N("marker",{id:i.arrowIds[b],viewBox:`0 0 ${H} ${H}`,refX:H,refY:H/2,markerWidth:H,markerHeight:H,markerUnits:"userSpaceOnUse",orient:"auto","data-cui-emphasis":b,children:N("path",{d:`M 0 0 L ${H} ${H/2} L 0 ${H} z`,"data-cui-stroke":dn[b],"data-testid":`${o}-arrow-${b}`})},b))}),N(sn.Provider,{value:i,children:l})]});if(e.kind==="group"){let{label:b,onEscape:f}=e;if(!O(b))throw new RangeError(`${o}: a group figure's label must hold a readable character: ${JSON.stringify(b)}`);return N("div",{className:"cui-figure-frame","data-testid":`${o}-frame`,children:N("svg",{className:"cui-figure",role:"group","aria-label":b,viewBox:`0 0 ${r} ${a}`,"data-cui-figure":"group","data-cui-surface":tn,"data-cui-face":"sans",style:{"--cui-figure-inline":F(r),"--cui-figure-block":F(a)},onKeyDown:f===void 0?void 0:m=>q(m,f),"data-testid":o,...v(s),children:d})})}let{viewBox:y,pointer:u,svgRef:c}=e;return N("div",{className:"cui-container","data-testid":`${o}-frame`,children:N("svg",{ref:c,className:"cui-figure","aria-hidden":"true",viewBox:y===void 0?`0 0 ${r} ${a}`:y,"data-cui-figure":"decorative","data-cui-surface":tn,"data-cui-face":"sans","data-cui-pan":u===void 0?void 0:"true","data-cui-cursor":u?.cursor,style:{"--cui-figure-inline":F(r),"--cui-figure-ratio":String(a/r)},"data-testid":o,...v(s),...u?.handlers,children:d})})},on=(e,t)=>{try{return t()}catch(n){throw new RangeError(`${e}: ${n.message}`,{cause:n})}},ao=(e,t,n)=>{for(let r of t){let a=bt.light[r.fg],o=n.find(s=>a[s]===void 0);if(o!==void 0)throw new RangeError(`${e}: the note ${JSON.stringify(r.text)} in ${r.fg} is not in the contrast table on ${o}, a face the node takes`)}},io=e=>{g();let t=ln("FigureNode"),n=an(),{x:r,y:a,shape:o,tone:s,outline:l,selected:i,name:d,title:y,press:u,testId:c,dataAttributes:b}=e,f=e.notes===void 0?[]:e.notes;if(!(Number.isFinite(r)&&Number.isFinite(a)))throw new RangeError(`${c}: a node's position must be finite: ${r}, ${a}`);if(t.kind==="group"&&u===void 0)throw new RangeError(`${c}: every node of a group figure must be pressable (pass press)`);if(t.kind==="decorative"&&u!==void 0)throw new RangeError(`${c}: a node of a decorative figure cannot be pressed (it is hidden from assistive technology)`);if(u!==void 0&&!O(u.label))throw new RangeError(`${c}: a pressable node's label must hold a readable character: ${JSON.stringify(u.label)}`);let m=i?rn:nn[s];ao(c,f,[nn[s].face,rn.face]);let R,p,E;if(o.kind==="box"){if(d===null)throw new RangeError(`${c}: a box's name is drawn inside the box and sizes it, so it cannot be null (only a disc may be drawn without a name)`);let T=on(c,()=>Rt({name:d,notes:f.map(k=>k.text)}));if(nt(c,"a box's widthPx",o.widthPx),o.widthPx<T.minWidthPx)throw new RangeError(`${c}: a box ${o.widthPx} px wide is narrower than its lines under the widest 1.4.12 spacing (${T.minWidthPx} px)`);R={width:o.widthPx,height:T.heightPx,left:r,top:a};let x=Tt(f.length);p=Ee("g",{"data-cui-surface":m.face,children:[N("rect",{className:"cui-figure-plate",width:o.widthPx,height:T.heightPx,rx:M.radius["radius-item"],"data-cui-fill":m.face,"data-cui-stroke":m.line,"data-testid":`${c}-plate`}),N("text",{className:"cui-figure-name",x:x.insetPx,y:x.namePx,fontSize:M.type.body.size,"data-cui-fg":no,"data-cui-figure-type":"body","data-testid":`${c}-name`,children:d}),f.map((k,$)=>N("text",{x:x.insetPx,y:x.notesPx[$],fontSize:M.type.caption.size,"data-cui-fg":k.fg,"data-cui-figure-type":"caption","data-testid":`${c}-note-${$}`,children:k.text},$))]}),E=N("rect",{className:"cui-figure-ring",x:-U,y:-U,width:o.widthPx+2*U,height:T.heightPx+2*U,rx:M.radius["radius-item"]+U,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}else{let T=on(c,()=>Et(d,o.radiusPx));R={width:2*o.radiusPx,height:2*o.radiusPx,left:r-o.radiusPx,top:a-o.radiusPx},p=Ee(un,{children:[N("g",{"data-cui-surface":m.face,children:N("circle",{className:"cui-figure-plate",r:o.radiusPx,"data-cui-fill":m.face,"data-cui-stroke":m.line,"data-testid":`${c}-plate`})}),d===null?null:N("text",{className:"cui-figure-label",x:0,y:T.extentBelowPx-M.type.caption.lineHeight/2,fontSize:M.type.caption.size,"data-cui-fg":ro,"data-cui-figure-type":"caption","data-testid":`${c}-name`,children:d})]}),E=N("circle",{className:"cui-figure-ring",r:o.radiusPx+U,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}if(u!==void 0){if(R.width<j||R.height<j)throw new RangeError(`${c}: a pressable node must be at least the ${j} px target: ${R.width} \xD7 ${R.height}`);if(R.left<X||R.top<X||R.left+R.width+X>t.widthPx||R.top+R.height+X>t.heightPx)throw new RangeError(`${c}: a pressable node must keep ${X} px to the figure's edge for its focus ring`)}let h=u===void 0?{}:{role:"button",tabIndex:0,"aria-label":u.label,"aria-describedby":u.description===void 0?void 0:n,"aria-expanded":u.expanded,"aria-controls":u.expanded?u.controls:void 0,onClick:T=>{T.currentTarget.focus(),u.onPress()},onKeyDown:T=>{T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),T.repeat||u.onPress())}};return Ee("g",{className:"cui-figure-node",transform:`translate(${r} ${a})`,"data-cui-tone":s,"data-cui-outline":l,"data-selected":String(i),...h,"data-testid":c,...v(b),children:[y===void 0?null:N("title",{children:y}),u?.description===void 0?null:N("desc",{id:n,"data-testid":`${c}-description`,children:u.description}),u===void 0?null:E,p]})},so=({d:e,emphasis:t,weight:n,arrow:r,title:a,testId:o,dataAttributes:s})=>{g();let l=ln("FigureEdge");if(!to.includes(n))throw new RangeError(`${o}: an edge's weight must be 1, 2, 3 or 4: ${n}`);return N("path",{className:"cui-figure-edge",d:e,markerEnd:r?`url(#${l.arrowIds[t]})`:void 0,"data-cui-stroke":dn[t],"data-cui-weight":n,"data-cui-emphasis":t,"data-testid":o,...v(s),children:a===void 0?null:N("title",{children:a})})};import{jsx as co}from"react/jsx-runtime";var lo={1:"h1",2:"h2",3:"h3"},uo=({level:e,type:t,testId:n,headingRef:r,children:a})=>{g();let o=lo[e];return co(o,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":n,ref:r,tabIndex:r===void 0?void 0:-1,children:a})};import{jsx as fo}from"react/jsx-runtime";var po={removed:"danger-tint",added:"success-tint"},yo=({kind:e,testId:t,children:n})=>{if(g(),n==="")throw new RangeError(`${t}: a changed fragment must hold at least one character`);return fo(e==="removed"?"del":"ins",{className:"cui-change","data-cui-change":e,"data-cui-surface":po[e],"data-cui-fg":"fg","data-testid":t,children:n})};import{jsx as bo}from"react/jsx-runtime";var mo={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"}},go={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},rt=({tone:e,variant:t,testId:n,dataAttributes:r,children:a})=>{g();let o=t==="tint"?mo[e]:{fg:"on-solid",surface:go[e]};return bo("span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":o.fg,"data-cui-surface":o.surface,"data-cui-type":"caption","data-testid":n,...v(r),children:a})};import{useId as ho}from"react";import{jsx as pe,jsxs as Ro}from"react/jsx-runtime";var ot=({label:e,valueText:t,value:n,max:r,testId:a})=>{g();let o=ho();if(r!==null){if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Progress maximum must be positive: ${r}`);if(n===null||!(Number.isFinite(n)&&n>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${n}`)}let s=r===null?null:{max:r,now:Math.min(n,r)};return Ro("div",{className:"cui-progress","data-testid":a,children:[pe(P,{as:"p",fg:"fg",type:"body",id:o,children:e}),pe("div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":o,"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":`${a}-bar`,children:pe("div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:s===null?void 0:{inlineSize:`${s.now/s.max*100}%`},"data-testid":`${a}-fill`})}),pe("div",{"aria-hidden":"true",children:pe(P,{as:"p",fg:"fg-secondary",type:"body",testId:`${a}-value`,children:t})})]})};import{jsx as xe,jsxs as cn}from"react/jsx-runtime";var To=({title:e,status:t,progress:n,cancel:r,testId:a,children:o})=>cn(We,{title:e,actions:r===void 0?void 0:xe(I,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${a}-cancel`,children:r.label}),testId:a,children:[cn("div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-status`,children:[xe("span",{className:"cui-visually-hidden",children:`${e} `}),xe(rt,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),n===void 0?null:xe(ot,{...n,testId:`${a}-progress`}),o]});import{createContext as Eo,useContext as xo}from"react";import{jsx as ye}from"react/jsx-runtime";var at=Eo(null),wo="space-2",vo=e=>{g();let{gap:t,label:n,id:r,hidden:a,testId:o,children:s}=e;if(n!==void 0&&!O(n))throw new RangeError(`${o}: a list's label must hold a readable character: ${JSON.stringify(n)}`);let l=e.marker==="none"?void 0:e.type,i=l!==void 0,d=e.marker==="number"||e.marker==="none"&&e.ordered?"ol":"ul";return ye(at.Provider,{value:e.marker,children:ye(d,{className:"cui-list",role:"list","aria-label":n,id:r,hidden:a,"data-cui-gap":i?void 0:t,"data-cui-row-gap":i?t:void 0,"data-cui-column-gap":i?wo:void 0,"data-cui-marker":i?e.marker:void 0,"data-cui-type":l,"data-testid":o,children:s})})},Po=({testId:e,dataAttributes:t,children:n})=>{g();let r=xo(at);if(r===null)throw new Error("ListItem must be rendered inside List, not inside another ListItem");return ye("li",{className:"cui-list-item","data-testid":e,...v(t),children:ye("div",{className:"cui-list-body","data-cui-measure":r==="none"?void 0:"reading",children:ye(at.Provider,{value:null,children:n})})})};import{useCallback as pn,useLayoutEffect as No,useRef as we}from"react";import{jsx as ve,jsxs as So}from"react/jsx-runtime";var yn=e=>[...e.querySelectorAll(de)].filter(t=>{let n=t.closest(ze);return n===null||!e.contains(n)}),Co=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 n=yn(t);if(n.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${n.length} ${de} elements for ${e.count} rows`);return n},ko=(e,t)=>{let n=-1;return e.forEach((r,a)=>{t.has(r)&&(n=a)}),e[n+1]},Lo=({onLoad:e,busy:t,done:n,failure:r,limit:a,rows:o,testId:s})=>{let{formatLocale:l,labels:i}=C(),d=we(null),y=we(null),u=we(null),c=we(!1),b=()=>{let p=o.ref.current;d.current={shown:new Set(p===null?[]:yn(p)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};No(()=>{let p=c.current;c.current=!1;let E=d.current;if(E===null)return;let h=Co(o);if(t){E.busySeen=!0,E.shown=new Set(h);return}let T=ko(h,E.shown),x=r!==null&&r.occurrence!==E.failureOccurrence;if(!(E.busySeen||T!==void 0||x||n)||(d.current=null,x||T===void 0))return;let k=[null,document.body].includes(document.activeElement);(u.current!==null&&document.activeElement===u.current||p&&k)&&T.focus()});let f=le(()=>n?y.current:u.current),m=pn((p=>{u.current=p;let E=f(p);return()=>{u.current=null,c.current=p===document.activeElement,E()}}),[f]),R=pn((p=>{y.current=p;let E=f(p);return()=>{y.current=null,E()}}),[f]);return n?ve("div",{className:"cui-load-more","data-testid":s,children:ve(P,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:R,testId:`${s}-end`,children:i.endOfRecords})}):So("div",{className:"cui-load-more","data-testid":s,children:[ve(I,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:b,ref:m,testId:`${s}-button`,children:i.loadMore(me(a,l))}),r===null?null:ve(ce,{occurrence:r.occurrence,testId:`${s}-failure`,children:i.loadFailed(r.reason)})]})};import{jsx as it,jsxs as fn}from"react/jsx-runtime";var Mo=({master:e,detail:t,masterMinPx:n,detailMinPx:r,testId:a})=>{g();let o=xt({masterMinPx:n,detailMinPx:r,gapPx:M.space["space-6"]});return fn("div",{className:"cui-container","data-testid":a,children:[it(Q,{ruleKey:o.key,css:o.css}),fn("div",{className:"cui-master-detail","data-cui-master-detail":o.key,children:[it("div",{className:"cui-master-detail-pane","data-testid":`${a}-master`,children:e}),it("div",{className:"cui-master-detail-pane","data-testid":`${a}-detail`,children:t})]})]})};import{jsx as Pe}from"react/jsx-runtime";var Ne=e=>{let{formatLocale:t,labels:n}=C(),{testId:r}=e;if(e.keep===void 0){let{value:s,unit:l}=e;if(l!==void 0&&!O(l))throw new RangeError(`${r}: a unit must hold a readable character: ${JSON.stringify(l)}`);if(s===null)return Pe("span",{className:"cui-measured","data-measured":"false","data-testid":r,children:n.unmeasured});let i=me(s,t);return Pe("span",{className:"cui-measured","data-measured":"true","data-testid":r,children:mt(i,l)})}let{text:a,keep:o}=e;if(a===null)return Pe("span",{className:"cui-measured","data-measured":"false","data-cui-keep":o,"data-testid":r,children:n.unmeasured});if(!O(a))throw new RangeError(`${r}: a measured text must hold a readable character (pass null when the value was not measured): ${JSON.stringify(a)}`);return Pe("span",{className:"cui-measured","data-measured":"true","data-cui-keep":o,"data-testid":r,children:a})};import{jsx as Ce,jsxs as $o}from"react/jsx-runtime";var Io=({label:e,value:t,min:n,max:r,valueText:a,testId:o})=>{if(g(),!(Number.isFinite(n)&&Number.isFinite(r)&&n<r))throw new RangeError(`Meter needs a finite range with min below max: min ${n}, max ${r}`);if(!(Number.isFinite(t)&&t>=n&&t<=r))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${n}, max ${r}`);return $o("span",{className:"cui-meter","data-testid":o,children:[Ce("span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":t,"aria-valuetext":a,"data-cui-surface":"sunken","data-testid":`${o}-bar`,children:Ce("span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-n)/(r-n)*100}%`},"data-testid":`${o}-fill`})}),Ce("span",{"aria-hidden":"true",children:Ce(P,{fg:"fg",type:"body",testId:`${o}-value`,children:a})})]})};import{useId as Fo,useRef as Ao}from"react";import{jsx as st,jsxs as Oo}from"react/jsx-runtime";var Do={ArrowLeft:-1,ArrowRight:1},Ho=({label:e,items:t,value:n,onValueChange:r,testId:a,panelDescribedBy:o,children:s})=>{g();let l=Fo(),i=Ao(new Map);if(t.length===0)throw new RangeError("PanelTabs needs at least one tab");let d=t.map(m=>m.id);if(new Set(d).size!==d.length)throw new RangeError(`Tab keys must be unique: ${d.join(", ")}`);let y=d.indexOf(n);if(y<0)throw new RangeError(`The selected tab "${n}" is not one of the tabs: ${d.join(", ")}`);let u=m=>`${l}-tab-${m}`,c=`${l}-panel`,b=m=>{let R=t[m];R.id!==n&&r(R.id),i.current.get(R.id)?.focus()};return Oo("div",{className:"cui-panel-tabs","data-testid":a,children:[st("div",{className:"cui-tabs-list",role:"tablist","aria-label":e,onKeyDown:m=>{let R=t.findIndex(T=>i.current.get(T.id)===m.target),p=R<0?y:R,E=Do[m.key],h;if(E!==void 0){let T=getComputedStyle(m.currentTarget).direction==="rtl"?-E:E;h=(p+T+t.length)%t.length}else if(m.key==="Home")h=0;else if(m.key==="End")h=t.length-1;else return;m.preventDefault(),b(h)},children:t.map((m,R)=>{let p=R===y;return st("button",{className:"cui-tab cui-panel-tab",type:"button",role:"tab",id:u(R),"aria-selected":p,"aria-controls":c,tabIndex:p?0:-1,"data-cui-fg":p?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${m.id}`,ref:E=>{E===null?i.current.delete(m.id):i.current.set(m.id,E)},onClick:()=>b(R),children:m.label},m.id)})}),st("div",{role:"tabpanel",id:c,"aria-labelledby":u(y),"aria-describedby":o,"data-testid":`${a}-panel`,children:s})]})};import{accessFailureKindOfStatus as Ko}from"@aiquants/auth-core";import{jsx as dt,jsxs as Bo}from"react/jsx-runtime";var Uo=({failure:e,onReload:t,deniedSentence:n,failureMessage:r,rescueRef:a,testId:o})=>{let{labels:s}=C(),l=dt(et,{failure:e,place:"read",deniedSentence:n,failed:r===void 0?s.loadFailed:r,retry:t,testId:`${o}-alert`});return e.status!==null&&Ko(e.status)!==null?dt("div",{className:"cui-resource-failed",ref:a,"data-testid":o,children:l},e.occurrence):Bo("div",{className:"cui-resource-failed","data-testid":o,children:[l,dt(I,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:a,testId:`${o}-reload`,children:s.reload})]})};import{useId as _o}from"react";import{jsx as W,jsxs as mn}from"react/jsx-runtime";var qo=({label:e,options:t,value:n,onValueChange:r,testId:a,density:o="regular"})=>{g();let s=_o(),l=new Set(t.map(i=>i.value));if(t.length<2||l.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(i=>i.value).join(", ")}`);if(!l.has(n))throw new RangeError(`The pressed value "${n}" is not one of the options: ${[...l].join(", ")}`);if(o!=="regular"&&o!=="compact")throw new RangeError(`A segmented control's density is "regular" or "compact", not ${JSON.stringify(o)}`);return o==="compact"?mn("fieldset",{className:"cui-segmented-group","aria-labelledby":s,"data-cui-density":"compact","data-testid":a,children:[W("span",{className:"cui-segmented-label",id:s,"data-cui-type":"caption",children:e}),W("div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===n;return W("button",{className:"cui-segment",type:"button","aria-pressed":d,"data-testid":`${a}-${i.value}`,onClick:()=>{d||r(i.value)},children:W("span",{className:"cui-segment-face","data-cui-fg":d?"on-solid":"fg","data-cui-surface":d?"info-solid":void 0,"data-cui-type":"caption","data-testid":`${a}-${i.value}-face`,children:i.label})},i.value)})})]}):mn("fieldset",{className:"cui-segmented-group","data-testid":a,children:[W("legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),W("div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===n;return W("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":`${a}-${i.value}`,onClick:()=>{d||r(i.value)},children:i.label},i.value)})})]})};import{useCallback as Go,useRef as Vo}from"react";import{jsx as z}from"react/jsx-runtime";var gn=e=>{let t=Vo(null),n=Go(r=>{if(t.current=r,typeof e=="function")return e(r);e!=null&&(e.current=r)},[e]);return{row:t,bindRow:n}},bn=({selected:e,controls:t,onSelect:n,testId:r,dataAttributes:a,ref:o,keyShortcuts:s,children:l})=>{g();let{row:i,bindRow:d}=gn(o);D(i,{testId:r,part:"row",host:"button"});let y=u=>{ae(u),n()};return z("button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"aria-keyshortcuts":B(s,r),"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:y,ref:d,...v(a),children:l})},Wo=({href:e,current:t,onNavigate:n,testId:r,dataAttributes:a,ref:o,keyShortcuts:s,children:l})=>{g();let{row:i,bindRow:d}=gn(o);D(i,{testId:r,part:"row",host:"link"});let y=u=>{ae(u),Z(u,e,n)};return z("a",{className:"cui-row-link",href:e,"aria-current":t?"page":void 0,"aria-keyshortcuts":B(s,r),"data-cui-row-focus":"","data-cui-surface":t?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:y,ref:d,...v(a),children:l})},zo=({label:e,items:t,itemKey:n,selectedKey:r,onSelect:a,detailId:o,renderRow:s,rowTestId:l,rowData:i,empty:d,testId:y,ref:u})=>(g(),z("div",{className:"cui-selectable","data-testid":y,ref:u,children:t.length===0?z(P,{as:"p",fg:"fg-muted",type:"prose",testId:`${y}-empty`,children:d}):z("ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(c=>{let b=n(c);return z("li",{children:z(bn,{selected:b===r,controls:o,onSelect:()=>a(c),testId:l,dataAttributes:i?.(c),children:s(c)})},b)})})}));import{useId as Jo}from"react";import{jsx as ke,jsxs as hn}from"react/jsx-runtime";var jo=({label:e,value:t,min:n,max:r,step:a,valueText:o,onValueChange:s,testId:l})=>{g();let i=Jo();if(!([t,n,r,a].every(Number.isFinite)&&n<r&&a>0&&n<=t&&t<=r))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${n}, max ${r}, step ${a}`);let d=o(t);return hn("div",{className:"cui-field","data-testid":`${l}-field`,children:[ke("label",{className:"cui-field-label",htmlFor:i,"data-cui-type":"body",children:e}),hn("div",{className:"cui-slider",children:[ke("input",{className:"cui-slider-input",id:i,type:"range",min:n,max:r,step:a,value:t,"aria-valuetext":d,"data-testid":l,onChange:y=>s(y.currentTarget.valueAsNumber)}),ke("span",{className:"cui-slider-value","aria-hidden":"true",children:ke(P,{fg:"fg",type:"body",testId:`${l}-value`,children:d})})]})]})};import{jsx as lt,jsxs as Tn}from"react/jsx-runtime";var Rn={done:0,current:1,pending:2},Xo={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Yo=({label:e,steps:t,testId:n})=>{let{labels:r}=C();if(t.length===0||new Set(t.map(o=>o.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(o=>o.id).join(", ")}`);if(t.filter(o=>o.state==="current").length>1||t.some((o,s)=>s>0&&Rn[o.state]<Rn[t[s-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(o=>o.state).join(", ")}`);let a={done:r.stepDone,current:null,pending:r.stepPending};return lt("ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":n,children:t.map((o,s)=>{let l=Xo[o.state],i=a[o.state];return Tn("li",{className:"cui-step","aria-current":o.state==="current"?"step":void 0,"data-cui-step":o.state,"data-testid":`${n}-${o.id}`,children:[lt("span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":l.fg,"data-cui-surface":l.surface,"data-cui-type":"caption",children:o.state==="done"?"\u2713":s+1}),Tn("span",{className:"cui-step-label","data-cui-fg":"fg",children:[o.label,i===null?null:lt("span",{className:"cui-visually-hidden",children:` (${i})`})]})]},o.id)})})};import{useId as Zo,useRef as Qo}from"react";import{jsx as Le,jsxs as En}from"react/jsx-runtime";var ea=({label:e,labelHidden:t,checked:n,onCheckedChange:r,unavailable:a,testId:o,ref:s,dataAttributes:l})=>{g();let i=Zo(),d=Qo(null);D(d,{testId:o,part:"label",host:"button"});let y=Y(a,i),u=a!==void 0,c=En("button",{className:"cui-switch",type:"button",role:"switch","aria-checked":n,"aria-disabled":u?!0:void 0,"aria-describedby":_(y),"data-cui-fg":"fg","data-cui-type":"body","data-testid":o,ref:s,onClick:()=>{u||r(!n)},...v(l),children:[Le("span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":n?"info-solid":"sunken","data-testid":`${o}-track`,children:Le("span",{className:"cui-switch-thumb","data-cui-surface":n?"surface":"neutral-solid","data-testid":`${o}-thumb`})}),Le("span",{className:t===!0?"cui-visually-hidden":void 0,ref:d,children:e})]});return a?.reason===void 0?c:En("span",{className:"cui-button-group",children:[c,Le(P,{fg:"fg-muted",type:"body",id:i,testId:`${o}-reason`,children:a.reason})]})};import{useCallback as ta,useEffect as na,useId as ra,useRef as xn,useState as oa}from"react";import{jsx as fe,jsxs as wn}from"react/jsx-runtime";var aa=({label:e,items:t,currentId:n,onNavigate:r,testId:a,collapsible:o=!1})=>{if(g(),t.length===0)throw new RangeError("Tabs needs at least one tab");let s=new Set(t.map(f=>f.id));if(s.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(f=>f.id).join(", ")}`);let l=t.find(f=>f.id===n);if(l===void 0)throw new RangeError(`The current tab "${n}" is not one of the tabs: ${[...s].join(", ")}`);let[i,d]=oa(!1),y=xn(null),u=xn(null),c=ra(),b=ta(f=>{d(!1),f&&y.current?.contains(document.activeElement)&&u.current?.focus()},[]);return na(()=>{if(!(o&&i))return;let f=p=>y.current!==null&&!y.current.contains(p),m=p=>{f(p.target)&&b(!0)},R=p=>{f(p.target)&&b(!1)};return document.addEventListener("pointerdown",m,!0),document.addEventListener("focusin",R,!0),()=>{document.removeEventListener("pointerdown",m,!0),document.removeEventListener("focusin",R,!0)}},[o,i,b]),wn("nav",{ref:y,className:"cui-tabs","aria-label":e,"data-testid":a,"data-cui-collapsible":o?"":void 0,"data-cui-open":o&&i?"":void 0,onKeyDown:o&&i?f=>q(f,()=>b(!0)):void 0,children:[o?wn("button",{ref:u,type:"button",className:"cui-tabs-summary","aria-expanded":i,"aria-controls":c,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${a}-summary`,onClick:()=>d(f=>!f),children:[fe("span",{className:"cui-tabs-summary-label",children:l.label}),fe("span",{className:"cui-tabs-summary-marker","aria-hidden":"true",children:i?"\u25B4":"\u25BE"})]}):null,fe("ul",{className:"cui-tabs-list",id:c,role:"list","data-cui-surface":o?"surface":void 0,children:t.map(f=>{let m=f.id===n;return fe("li",{className:"cui-tabs-item",children:fe("a",{className:"cui-tab",href:f.href,"aria-current":m?"page":void 0,"data-cui-fg":m?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${f.id}`,onClick:R=>{Z(R,f.href,r),R.defaultPrevented&&b(!1)},children:f.label})},f.id)})})]})};import{Children as ia,Fragment as sa,isValidElement as da}from"react";import{jsx as J,jsxs as Pn}from"react/jsx-runtime";var la={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},ua=e=>{g();let{label:t,sublabel:n,tone:r,testId:a,dataAttributes:o}=e;if((e.text===void 0?e.value===null:e.text===null)&&r!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${r}`);let l=`${a}-value`;return Pn("div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":a,...v(o),children:[J("p",{className:"cui-tile-label","data-cui-type":"caption","data-cui-measure":"reading",children:t}),J("p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption","data-cui-measure":"reading",children:n}),J("p",{className:"cui-tile-value","data-cui-fg":la[r],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?J(Ne,{value:e.value,unit:e.unit,testId:l}):J(Ne,{text:e.text,keep:"wrap",testId:l})})]})},vn=e=>ia.toArray(e).flatMap(t=>{if(!da(t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===sa?vn(t.props.children):[t]}),ca=({count:e,minInlinePx:t,testId:n,children:r})=>{g();let a=vt(e,t,M.space["space-2"]),o=vn(r).length;if(o!==e)throw new RangeError(`TileGrid has ${o} tiles but count is ${e}`);return Pn("div",{className:"cui-container","data-testid":n,children:[J(Q,{ruleKey:a.key,css:a.css}),J("div",{className:"cui-tile-grid","data-cui-tile-grid":a.key,"data-cui-gap":"space-2",children:r})]})};import{useLayoutEffect as pa,useRef as Nn}from"react";import{jsx as fa}from"react/jsx-runtime";var Se=e=>[...e.querySelectorAll("button")],ya=({label:e,testId:t,children:n})=>{g();let r=Nn(null),a=Nn(null);pa(()=>{let i=Se(r.current),d=a.current!==null&&i.includes(a.current)?a.current:i[0]??null;a.current=d;for(let y of i)y.tabIndex=y===d?0:-1});let o=i=>{for(let d of Se(r.current))d.tabIndex=d===i?0:-1;a.current=i};return fa("div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:r,onFocus:i=>{let d=Se(i.currentTarget).find(y=>y.contains(i.target));d!==void 0&&o(d)},onKeyDown:i=>{let d=Se(i.currentTarget),y=d.indexOf(i.target);if(y===-1)return;let u=getComputedStyle(i.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",c=u==="ArrowRight"?"ArrowLeft":"ArrowRight",f={[u]:(y+1)%d.length,[c]:(y-1+d.length)%d.length,Home:0,End:d.length-1}[i.key];if(f===void 0)return;i.preventDefault();let m=d[f];o(m),m.focus()},children:n})};import{useState as ma}from"react";var ga=e=>{let[t,n]=ma({failure:null,count:0});return e!==null&&e!==t.failure?(n({failure:e,count:t.count+1}),t.count+1):t.count};import{useCallback as re,useEffect as Ra,useLayoutEffect as kn,useRef as pt}from"react";import{useCallback as Me,useEffect as ba,useLayoutEffect as ha,useRef as ut,useState as ct}from"react";var Cn=e=>e===null?Ae:De,Ie=(e,t,n,r,a)=>{let[o,s]=ct(()=>({key:e,state:Cn(e)})),[l,i]=ct(0),[d,y]=ct(0),u=ut(t),c=ut(null),b=ut(l);ha(()=>{u.current=t}),ba(()=>{if(e===null){s({key:null,state:Ae});return}let h=new AbortController;c.current=e;let T=l===b.current?"revision":"reload";return b.current=l,s(x=>Object.is(x.key,e)?{key:e,state:r(x.state,T)}:{key:e,state:De}),u.current(h.signal).then(x=>{h.signal.aborted||(c.current=null,s(k=>({key:e,state:a(k.state,x)})))},x=>{h.signal.aborted||s(()=>{throw x})}),()=>{h.abort(),c.current=null}},[e,n,l,d]);let f=Me(()=>i(h=>h+1),[]),m=Me(()=>y(h=>h+1),[]),R=Me((h,T)=>{s(x=>Object.is(x.key,h)?{key:h,state:T(x.state)}:x)},[]),p=Me((h,T)=>{R(h,T),Object.is(c.current,h)&&m()},[R,m]);return{state:Object.is(o.key,e)?o.state:Cn(e),reload:f,refresh:m,update:R,write:p}};var Ta=(e,t,n)=>{let r=pt(t);kn(()=>{r.current=t});let a=re(p=>r.current.first(p),[]),{state:o,reload:s,refresh:l,update:i,write:d}=Ie(e,a,n,Nt,Ct),y=pt({key:e,state:o});kn(()=>{y.current={key:e,state:o}});let u=pt(null),c=re(()=>{u.current?.controller.abort(),u.current=null},[]);Ra(()=>c,[e,n,c]);let b=re(()=>{c(),s()},[c,s]),f=re(()=>{c(),l()},[c,l]),m=re(()=>{let{key:p,state:E}=y.current;if(p===null||E.kind!=="ready"||E.refreshing||E.value.next===null||E.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 h=E.value.next,T={key:p,controller:new AbortController,maps:[]};u.current=T,i(p,kt),r.current.next(h,T.controller.signal).then(x=>{u.current===T&&(u.current=null,i(p,k=>T.maps.reduce(($,oe)=>Oe($,oe),Lt(k,h,x))))},x=>{u.current===T&&i(p,()=>{throw x})})},[i]),R=re((p,E)=>{let h=u.current;h!==null&&Object.is(h.key,p)&&h.maps.push(E),d(p,T=>Oe(T,E))},[d]);return{state:o,reload:b,refresh:f,loadMore:m,updateList:R}};import{useCallback as Ea,useRef as xa,useState as wa}from"react";var va=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",Pa=()=>{let[e,t]=wa(null),n=xa(null),r=Ea((a,o)=>{let s=o();if(!va(s))return;let l=Symbol(a);n.current=l,t(a);let i=()=>{n.current===l&&(n.current=null,t(null))};s.then(i,i)},[]);return{pendingKey:e,press:r}};import{useCallback as Na}from"react";var Ca=(e,t,n)=>{let{state:r,reload:a,refresh:o,write:s}=Ie(e,t,n,Pt,He),l=Na((i,d)=>s(i,y=>He(y,{ok:!0,value:d})),[s]);return{state:r,reload:a,refresh:o,put:l}};import{jsx as La}from"react/jsx-runtime";var ka=({testId:e,children:t})=>(g(),La("span",{className:"cui-visually-hidden","data-testid":e,children:t}));export{ge as ANNOUNCE_SETTLE_MS,rr as AccessFailureNotice,ce as AlertMessage,or as Breadcrumb,I as Button,ht as COMPACT_ROW_PX,Ka as CONSOLE_UI_LABEL_CATALOGS,_a as CONTRAST_MINIMUM,bt as CONTRAST_PAIRS,We as Card,ur as CardSection,jr as CheckboxGroup,Ge as Cluster,pr as CodeBlock,mr as ComparisonGrid,Hn as ConsoleUiRoot,Lr as DataTable,Sr as DescriptionList,Ar as Dialog,Or as Disclosure,X as FIGURE_RING_REACH_PX,Za as FLEXIBLE_COLUMN_MIN_PX,et as FailureMessage,qr as Field,oo as Figure,so as FigureEdge,io as FigureNode,Xn as FragmentLink,si as HTTP_FORBIDDEN,uo as Heading,yo as InlineChange,To as JobCard,Fe as LATTICE_PX,Jn as Link,vo as List,Po as ListItem,Lo as LoadMore,qa as MORE_CONTRAST_MINIMUM,Mo as MasterDetail,Ne as Measured,Io as Meter,ua as MetricTile,Kr as Notice,Ho as PanelTabs,Vr as PasswordInput,rt as Pill,ot as ProgressBar,Va as ROW_WITH_CONTROL_PX,Jr as RadioGroup,Uo as ResourceFailed,bn as RowButton,Wo as RowLink,qo as SegmentedControl,zr as Select,zo as SelectableList,jo as Slider,Zn as Stack,Yo as Stepper,ea as Switch,j as TARGET_PX,M as TOKENS,fi as TONES,pi as TONE_HUES,yi as TONE_ROLES,aa as Tabs,P as Text,Wr as TextArea,Gr as TextInput,ca as TileGrid,ya as Toolbar,ka as VisuallyHidden,$a as ZonedTimeError,kt as beginPage,Nt as beginPagedReload,Pt as beginReload,ja as ceil8,Ga as ceilToLattice,Xa as cellContentInlinePx,Qa as comparisonAttributePx,Ba as contrastRatio,ti as countSampleText,Wa as cssVar,Rt as figureBoxPlan,Et as figureDiscLabelPlan,Ha as fillLabel,Ya as fixedColumnPx,li as flatMapOutcome,Sa as formatByteSize,me as formatCount,Da as formatInstant,oi as goldenSectionPx,Ua as hexToSrgb,ei as instantSampleText,O as isReadableText,He as keepLastGood,ui as lightDark,di as mapOutcome,Oe as mapPagedList,ai as masterDetailPlan,Ja as monoTextWidthEm,ci as placeholderRule,F as pxToRem,Ma as readDecimalText,Ia as readIntegerText,Oa as reasonAside,gt as resolveConsoleUiLabels,Ct as settleFirstPage,Lt as settlePage,ri as spacedTextWidthEm,ii as tableFrameMinInlinePx,wt as tableMinInlinePx,za as textWidthEm,vt as tileGridPlan,ni as tileMinInlinePx,Fa as toOffsetIso,Aa as toWallTime,ft as topmostModalOf,On as useAccessFailure,Be as useAnnounce,C as useConsoleUi,dr as useEscapeToClose,ga as useFailureOccurrence,le as useFocusRescue,Ta as usePagedResource,Pa as usePendingPress,Ca as useResource};
|
|
1
|
+
import{$ as Nt,A as Xa,B as Ya,C as Za,D as Qa,E as ei,F as ti,G as ni,H as ri,I as Rt,J as Tt,K as Et,L as X,M as U,N as oi,O as F,P as ai,Q as vt,R as xt,S as ii,T as wt,U as si,V as di,W as li,X as Ae,Y as De,Z as Pt,_ as He,a as yt,aa as Ct,b as ft,ba as kt,c as me,ca as Lt,d as Sa,da as Oe,e as mt,ea as ui,f as Ma,fa as ci,g as Ia,ga as pi,h as O,ha as yi,i as $a,ia as fi,j as Fa,k as Aa,l as Da,m as Ha,n as Oa,o as Ka,p as gt,q as Fe,r as Ga,s as j,t as Va,u as ht,v as M,w as Wa,x as za,y as Ja,z as ja}from"./chunk-HROMRBBM.js";import{a as Ua,e as Ba,f as _a,g as qa,h as $e,i as bt}from"./chunk-RA33TN5N.js";import{useEffect as Qn,useRef as er}from"react";import{useId as Vn,useRef as Wn}from"react";import{createContext as Ln,useCallback as Sn,useContext as At,useLayoutEffect as Mn,useMemo as St,useRef as Mt}from"react";import{jsx as Ft,jsxs as Kn}from"react/jsx-runtime";var Ke=Ln(null),Dt=" ",It='[inert], [aria-hidden="true" i]',Ue="data-cui-dialog-announcer",In=`:scope > [${Ue}]`,$n=e=>{if(e.closest(It)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=ft(e.ownerDocument);if(t.kind==="none")return{region:e};if(t.kind==="undecidable")return{hidden:"focus is in no open modal dialog and they do not nest, so which one is topmost cannot be told"};let n=t.dialog;if(n.contains(e))return{region:e};let r=n.querySelector(In);return r===null?{hidden:"the topmost open modal dialog neither contains the console nor is a Dialog"}:r.closest(It)!==null?{hidden:'the topmost open modal dialog is a Dialog whose live region has an inert or aria-hidden="true" ancestor'}:{region:r}},Fn=e=>{try{e.querySelectorAll(yt)}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}},ge=150,An=1e3,$t=new WeakMap,Dn=(e,t)=>{let n=$t.get(e)??new Set,r={text:t};$t.set(e,n.add(r)),setTimeout(()=>n.delete(r),ge);let a=e.ownerDocument.createElement("span");a.textContent=[...n].map(o=>o.text).join(Dt),e.replaceChildren(a)},Hn=({locale:e,formatLocale:t,timeZone:n,accessFailure:r,contrast:a="standard",reducedMotion:o=!1,testId:s,children:l})=>{if(At(Ke)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");if(typeof r!="function")throw new TypeError("ConsoleUiRoot: accessFailure must be the host's presenter of access failures (a function)");if(!$e.includes(a))throw new RangeError(`ConsoleUiRoot: contrast must be one of ${$e.join(", ")}: ${String(a)}`);if(typeof o!="boolean")throw new TypeError(`ConsoleUiRoot: reducedMotion must be a boolean: ${String(o)}`);let d=gt(e),[y]=Intl.getCanonicalLocales(t),u=St(()=>new Intl.DateTimeFormat(y,{timeZone:n}).resolvedOptions().timeZone,[y,n]),c=Mt(null),b=Mt(null);Mn(()=>{Fn(c.current.ownerDocument)},[]);let f=Sn(R=>{if(R.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let p=()=>{let{texts:h,settle:T,deadline:v}=b.current;b.current=null,clearTimeout(T),clearTimeout(v);let k=c.current;if(k===null)return;let $=h.join(Dt),oe=$n(k);if("hidden"in oe)throw new Error(`announce: the live region is hidden from assistive technology (${oe.hidden}), so this announcement would be lost: ${$}`);Dn(oe.region,$)},E=b.current;if(E===null){b.current={texts:[R],settle:setTimeout(p,ge),deadline:setTimeout(p,An)};return}E.texts.push(R),clearTimeout(E.settle),E.settle=setTimeout(p,ge)},[]),m=St(()=>({locale:e,formatLocale:y,timeZone:u,labels:d,announce:f,accessFailure:r}),[e,y,u,d,f,r]);return Ft(Ke.Provider,{value:m,children:Kn("div",{"data-cui-root":"","data-cui-contrast":a,"data-cui-reduced-motion":o?"":void 0,"data-cui-surface":"surface","data-cui-fg":"fg","data-testid":s,children:[l,Ft("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${s}-announcer`,ref:c})]})})},C=()=>{let e=At(Ke);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},g=()=>{C()},Be=()=>C().announce,On=()=>C().accessFailure;var w=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};var ae=e=>{let t=e.currentTarget;t.ownerDocument.activeElement!==t&&t.focus({preventScroll:!0})};var B=(e,t)=>{if(e!==void 0&&e.trim()==="")throw new RangeError(`${t}: the key shortcuts must name at least one shortcut, not a blank text: "${e}"`);return e};import{useLayoutEffect as Un}from"react";var Bn=new Set(["abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","mark","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr"]),_n=e=>{for(let t of e.querySelectorAll("*")){let n=t.localName;if(!Bn.has(n)||t.hasAttribute("tabindex")||t.hasAttribute("contenteditable"))return n}return null},D=(e,{testId:t,part:n,host:r})=>{Un(()=>{let a=_n(e.current);if(a!==null)throw new RangeError(`${t}: the ${n} is the content of a ${r} and holds only non-interactive phrasing content, not <${a}>`)})};import{jsx as qn}from"react/jsx-runtime";var P=({fg:e,type:t,face:n,as:r="span",space:a,testId:o,id:s,tabIndex:l,ref:i,children:d})=>(g(),qn(r,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":n,"data-cui-space":a,"data-cui-measure":r==="p"?"reading":void 0,"data-testid":o,id:s,tabIndex:l,ref:i,children:d}));var Gn=/\s/,_e=(e,t)=>{if(e===""||Gn.test(e))throw new RangeError(`The id of ${t} must be one token without whitespace: "${e}"`);return e},Y=(e,t)=>{if(e!==void 0){if(e.reason!==void 0){if(e.reason.trim()==="")throw new RangeError("An unavailable control needs a reason that is not blank");return t}return _e(e.reasonId,"an unavailable control's reason")}},_=(...e)=>{let t=e.filter(n=>n!==void 0);return t.length===0?void 0:t.join(" ")};import{jsx as K,jsxs as Yn}from"react/jsx-runtime";var zn={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"}},qe=({subject:e,children:t})=>{let n=Wn(null);return D(n,e),K("span",{ref:n,children:t})},I=({variant:e,children:t,testId:n,type:r="button",onClick:a,unavailable:o,describedBy:s,expanded:l,controls:i,ref:d,dataAttributes:y,keyShortcuts:u,busy:c,busyLabel:b})=>{g();let f=Vn(),m=Y(o,f),R=c===!0||o!==void 0,p=zn[e],E=h=>{if(ae(h),R){h.preventDefault();return}a?.(h)};return Yn("span",{className:"cui-button-group",children:[K("button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":p.fg,"data-cui-surface":p.surface,"data-cui-type":p.type,"data-testid":n,"aria-disabled":R?!0:void 0,"aria-busy":c===!0?!0:void 0,"aria-describedby":_(s,m),"aria-expanded":l,"aria-controls":i,"aria-keyshortcuts":B(u,n),onClick:E,ref:d,...w(y),children:K(qe,{subject:{testId:n,part:"label",host:"button"},children:c===!0?b:t})}),o?.reason===void 0?null:K(P,{fg:"fg-muted",type:"body",id:f,testId:`${n}-reason`,children:o.reason})]})},Jn=({onNavigate:e,children:t,testId:n,ref:r,keyShortcuts:a})=>(g(),K("button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,"aria-keyshortcuts":B(a,n),onClick:e,ref:r,children:K(qe,{subject:{testId:n,part:"label",host:"button"},children:t})})),jn=/^[^\s#]+$/,Xn=({targetId:e,children:t,testId:n,onFollow:r,dataAttributes:a,keyShortcuts:o})=>{if(g(),!jn.test(e))throw new RangeError(`A fragment link needs the target's id without "#" or white space: "${e}"`);return K("a",{className:"cui-link",href:`#${e}`,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,"aria-keyshortcuts":B(o,n),onClick:r,...w(a),children:K(qe,{subject:{testId:n,part:"label",host:"link"},children:t})})};import{jsx as Ht}from"react/jsx-runtime";var Zn=({gap:e,testId:t,children:n})=>(g(),Ht("div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:n})),Ge=({gap:e,as:t="div",testId:n,children:r})=>(g(),Ht(t,{className:"cui-cluster","data-cui-gap":e,"data-testid":n,children:r}));import{jsx as be,jsxs as Ot}from"react/jsx-runtime";var tr=new Set(["sign-in","sign-in-again","sign-in-again-in-new-window"]),nr=" ",rr=({view:e,handlers:t,testId:n})=>{let r=Be(),a=e.actions.map(({action:l,label:i})=>{let d=t[l];if(d===void 0)throw new TypeError(`AccessFailureNotice: no handler for the action ${JSON.stringify(l)}`);return{action:l,label:i,handler:d}}),o=e.politeness==="status"?[e.title,...e.sentences].join(nr):null,s=er(null);return Qn(()=>{o===null||s.current===o||(s.current=o,r(o))},[r,o]),Ot("div",{className:"cui-access-failure","data-cui-access-failure":e.kind,"data-testid":n,children:[Ot("div",{className:"cui-notice cui-access-failure-message",role:e.politeness==="alert"?"alert":void 0,"data-cui-tone":"warning","data-cui-surface":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-cui-measure":"reading","data-testid":`${n}-message`,children:[be("p",{className:"cui-access-failure-title","data-cui-measure":"reading","data-testid":`${n}-title`,children:e.title}),e.sentences.map(l=>be("p",{className:"cui-access-failure-sentence","data-cui-measure":"reading",children:l},l))]}),a.length===0?null:be(Ge,{gap:"space-2",testId:`${n}-actions`,children:a.map(({action:l,label:i,handler:d})=>be(I,{variant:tr.has(l)?"primary":"secondary",onClick:d,testId:`${n}-${l}`,children:i},l))})]})};var Z=(e,t,n)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),n(t))};import{jsx as ie,jsxs as Kt}from"react/jsx-runtime";var or=({items:e,current:t,onNavigate:n,testId:r})=>{let{labels:a}=C();if(new Set(e.map(o=>o.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(o=>o.id).join(", ")}`);return ie("nav",{className:"cui-breadcrumb","aria-label":a.breadcrumb,"data-testid":r,children:Kt("ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(o=>Kt("li",{className:"cui-breadcrumb-item",children:[ie("a",{className:"cui-link",href:o.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${r}-${o.id}`,onClick:s=>Z(s,o.href,n),children:o.label}),ie("span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},o.id)),ie("li",{className:"cui-breadcrumb-item",children:ie("span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${r}-current`,children:t})})]})})};import{useId as Ut}from"react";import{useCallback as ar}from"react";var ir=229,sr=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),he=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&sr.has(e.type)&&(e.value!==""||e.validity.badInput),Ve=e=>e.nativeEvent.isComposing||e.keyCode===ir,q=(e,t)=>{e.key!=="Escape"||e.nativeEvent.defaultPrevented||Ve(e)||he(e.target)||(e.stopPropagation(),t())},dr=e=>ar(t=>q(t,e),[e]);import{Fragment as cr,jsx as G,jsxs as se}from"react/jsx-runtime";var Bt=e=>e===void 0?void 0:t=>q(t,e),We=({id:e,title:t,description:n,actions:r,onEscape:a,testId:o,headingRef:s,ref:l,dataAttributes:i,children:d})=>{g();let y=Ut(),u=Bt(a);return se("section",{className:"cui-card",id:e,"aria-labelledby":y,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:l,onKeyDown:u,...w(i),children:[se("div",{className:"cui-card-header",children:[se("div",{className:"cui-card-heading",children:[G("h2",{className:"cui-card-title",id:y,"data-cui-type":"title","data-testid":`${o}-heading`,ref:s,tabIndex:s===void 0?void 0:-1,children:t}),n===void 0?null:G("div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),r===void 0?null:G("div",{className:"cui-card-actions",children:r})]}),d]})},lr={3:"h3",4:"h4"},ur=({id:e,title:t,subtitle:n,level:r=3,region:a=!1,onEscape:o,testId:s,headingRef:l,ref:i,dataAttributes:d,children:y})=>{g();let u=Ut(),c=Bt(o),b=lr[r],f=se(cr,{children:[se("div",{className:"cui-card-section-heading",children:[G(b,{className:"cui-card-section-title",id:u,"data-cui-type":"body","data-testid":`${s}-heading`,ref:l,tabIndex:l===void 0?void 0:-1,children:t}),n===void 0?null:G("div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),y]});return a?G("section",{className:"cui-card-section",id:e,"aria-labelledby":u,"data-testid":s,ref:i,onKeyDown:c,...w(d),children:f}):G("div",{className:"cui-card-section",id:e,"data-testid":s,ref:i,...w(d),children:f})};import{jsx as _t}from"react/jsx-runtime";var pr=({label:e,code:t,testId:n})=>(g(),_t("section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":n,children:_t("pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${n}-code`,children:t})}));import{useId as fr}from"react";import{jsx as yr}from"react/jsx-runtime";var Q=({ruleKey:e,css:t})=>yr("style",{href:e,precedence:"cui",children:t});import{jsx as L,jsxs as V}from"react/jsx-runtime";var mr=({caption:e,attributes:t,columns:n,attributePx:r,columnMinPx:a,testId:o})=>{g();let s=fr();for(let u of[r,a])if(!(Number.isFinite(u)&&u>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${u}`);if(n.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let u of n)for(let c of t)if(!Object.hasOwn(u.cells,c.key))throw new RangeError(`Column "${u.key}" has no value for attribute "${c.key}"`);let l=r+n.length*a,i=`cui-comparison-a${r}-c${a}-n${n.length}`,d=u=>`[data-cui-comparison="${i}"][data-cui-comparison-layout="${u}"]`,y=`${d("table")}{display:none}@container (min-width:${F(l)}){${d("table")}{display:block}${d("stack")}{display:none}}`;return V("div",{className:"cui-container","data-cui-stack-below-px":l,"data-testid":o,children:[L(Q,{ruleKey:i,css:y}),L("div",{className:"cui-comparison-frame","data-cui-comparison":i,"data-cui-comparison-layout":"table",children:V("table",{className:"cui-comparison-table","data-cui-type":"body",children:[L("caption",{className:"cui-visually-hidden",children:e}),V("colgroup",{children:[L("col",{style:{width:F(r)}}),n.map(u=>L("col",{},u.key))]}),L("thead",{children:V("tr",{children:[L("td",{}),n.map(u=>L("th",{scope:"col",children:u.heading},u.key))]})}),L("tbody",{children:t.map(u=>V("tr",{children:[L("th",{scope:"row",children:u.label}),n.map(c=>L("td",{children:c.cells[u.key]("table")},c.key))]},u.key))})]})}),L("div",{className:"cui-comparison-stack","data-cui-comparison":i,"data-cui-comparison-layout":"stack",children:n.map((u,c)=>{let b=`${s}-column-${c}`;return V("div",{className:"cui-comparison-column",role:"group","aria-labelledby":b,"data-cui-type":"body",children:[L("div",{className:"cui-comparison-heading",id:b,children:u.heading}),L("dl",{className:"cui-comparison-list",children:t.map(f=>V("div",{children:[L("dt",{children:f.label}),L("dd",{children:u.cells[f.key]("stack")})]},f.key))})]},u.key)})})]})};import{Fragment as Tr,useCallback as Er,useId as vr,useLayoutEffect as Vt,useRef as Xe}from"react";var de="[data-cui-row-focus]",ze="[data-cui-row-detail]",gr=e=>e===null?[]:[...e.querySelectorAll(`:scope > ${de}`)],qt=(e,t)=>{let n=new Map;t!==null&&n.set(t,0);let r=-1;for(let a of e===null?[]:e.children)a.matches(de)?(r+=1,n.set(a,r)):r>=0&&a.matches(ze)&&n.set(a,r);return n},Gt=(e,t,n,r)=>{let a=gr(t);if(a.length===0)return n;let o=r.get(e);if(o===void 0)throw new RangeError(`rowFocusTarget: <${e.localName}> left holding focus with no position in the table (only its rows, row details and empty text hold one)`);return a[Math.min(o,a.length-1)]};import{useCallback as br,useLayoutEffect as Je,useReducer as hr,useRef as je}from"react";var Rr=e=>e+1,le=e=>{let t=je(e),n=je(null),r=je(!1),[,a]=hr(Rr,0),o=br((s=>()=>{r.current&&s.contains(document.activeElement)&&(n.current=s,a())}),[]);return Je(()=>(r.current=!0,()=>{r.current=!1,n.current=null}),[]),Je(()=>{t.current=e}),Je(()=>{let s=n.current;if(s===null)return;n.current=null;let l=[null,document.body].includes(document.activeElement);s.isConnected||!l||t.current(s)?.focus()}),o};import{jsx as S,jsxs as Re}from"react/jsx-runtime";var xr=new Map,wr='a[href], audio[controls], button, details, embed, iframe, img[usemap], input:not([type="hidden"]), label, select, textarea, video[controls], [tabindex], [contenteditable]',Pr=(e,t,n)=>{Vt(()=>{let r=e.current;if(t!=="row-compact"||r===null)return;let a=[...r.querySelectorAll(wr)].find(o=>o.parentElement!==r);if(a!==void 0)throw new RangeError(`${n}: a compact row holds no control or focus target (a ${j} px target does not fit its ${ht} px; use row-control), not <${a.localName}>`)})},Nr=(e,t)=>{let n=e.filter(a=>a.rowHeader===!0).map(a=>a.key);if(n.length>1)throw new RangeError(`${t}: a table has at most one row header column, not ${n.length} (${n.join(", ")})`);let r=e.find(a=>a.rowHeader!==!0&&a.rowHeaderNote!==void 0);if(r!==void 0)throw new RangeError(`${t}: a row header note belongs to the row header column, not to ${r.key}`)},Cr=e=>e==null?null:S("div",{className:"cui-table-header-note",children:e}),kr=(e,t,n,r,a)=>{let o=e.open(t);return S("tr",{ref:a,hidden:!o,"data-cui-row-detail":o?"open":"closed","data-testid":`${r}-detail`,children:S("td",{colSpan:n,id:e.id(t),children:o?e.render(t):null})})},Lr=({caption:e,captionHidden:t,columns:n,rows:r,rowKey:a,rowTestId:o,rowData:s,rowSize:l,rowDetail:i,empty:d,testId:y,ref:u})=>{g();let c=vr(),b=Xe(null);Pr(b,l,y);let f=Xe(null),m=Xe(xr),R=le(h=>Gt(h,b.current,f.current,m.current));Vt(()=>{m.current=qt(b.current,f.current)});let p=Er(h=>{f.current=h;let T=R(h);return()=>{f.current=null,T()}},[R]),E=xt(n);return Nr(n,y),S("div",{className:"cui-container","data-testid":y,ref:u,children:r.length===0?S(P,{as:"p",fg:"fg-muted",type:"prose",tabIndex:-1,ref:p,testId:`${y}-empty`,children:d}):S("section",{ref:R,className:"cui-table-frame",tabIndex:0,"aria-labelledby":c,"data-testid":`${y}-frame`,children:Re("table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":l,style:{"--cui-table-min":F(E)},children:[S("caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:c,children:e}),S("colgroup",{children:n.map(h=>S("col",{style:h.width.fixedPx===void 0?void 0:{width:F(h.width.fixedPx)}},h.key))}),S("thead",{children:S("tr",{children:n.map(h=>Re("th",{scope:"col","data-cui-align":h.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:[h.header,h.note===void 0?null:S("div",{className:"cui-table-header-note",children:h.note})]},h.key))})}),S("tbody",{ref:b,children:r.map(h=>Re(Tr,{children:[S("tr",{ref:R,tabIndex:-1,"data-cui-row-focus":"","data-testid":o,...w(s?.(h)),children:n.map(T=>T.rowHeader===!0?Re("th",{scope:"row","data-cui-align":T.align,children:[T.cell(h),T.rowHeaderNote===void 0?null:Cr(T.rowHeaderNote(h))]},T.key):S("td",{"data-cui-align":T.align,children:T.cell(h)},T.key))}),i===void 0?null:kr(i,h,n.length,o,R)]},a(h)))})]})})})};import{jsx as Ye,jsxs as Mr}from"react/jsx-runtime";var Sr=({items:e,testId:t})=>{if(g(),new Set(e.map(n=>n.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(n=>n.key).join(", ")}`);return Ye("dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(n=>Mr("div",{className:"cui-description-row","data-testid":`${t}-${n.key}`,children:[Ye("dt",{"data-cui-fg":"fg-secondary",children:n.term}),Ye("dd",{"data-cui-fg":"fg",children:n.description})]},n.key))})};import{useId as Wt,useLayoutEffect as zt,useRef as Ze}from"react";import{jsx as ue,jsxs as jt}from"react/jsx-runtime";var Jt=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},Ir=(e,t)=>{if(t===null||!e.contains(t))throw new RangeError("A dialog's initial focus must be an element inside the dialog");return t},$r=(e,t)=>{if(t.focus(),e.ownerDocument.activeElement!==t)throw e.close(),new RangeError("A dialog's initial focus must be an element that takes focus")},Fr=e=>e instanceof HTMLInputElement&&e.type==="search",Ar=({title:e,description:t,open:n,onClose:r,initialFocus:a,testId:o,children:s})=>{let{labels:l}=C(),i=Wt(),d=Wt(),y=Ze(null),u=Ze(null),c=Ze(!1);return zt(()=>{let p=y.current;if(n&&!p.open){let E=a===void 0?null:Ir(p,a.current);u.current=p.ownerDocument.activeElement,p.showModal(),E!==null&&$r(p,E)}else!n&&p.open&&p.close()},[n,a]),zt(()=>{let p=y.current;return()=>{p.open&&(p.close(),Jt(u.current),u.current=null)}},[]),jt("dialog",{className:"cui-dialog","aria-labelledby":i,"aria-describedby":t===void 0?void 0:d,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:y,onClose:p=>{p.currentTarget.open||(Jt(u.current),u.current=null,n&&r())},onCancel:p=>{let E=c.current;c.current=!1,(E||he(p.currentTarget.ownerDocument.activeElement))&&p.preventDefault()},onKeyDownCapture:p=>{let E=Ve(p);c.current=E,p.key==="Escape"&&!E&&he(p.target)&&!Fr(p.target)&&p.preventDefault()},onKeyUpCapture:()=>{c.current=!1},children:[jt("div",{className:"cui-dialog-header",children:[ue("h2",{className:"cui-dialog-title",id:i,"data-cui-type":"title",children:e}),ue("div",{className:"cui-dialog-actions",children:ue(I,{variant:"secondary",testId:`${o}-close`,onClick:()=>y.current?.close(),children:l.close})})]}),t===void 0?null:ue("div",{id:d,"data-cui-measure":"reading","data-testid":`${o}-description`,children:t}),s,ue("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[Ue]:"","data-testid":`${o}-announcer`})]})};import{useId as Dr,useRef as Hr}from"react";import{jsx as Qe,jsxs as Xt}from"react/jsx-runtime";var Or=({summary:e,open:t,onOpenChange:n,testId:r,children:a})=>{g();let o=Dr(),s=Hr(null);return D(s,{testId:r,part:"summary",host:"button"}),Xt("div",{className:"cui-disclosure","data-testid":r,children:[Xt("button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":o,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${r}-button`,onClick:()=>n(!t),children:[Qe("span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),Qe("span",{ref:s,children:e})]}),Qe("div",{className:"cui-disclosure-panel",id:o,hidden:!t,"data-testid":`${r}-panel`,children:a})]})};import{accessFailureKindOfStatus as Ur}from"@aiquants/auth-core";import{Fragment as Br}from"react";import{jsx as Yt}from"react/jsx-runtime";var Kr=({tone:e,testId:t,children:n})=>(g(),Yt("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-cui-measure":"reading","data-testid":t,children:n})),ce=({occurrence:e,testId:t,children:n})=>(g(),Yt("div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-measure":"reading","data-cui-occurrence":e,"data-testid":t,children:n},e));import{jsx as Zt}from"react/jsx-runtime";var et=({failure:e,place:t,deniedSentence:n,failed:r,retry:a,testId:o})=>{let{labels:s,accessFailure:l}=C();if(n.trim()==="")throw new RangeError("FailureMessage: deniedSentence must be a non-empty sentence");let i=e.status===null?null:Ur(e.status);return i===null?Zt(ce,{occurrence:e.occurrence,testId:o,children:s.failureSentence(e,r)}):Zt(Br,{children:l({kind:i,place:t,deniedSentence:i==="forbidden"?s.forbiddenBecause(n,e.reason):null,retry:a})},e.occurrence)};import{useId as ee}from"react";import{Fragment as Xr,jsx as x,jsxs as A}from"react/jsx-runtime";var _r=/\s/,tt=e=>{if(e!==void 0&&(typeof e!="string"||e===""||_r.test(e)))throw new RangeError(`A control's name must be one token without whitespace: "${e}"`);return e},Qt=e=>{if(e!==void 0&&!(Number.isInteger(e)&&e>0))throw new RangeError(`A field's maxLength must be a positive integer: ${e}`);return e},te=({description:e,error:t,errorId:n})=>{g();let r=ee(),a=ee(),o=ee(),s=n===void 0?o:_e(n,"a field's error"),l=[e===void 0?null:a,t===void 0?null:s].filter(d=>d!==null).join(" ");return{control:{id:r,"aria-describedby":l===""?void 0:l,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:s}},ne=({description:e,error:t,descriptionId:n,errorId:r,testId:a})=>A(Xr,{children:[e===void 0?null:x(P,{as:"p",fg:"fg-muted",type:"body",id:n,testId:`${a}-description`,children:e}),t===void 0?null:x(P,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${a}-error`,children:t})]}),Te=({htmlFor:e,hidden:t,children:n})=>x("label",{className:t===!0?"cui-visually-hidden":"cui-field-label",htmlFor:e,"data-cui-type":"body",children:n}),qr=({label:e,description:t,error:n,errorId:r,testId:a,children:o})=>{let{control:s,descriptionId:l,errorId:i}=te({label:e,description:t,error:n,errorId:r});return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":a,children:[x(Te,{htmlFor:s.id,hidden:void 0,children:e}),o(s),x(ne,{description:t,error:n,descriptionId:l,errorId:i,testId:a})]})},en=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,type:s,name:l,maxLength:i,list:d,autoComplete:y,inputMode:u,prefix:c,labelHidden:b,required:f,testId:m,ref:R})=>{let{control:p,descriptionId:E,errorId:h}=te({label:e,description:t,error:n,errorId:r}),T=ee();if(c!==void 0&&c.trim()==="")throw new RangeError("An input's prefix must not be blank");if(i!==void 0&&s==="datetime-local")throw new RangeError(`A ${s} input takes no maxLength: ${i}`);let v=s==="password",k=x("input",{className:"cui-input",type:s,name:tt(l),maxLength:Qt(i),value:a,list:d,autoComplete:y,inputMode:u,spellCheck:v?!1:void 0,autoCapitalize:v?"none":void 0,required:f,onChange:$=>o($.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":m,ref:R,...p,"aria-describedby":_(c===void 0?void 0:T,p["aria-describedby"])});return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${m}-field`,children:[x(Te,{htmlFor:p.id,hidden:b,children:e}),c===void 0?k:A("div",{className:"cui-input-group",children:[x("span",{className:"cui-input-prefix",id:T,"data-cui-fg":"fg-secondary","data-cui-surface":"sunken","data-cui-type":"body","data-testid":`${m}-prefix`,children:c}),k]}),x(ne,{description:t,error:n,descriptionId:E,errorId:h,testId:m})]})},Gr=e=>x(en,{...e}),Vr=e=>x(en,{...e,type:"password"}),Wr=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,name:s,maxLength:l,required:i,testId:d,ref:y})=>{let{control:u,descriptionId:c,errorId:b}=te({label:e,description:t,error:n,errorId:r});return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${d}-field`,children:[x(Te,{htmlFor:u.id,hidden:void 0,children:e}),x("textarea",{className:"cui-input cui-textarea",name:tt(s),maxLength:Qt(l),value:a,required:i,onChange:f=>o(f.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":d,ref:y,...u}),x(ne,{description:t,error:n,descriptionId:c,errorId:b,testId:d})]})},zr=({label:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:s,name:l,labelHidden:i,unavailable:d,testId:y,ref:u})=>{let{control:c,descriptionId:b,errorId:f}=te({label:e,description:t,error:n,errorId:r}),m=ee(),R=Y(d,m);return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${y}-field`,children:[x(Te,{htmlFor:c.id,hidden:i,children:e}),x("select",{className:"cui-input",name:tt(l),value:a,onChange:p=>{d===void 0&&s(p.target.value)},"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":y,ref:u,...c,"aria-disabled":d===void 0?void 0:!0,"aria-describedby":_(c["aria-describedby"],R),children:o.map(p=>x("option",{value:p.value,children:p.label},p.value))}),x(ne,{description:t,error:n,descriptionId:b,errorId:f,testId:y}),d?.reason===void 0?null:x(P,{as:"p",fg:"fg-muted",type:"body",id:m,testId:`${y}-reason`,children:d.reason})]})},Jr=({legend:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:s,testId:l,ref:i})=>{let d=ee(),{control:y,descriptionId:u,errorId:c}=te({label:e,description:t,error:n,errorId:r});return A("fieldset",{className:"cui-radio-group","aria-describedby":y["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[x("legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),o.map((b,f)=>A("label",{className:"cui-radio","data-cui-type":"body",children:[x("input",{type:"radio",name:d,value:b.value,checked:b.value===a,onChange:()=>s(b.value),"aria-invalid":y["aria-invalid"],"data-testid":`${l}-option-${b.value}`,ref:f===0?i:void 0}),x("span",{children:b.label})]},b.value)),x(ne,{description:t,error:n,descriptionId:u,errorId:c,testId:l})]})},jr=({legend:e,description:t,error:n,errorId:r,values:a,options:o,onValuesChange:s,testId:l,ref:i})=>{let{control:d,descriptionId:y,errorId:u}=te({label:e,description:t,error:n,errorId:r}),c=o.map(m=>m.value);if(c.length===0||new Set(c).size!==c.length)throw new RangeError(`A check box group needs at least one option with unique values: ${c.join(", ")}`);let b=a.filter(m=>!c.includes(m));if(b.length>0)throw new RangeError(`The chosen values are not options: ${b.join(", ")}`);let f=new Set(a);return A("fieldset",{className:"cui-checkbox-group","aria-describedby":d["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[x("legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),o.map((m,R)=>A("label",{className:"cui-checkbox","data-cui-type":"body",children:[x("input",{type:"checkbox",value:m.value,checked:f.has(m.value),onChange:()=>s(c.filter(p=>p===m.value?!f.has(p):f.has(p))),"aria-invalid":d["aria-invalid"],"data-testid":`${l}-option-${m.value}`,ref:R===0?i:void 0}),x("span",{children:m.label})]},m.value)),x(ne,{description:t,error:n,descriptionId:y,errorId:u,testId:l})]})};import{createContext as Yr,useContext as Zr,useId as an,useMemo as Qr}from"react";import{Fragment as un,jsx as N,jsxs as Ee}from"react/jsx-runtime";var sn=Yr(null),tn="surface",nn={neutral:{face:"surface",line:"border-control"},info:{face:"info-tint",line:"info-accent"},success:{face:"success-tint",line:"success-accent"},warning:{face:"warning-tint",line:"warning-accent"},danger:{face:"danger-tint",line:"danger-accent"}},rn={face:"info-tint",line:"info-accent"},dn={normal:"border-control",high:"info-accent"},eo=["normal","high"],to=[1,2,3,4],H=M.space["space-2"],no="fg",ro="fg-secondary",ln=e=>{let t=Zr(sn);if(t===null)throw new Error(`${e} must be rendered inside Figure`);return t},nt=(e,t,n)=>{if(!(Number.isFinite(n)&&n>0&&n%4===0))throw new RangeError(`${e}: ${t} must be a positive multiple of the ${4} px lattice: ${n}`)},oo=e=>{g();let t=an(),{kind:n,widthPx:r,heightPx:a,testId:o,dataAttributes:s,children:l}=e;nt(o,"widthPx",r),nt(o,"heightPx",a);let i=Qr(()=>({kind:n,widthPx:r,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[n,r,a,t]),d=Ee(un,{children:[N("defs",{children:eo.map(b=>N("marker",{id:i.arrowIds[b],viewBox:`0 0 ${H} ${H}`,refX:H,refY:H/2,markerWidth:H,markerHeight:H,markerUnits:"userSpaceOnUse",orient:"auto","data-cui-emphasis":b,children:N("path",{d:`M 0 0 L ${H} ${H/2} L 0 ${H} z`,"data-cui-stroke":dn[b],"data-testid":`${o}-arrow-${b}`})},b))}),N(sn.Provider,{value:i,children:l})]});if(e.kind==="group"){let{label:b,onEscape:f}=e;if(!O(b))throw new RangeError(`${o}: a group figure's label must hold a readable character: ${JSON.stringify(b)}`);return N("div",{className:"cui-figure-frame","data-testid":`${o}-frame`,children:N("svg",{className:"cui-figure",role:"group","aria-label":b,viewBox:`0 0 ${r} ${a}`,"data-cui-figure":"group","data-cui-surface":tn,"data-cui-face":"sans",style:{"--cui-figure-inline":F(r),"--cui-figure-block":F(a)},onKeyDown:f===void 0?void 0:m=>q(m,f),"data-testid":o,...w(s),children:d})})}let{viewBox:y,pointer:u,svgRef:c}=e;return N("div",{className:"cui-container","data-testid":`${o}-frame`,children:N("svg",{ref:c,className:"cui-figure","aria-hidden":"true",viewBox:y===void 0?`0 0 ${r} ${a}`:y,"data-cui-figure":"decorative","data-cui-surface":tn,"data-cui-face":"sans","data-cui-pan":u===void 0?void 0:"true","data-cui-cursor":u?.cursor,style:{"--cui-figure-inline":F(r),"--cui-figure-ratio":String(a/r)},"data-testid":o,...w(s),...u?.handlers,children:d})})},on=(e,t)=>{try{return t()}catch(n){throw new RangeError(`${e}: ${n.message}`,{cause:n})}},ao=(e,t,n)=>{for(let r of t){let a=bt.light[r.fg],o=n.find(s=>a[s]===void 0);if(o!==void 0)throw new RangeError(`${e}: the note ${JSON.stringify(r.text)} in ${r.fg} is not in the contrast table on ${o}, a face the node takes`)}},io=e=>{g();let t=ln("FigureNode"),n=an(),{x:r,y:a,shape:o,tone:s,outline:l,selected:i,name:d,title:y,press:u,testId:c,dataAttributes:b}=e,f=e.notes===void 0?[]:e.notes;if(!(Number.isFinite(r)&&Number.isFinite(a)))throw new RangeError(`${c}: a node's position must be finite: ${r}, ${a}`);if(t.kind==="group"&&u===void 0)throw new RangeError(`${c}: every node of a group figure must be pressable (pass press)`);if(t.kind==="decorative"&&u!==void 0)throw new RangeError(`${c}: a node of a decorative figure cannot be pressed (it is hidden from assistive technology)`);if(u!==void 0&&!O(u.label))throw new RangeError(`${c}: a pressable node's label must hold a readable character: ${JSON.stringify(u.label)}`);let m=i?rn:nn[s];ao(c,f,[nn[s].face,rn.face]);let R,p,E;if(o.kind==="box"){if(d===null)throw new RangeError(`${c}: a box's name is drawn inside the box and sizes it, so it cannot be null (only a disc may be drawn without a name)`);let T=on(c,()=>Rt({name:d,notes:f.map(k=>k.text)}));if(nt(c,"a box's widthPx",o.widthPx),o.widthPx<T.minWidthPx)throw new RangeError(`${c}: a box ${o.widthPx} px wide is narrower than its lines under the widest 1.4.12 spacing (${T.minWidthPx} px)`);R={width:o.widthPx,height:T.heightPx,left:r,top:a};let v=Tt(f.length);p=Ee("g",{"data-cui-surface":m.face,children:[N("rect",{className:"cui-figure-plate",width:o.widthPx,height:T.heightPx,rx:M.radius["radius-item"],"data-cui-fill":m.face,"data-cui-stroke":m.line,"data-testid":`${c}-plate`}),N("text",{className:"cui-figure-name",x:v.insetPx,y:v.namePx,fontSize:M.type.body.size,"data-cui-fg":no,"data-cui-figure-type":"body","data-testid":`${c}-name`,children:d}),f.map((k,$)=>N("text",{x:v.insetPx,y:v.notesPx[$],fontSize:M.type.caption.size,"data-cui-fg":k.fg,"data-cui-figure-type":"caption","data-testid":`${c}-note-${$}`,children:k.text},$))]}),E=N("rect",{className:"cui-figure-ring",x:-U,y:-U,width:o.widthPx+2*U,height:T.heightPx+2*U,rx:M.radius["radius-item"]+U,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}else{let T=on(c,()=>Et(d,o.radiusPx));R={width:2*o.radiusPx,height:2*o.radiusPx,left:r-o.radiusPx,top:a-o.radiusPx},p=Ee(un,{children:[N("g",{"data-cui-surface":m.face,children:N("circle",{className:"cui-figure-plate",r:o.radiusPx,"data-cui-fill":m.face,"data-cui-stroke":m.line,"data-testid":`${c}-plate`})}),d===null?null:N("text",{className:"cui-figure-label",x:0,y:T.extentBelowPx-M.type.caption.lineHeight/2,fontSize:M.type.caption.size,"data-cui-fg":ro,"data-cui-figure-type":"caption","data-testid":`${c}-name`,children:d})]}),E=N("circle",{className:"cui-figure-ring",r:o.radiusPx+U,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}if(u!==void 0){if(R.width<j||R.height<j)throw new RangeError(`${c}: a pressable node must be at least the ${j} px target: ${R.width} \xD7 ${R.height}`);if(R.left<X||R.top<X||R.left+R.width+X>t.widthPx||R.top+R.height+X>t.heightPx)throw new RangeError(`${c}: a pressable node must keep ${X} px to the figure's edge for its focus ring`)}let h=u===void 0?{}:{role:"button",tabIndex:0,"aria-label":u.label,"aria-describedby":u.description===void 0?void 0:n,"aria-expanded":u.expanded,"aria-controls":u.expanded?u.controls:void 0,onClick:T=>{T.currentTarget.focus(),u.onPress()},onKeyDown:T=>{T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),T.repeat||u.onPress())}};return Ee("g",{className:"cui-figure-node",transform:`translate(${r} ${a})`,"data-cui-tone":s,"data-cui-outline":l,"data-selected":String(i),...h,"data-testid":c,...w(b),children:[y===void 0?null:N("title",{children:y}),u?.description===void 0?null:N("desc",{id:n,"data-testid":`${c}-description`,children:u.description}),u===void 0?null:E,p]})},so=({d:e,emphasis:t,weight:n,arrow:r,title:a,testId:o,dataAttributes:s})=>{g();let l=ln("FigureEdge");if(!to.includes(n))throw new RangeError(`${o}: an edge's weight must be 1, 2, 3 or 4: ${n}`);return N("path",{className:"cui-figure-edge",d:e,markerEnd:r?`url(#${l.arrowIds[t]})`:void 0,"data-cui-stroke":dn[t],"data-cui-weight":n,"data-cui-emphasis":t,"data-testid":o,...w(s),children:a===void 0?null:N("title",{children:a})})};import{jsx as co}from"react/jsx-runtime";var lo={1:"h1",2:"h2",3:"h3"},uo=({level:e,type:t,testId:n,headingRef:r,children:a})=>{g();let o=lo[e];return co(o,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":n,ref:r,tabIndex:r===void 0?void 0:-1,children:a})};import{jsx as fo}from"react/jsx-runtime";var po={removed:"danger-tint",added:"success-tint"},yo=({kind:e,testId:t,children:n})=>{if(g(),n==="")throw new RangeError(`${t}: a changed fragment must hold at least one character`);return fo(e==="removed"?"del":"ins",{className:"cui-change","data-cui-change":e,"data-cui-surface":po[e],"data-cui-fg":"fg","data-testid":t,children:n})};import{jsx as bo}from"react/jsx-runtime";var mo={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"}},go={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},rt=({tone:e,variant:t,testId:n,dataAttributes:r,children:a})=>{g();let o=t==="tint"?mo[e]:{fg:"on-solid",surface:go[e]};return bo("span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":o.fg,"data-cui-surface":o.surface,"data-cui-type":"caption","data-testid":n,...w(r),children:a})};import{useId as ho}from"react";import{jsx as pe,jsxs as Ro}from"react/jsx-runtime";var ot=({label:e,valueText:t,value:n,max:r,testId:a})=>{g();let o=ho();if(r!==null){if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Progress maximum must be positive: ${r}`);if(n===null||!(Number.isFinite(n)&&n>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${n}`)}let s=r===null?null:{max:r,now:Math.min(n,r)};return Ro("div",{className:"cui-progress","data-testid":a,children:[pe(P,{as:"p",fg:"fg",type:"body",id:o,children:e}),pe("div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":o,"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":`${a}-bar`,children:pe("div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:s===null?void 0:{inlineSize:`${s.now/s.max*100}%`},"data-testid":`${a}-fill`})}),pe("div",{"aria-hidden":"true",children:pe(P,{as:"p",fg:"fg-secondary",type:"body",testId:`${a}-value`,children:t})})]})};import{jsx as ve,jsxs as cn}from"react/jsx-runtime";var To=({title:e,status:t,progress:n,cancel:r,testId:a,children:o})=>cn(We,{title:e,actions:r===void 0?void 0:ve(I,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${a}-cancel`,children:r.label}),testId:a,children:[cn("div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-status`,children:[ve("span",{className:"cui-visually-hidden",children:`${e} `}),ve(rt,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),n===void 0?null:ve(ot,{...n,testId:`${a}-progress`}),o]});import{createContext as Eo,useContext as vo}from"react";import{jsx as ye}from"react/jsx-runtime";var at=Eo(null),xo="space-2",wo=e=>{g();let{gap:t,label:n,id:r,hidden:a,testId:o,children:s}=e;if(n!==void 0&&!O(n))throw new RangeError(`${o}: a list's label must hold a readable character: ${JSON.stringify(n)}`);let l=e.marker==="none"?void 0:e.type,i=l!==void 0,d=e.marker==="number"||e.marker==="none"&&e.ordered?"ol":"ul";return ye(at.Provider,{value:e.marker,children:ye(d,{className:"cui-list",role:"list","aria-label":n,id:r,hidden:a,"data-cui-gap":i?void 0:t,"data-cui-row-gap":i?t:void 0,"data-cui-column-gap":i?xo:void 0,"data-cui-marker":i?e.marker:void 0,"data-cui-type":l,"data-testid":o,children:s})})},Po=({testId:e,dataAttributes:t,children:n})=>{g();let r=vo(at);if(r===null)throw new Error("ListItem must be rendered inside List, not inside another ListItem");return ye("li",{className:"cui-list-item","data-testid":e,...w(t),children:ye("div",{className:"cui-list-body","data-cui-measure":r==="none"?void 0:"reading",children:ye(at.Provider,{value:null,children:n})})})};import{useCallback as pn,useLayoutEffect as No,useRef as xe}from"react";import{jsx as we,jsxs as So}from"react/jsx-runtime";var yn=e=>[...e.querySelectorAll(de)].filter(t=>{let n=t.closest(ze);return n===null||!e.contains(n)}),Co=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 n=yn(t);if(n.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${n.length} ${de} elements for ${e.count} rows`);return n},ko=(e,t)=>{let n=-1;return e.forEach((r,a)=>{t.has(r)&&(n=a)}),e[n+1]},Lo=({onLoad:e,busy:t,done:n,failure:r,limit:a,rows:o,testId:s})=>{let{formatLocale:l,labels:i}=C(),d=xe(null),y=xe(null),u=xe(null),c=xe(!1),b=()=>{let p=o.ref.current;d.current={shown:new Set(p===null?[]:yn(p)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};No(()=>{let p=c.current;c.current=!1;let E=d.current;if(E===null)return;let h=Co(o);if(t){E.busySeen=!0,E.shown=new Set(h);return}let T=ko(h,E.shown),v=r!==null&&r.occurrence!==E.failureOccurrence;if(!(E.busySeen||T!==void 0||v||n)||(d.current=null,v||T===void 0))return;let k=[null,document.body].includes(document.activeElement);(u.current!==null&&document.activeElement===u.current||p&&k)&&T.focus()});let f=le(()=>n?y.current:u.current),m=pn((p=>{u.current=p;let E=f(p);return()=>{u.current=null,c.current=p===document.activeElement,E()}}),[f]),R=pn((p=>{y.current=p;let E=f(p);return()=>{y.current=null,E()}}),[f]);return n?we("div",{className:"cui-load-more","data-testid":s,children:we(P,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:R,testId:`${s}-end`,children:i.endOfRecords})}):So("div",{className:"cui-load-more","data-testid":s,children:[we(I,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:b,ref:m,testId:`${s}-button`,children:i.loadMore(me(a,l))}),r===null?null:we(ce,{occurrence:r.occurrence,testId:`${s}-failure`,children:i.loadFailed(r.reason)})]})};import{jsx as it,jsxs as fn}from"react/jsx-runtime";var Mo=({master:e,detail:t,masterMinPx:n,detailMinPx:r,testId:a})=>{g();let o=vt({masterMinPx:n,detailMinPx:r,gapPx:M.space["space-6"]});return fn("div",{className:"cui-container","data-testid":a,children:[it(Q,{ruleKey:o.key,css:o.css}),fn("div",{className:"cui-master-detail","data-cui-master-detail":o.key,children:[it("div",{className:"cui-master-detail-pane","data-testid":`${a}-master`,children:e}),it("div",{className:"cui-master-detail-pane","data-testid":`${a}-detail`,children:t})]})]})};import{jsx as Pe}from"react/jsx-runtime";var Ne=e=>{let{formatLocale:t,labels:n}=C(),{testId:r}=e;if(e.keep===void 0){let{value:s,unit:l}=e;if(l!==void 0&&!O(l))throw new RangeError(`${r}: a unit must hold a readable character: ${JSON.stringify(l)}`);if(s===null)return Pe("span",{className:"cui-measured","data-measured":"false","data-testid":r,children:n.unmeasured});let i=me(s,t);return Pe("span",{className:"cui-measured","data-measured":"true","data-testid":r,children:mt(i,l)})}let{text:a,keep:o}=e;if(a===null)return Pe("span",{className:"cui-measured","data-measured":"false","data-cui-keep":o,"data-testid":r,children:n.unmeasured});if(!O(a))throw new RangeError(`${r}: a measured text must hold a readable character (pass null when the value was not measured): ${JSON.stringify(a)}`);return Pe("span",{className:"cui-measured","data-measured":"true","data-cui-keep":o,"data-testid":r,children:a})};import{jsx as Ce,jsxs as $o}from"react/jsx-runtime";var Io=({label:e,value:t,min:n,max:r,valueText:a,testId:o})=>{if(g(),!(Number.isFinite(n)&&Number.isFinite(r)&&n<r))throw new RangeError(`Meter needs a finite range with min below max: min ${n}, max ${r}`);if(!(Number.isFinite(t)&&t>=n&&t<=r))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${n}, max ${r}`);return $o("span",{className:"cui-meter","data-testid":o,children:[Ce("span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":t,"aria-valuetext":a,"data-cui-surface":"sunken","data-testid":`${o}-bar`,children:Ce("span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-n)/(r-n)*100}%`},"data-testid":`${o}-fill`})}),Ce("span",{"aria-hidden":"true",children:Ce(P,{fg:"fg",type:"body",testId:`${o}-value`,children:a})})]})};import{useId as Fo,useRef as Ao}from"react";import{jsx as st,jsxs as Oo}from"react/jsx-runtime";var Do={ArrowLeft:-1,ArrowRight:1},Ho=({label:e,items:t,value:n,onValueChange:r,testId:a,panelDescribedBy:o,children:s})=>{g();let l=Fo(),i=Ao(new Map);if(t.length===0)throw new RangeError("PanelTabs needs at least one tab");let d=t.map(m=>m.id);if(new Set(d).size!==d.length)throw new RangeError(`Tab keys must be unique: ${d.join(", ")}`);let y=d.indexOf(n);if(y<0)throw new RangeError(`The selected tab "${n}" is not one of the tabs: ${d.join(", ")}`);let u=m=>`${l}-tab-${m}`,c=`${l}-panel`,b=m=>{let R=t[m];R.id!==n&&r(R.id),i.current.get(R.id)?.focus()};return Oo("div",{className:"cui-panel-tabs","data-testid":a,children:[st("div",{className:"cui-tabs-list",role:"tablist","aria-label":e,onKeyDown:m=>{let R=t.findIndex(T=>i.current.get(T.id)===m.target),p=R<0?y:R,E=Do[m.key],h;if(E!==void 0){let T=getComputedStyle(m.currentTarget).direction==="rtl"?-E:E;h=(p+T+t.length)%t.length}else if(m.key==="Home")h=0;else if(m.key==="End")h=t.length-1;else return;m.preventDefault(),b(h)},children:t.map((m,R)=>{let p=R===y;return st("button",{className:"cui-tab cui-panel-tab",type:"button",role:"tab",id:u(R),"aria-selected":p,"aria-controls":c,tabIndex:p?0:-1,"data-cui-fg":p?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${m.id}`,ref:E=>{E===null?i.current.delete(m.id):i.current.set(m.id,E)},onClick:()=>b(R),children:m.label},m.id)})}),st("div",{role:"tabpanel",id:c,"aria-labelledby":u(y),"aria-describedby":o,"data-testid":`${a}-panel`,children:s})]})};import{accessFailureKindOfStatus as Ko}from"@aiquants/auth-core";import{jsx as dt,jsxs as Bo}from"react/jsx-runtime";var Uo=({failure:e,onReload:t,deniedSentence:n,failureMessage:r,rescueRef:a,testId:o})=>{let{labels:s}=C(),l=dt(et,{failure:e,place:"read",deniedSentence:n,failed:r===void 0?s.loadFailed:r,retry:t,testId:`${o}-alert`});return e.status!==null&&Ko(e.status)!==null?dt("div",{className:"cui-resource-failed",ref:a,"data-testid":o,children:l},e.occurrence):Bo("div",{className:"cui-resource-failed","data-testid":o,children:[l,dt(I,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:a,testId:`${o}-reload`,children:s.reload})]})};import{useId as _o}from"react";import{jsx as W,jsxs as mn}from"react/jsx-runtime";var qo=({label:e,options:t,value:n,onValueChange:r,testId:a,density:o="regular"})=>{g();let s=_o(),l=new Set(t.map(i=>i.value));if(t.length<2||l.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(i=>i.value).join(", ")}`);if(!l.has(n))throw new RangeError(`The pressed value "${n}" is not one of the options: ${[...l].join(", ")}`);if(o!=="regular"&&o!=="compact")throw new RangeError(`A segmented control's density is "regular" or "compact", not ${JSON.stringify(o)}`);return o==="compact"?mn("fieldset",{className:"cui-segmented-group","aria-labelledby":s,"data-cui-density":"compact","data-testid":a,children:[W("span",{className:"cui-segmented-label",id:s,"data-cui-type":"caption",children:e}),W("div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===n;return W("button",{className:"cui-segment",type:"button","aria-pressed":d,"data-testid":`${a}-${i.value}`,onClick:()=>{d||r(i.value)},children:W("span",{className:"cui-segment-face","data-cui-fg":d?"on-solid":"fg","data-cui-surface":d?"info-solid":void 0,"data-cui-type":"caption","data-testid":`${a}-${i.value}-face`,children:i.label})},i.value)})})]}):mn("fieldset",{className:"cui-segmented-group","data-testid":a,children:[W("legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),W("div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===n;return W("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":`${a}-${i.value}`,onClick:()=>{d||r(i.value)},children:i.label},i.value)})})]})};import{useCallback as Go,useRef as Vo}from"react";import{jsx as z}from"react/jsx-runtime";var gn=e=>{let t=Vo(null),n=Go(r=>{if(t.current=r,typeof e=="function")return e(r);e!=null&&(e.current=r)},[e]);return{row:t,bindRow:n}},bn=({selected:e,controls:t,onSelect:n,testId:r,dataAttributes:a,ref:o,keyShortcuts:s,children:l})=>{g();let{row:i,bindRow:d}=gn(o);D(i,{testId:r,part:"row",host:"button"});let y=u=>{ae(u),n()};return z("button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"aria-keyshortcuts":B(s,r),"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:y,ref:d,...w(a),children:l})},Wo=({href:e,current:t,onNavigate:n,testId:r,dataAttributes:a,ref:o,keyShortcuts:s,children:l})=>{g();let{row:i,bindRow:d}=gn(o);D(i,{testId:r,part:"row",host:"link"});let y=u=>{ae(u),Z(u,e,n)};return z("a",{className:"cui-row-link",href:e,"aria-current":t?"page":void 0,"aria-keyshortcuts":B(s,r),"data-cui-row-focus":"","data-cui-surface":t?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:y,ref:d,...w(a),children:l})},zo=({label:e,items:t,itemKey:n,selectedKey:r,onSelect:a,detailId:o,renderRow:s,rowTestId:l,rowData:i,empty:d,testId:y,ref:u})=>(g(),z("div",{className:"cui-selectable","data-testid":y,ref:u,children:t.length===0?z(P,{as:"p",fg:"fg-muted",type:"prose",testId:`${y}-empty`,children:d}):z("ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(c=>{let b=n(c);return z("li",{children:z(bn,{selected:b===r,controls:o,onSelect:()=>a(c),testId:l,dataAttributes:i?.(c),children:s(c)})},b)})})}));import{useId as Jo}from"react";import{jsx as ke,jsxs as hn}from"react/jsx-runtime";var jo=({label:e,value:t,min:n,max:r,step:a,valueText:o,onValueChange:s,testId:l})=>{g();let i=Jo();if(!([t,n,r,a].every(Number.isFinite)&&n<r&&a>0&&n<=t&&t<=r))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${n}, max ${r}, step ${a}`);let d=o(t);return hn("div",{className:"cui-field","data-testid":`${l}-field`,children:[ke("label",{className:"cui-field-label",htmlFor:i,"data-cui-type":"body",children:e}),hn("div",{className:"cui-slider",children:[ke("input",{className:"cui-slider-input",id:i,type:"range",min:n,max:r,step:a,value:t,"aria-valuetext":d,"data-testid":l,onChange:y=>s(y.currentTarget.valueAsNumber)}),ke("span",{className:"cui-slider-value","aria-hidden":"true",children:ke(P,{fg:"fg",type:"body",testId:`${l}-value`,children:d})})]})]})};import{jsx as lt,jsxs as Tn}from"react/jsx-runtime";var Rn={done:0,current:1,pending:2},Xo={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Yo=({label:e,steps:t,testId:n})=>{let{labels:r}=C();if(t.length===0||new Set(t.map(o=>o.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(o=>o.id).join(", ")}`);if(t.filter(o=>o.state==="current").length>1||t.some((o,s)=>s>0&&Rn[o.state]<Rn[t[s-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(o=>o.state).join(", ")}`);let a={done:r.stepDone,current:null,pending:r.stepPending};return lt("ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":n,children:t.map((o,s)=>{let l=Xo[o.state],i=a[o.state];return Tn("li",{className:"cui-step","aria-current":o.state==="current"?"step":void 0,"data-cui-step":o.state,"data-testid":`${n}-${o.id}`,children:[lt("span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":l.fg,"data-cui-surface":l.surface,"data-cui-type":"caption",children:o.state==="done"?"\u2713":s+1}),Tn("span",{className:"cui-step-label","data-cui-fg":"fg",children:[o.label,i===null?null:lt("span",{className:"cui-visually-hidden",children:` (${i})`})]})]},o.id)})})};import{useId as Zo,useRef as Qo}from"react";import{jsx as Le,jsxs as En}from"react/jsx-runtime";var ea=({label:e,labelHidden:t,checked:n,onCheckedChange:r,unavailable:a,testId:o,ref:s,dataAttributes:l})=>{g();let i=Zo(),d=Qo(null);D(d,{testId:o,part:"label",host:"button"});let y=Y(a,i),u=a!==void 0,c=En("button",{className:"cui-switch",type:"button",role:"switch","aria-checked":n,"aria-disabled":u?!0:void 0,"aria-describedby":_(y),"data-cui-fg":"fg","data-cui-type":"body","data-testid":o,ref:s,onClick:()=>{u||r(!n)},...w(l),children:[Le("span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":n?"info-solid":"sunken","data-testid":`${o}-track`,children:Le("span",{className:"cui-switch-thumb","data-cui-surface":n?"surface":"neutral-solid","data-testid":`${o}-thumb`})}),Le("span",{className:t===!0?"cui-visually-hidden":void 0,ref:d,children:e})]});return a?.reason===void 0?c:En("span",{className:"cui-button-group",children:[c,Le(P,{fg:"fg-muted",type:"body",id:i,testId:`${o}-reason`,children:a.reason})]})};import{useCallback as ta,useEffect as na,useId as ra,useRef as vn,useState as oa}from"react";import{jsx as fe,jsxs as xn}from"react/jsx-runtime";var aa=({label:e,items:t,currentId:n,onNavigate:r,testId:a,collapsible:o=!1})=>{if(g(),t.length===0)throw new RangeError("Tabs needs at least one tab");let s=new Set(t.map(f=>f.id));if(s.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(f=>f.id).join(", ")}`);let l=t.find(f=>f.id===n);if(l===void 0)throw new RangeError(`The current tab "${n}" is not one of the tabs: ${[...s].join(", ")}`);let[i,d]=oa(!1),y=vn(null),u=vn(null),c=ra(),b=ta(f=>{d(!1),f&&y.current?.contains(document.activeElement)&&u.current?.focus()},[]);return na(()=>{if(!(o&&i))return;let f=p=>y.current!==null&&!y.current.contains(p),m=p=>{f(p.target)&&b(!0)},R=p=>{f(p.target)&&b(!1)};return document.addEventListener("pointerdown",m,!0),document.addEventListener("focusin",R,!0),()=>{document.removeEventListener("pointerdown",m,!0),document.removeEventListener("focusin",R,!0)}},[o,i,b]),xn("nav",{ref:y,className:"cui-tabs","aria-label":e,"data-testid":a,"data-cui-collapsible":o?"":void 0,"data-cui-open":o&&i?"":void 0,onKeyDown:o&&i?f=>q(f,()=>b(!0)):void 0,children:[o?xn("button",{ref:u,type:"button",className:"cui-tabs-summary","aria-expanded":i,"aria-controls":c,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${a}-summary`,onClick:()=>d(f=>!f),children:[fe("span",{className:"cui-tabs-summary-label",children:l.label}),fe("span",{className:"cui-tabs-summary-marker","aria-hidden":"true",children:i?"\u25B4":"\u25BE"})]}):null,fe("ul",{className:"cui-tabs-list",id:c,role:"list","data-cui-surface":o?"surface":void 0,children:t.map(f=>{let m=f.id===n;return fe("li",{className:"cui-tabs-item",children:fe("a",{className:"cui-tab",href:f.href,"aria-current":m?"page":void 0,"data-cui-fg":m?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${f.id}`,onClick:R=>{Z(R,f.href,r),R.defaultPrevented&&b(!1)},children:f.label})},f.id)})})]})};import{Children as ia,Fragment as sa,isValidElement as da}from"react";import{jsx as J,jsxs as Pn}from"react/jsx-runtime";var la={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},ua=e=>{g();let{label:t,sublabel:n,tone:r,testId:a,dataAttributes:o}=e;if((e.text===void 0?e.value===null:e.text===null)&&r!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${r}`);let l=`${a}-value`;return Pn("div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":a,...w(o),children:[J("p",{className:"cui-tile-label","data-cui-type":"caption","data-cui-measure":"reading",children:t}),J("p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption","data-cui-measure":"reading",children:n}),J("p",{className:"cui-tile-value","data-cui-fg":la[r],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?J(Ne,{value:e.value,unit:e.unit,testId:l}):J(Ne,{text:e.text,keep:"wrap",testId:l})})]})},wn=e=>ia.toArray(e).flatMap(t=>{if(!da(t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===sa?wn(t.props.children):[t]}),ca=({count:e,minInlinePx:t,testId:n,children:r})=>{g();let a=wt(e,t,M.space["space-2"]),o=wn(r).length;if(o!==e)throw new RangeError(`TileGrid has ${o} tiles but count is ${e}`);return Pn("div",{className:"cui-container","data-testid":n,children:[J(Q,{ruleKey:a.key,css:a.css}),J("div",{className:"cui-tile-grid","data-cui-tile-grid":a.key,"data-cui-gap":"space-2",children:r})]})};import{useLayoutEffect as pa,useRef as Nn}from"react";import{jsx as fa}from"react/jsx-runtime";var Se=e=>[...e.querySelectorAll("button")],ya=({label:e,testId:t,children:n})=>{g();let r=Nn(null),a=Nn(null);pa(()=>{let i=Se(r.current),d=a.current!==null&&i.includes(a.current)?a.current:i[0]??null;a.current=d;for(let y of i)y.tabIndex=y===d?0:-1});let o=i=>{for(let d of Se(r.current))d.tabIndex=d===i?0:-1;a.current=i};return fa("div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:r,onFocus:i=>{let d=Se(i.currentTarget).find(y=>y.contains(i.target));d!==void 0&&o(d)},onKeyDown:i=>{let d=Se(i.currentTarget),y=d.indexOf(i.target);if(y===-1)return;let u=getComputedStyle(i.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",c=u==="ArrowRight"?"ArrowLeft":"ArrowRight",f={[u]:(y+1)%d.length,[c]:(y-1+d.length)%d.length,Home:0,End:d.length-1}[i.key];if(f===void 0)return;i.preventDefault();let m=d[f];o(m),m.focus()},children:n})};import{useState as ma}from"react";var ga=e=>{let[t,n]=ma({failure:null,count:0});return e!==null&&e!==t.failure?(n({failure:e,count:t.count+1}),t.count+1):t.count};import{useCallback as re,useEffect as Ra,useLayoutEffect as kn,useRef as pt}from"react";import{useCallback as Me,useEffect as ba,useLayoutEffect as ha,useRef as ut,useState as ct}from"react";var Cn=e=>e===null?Ae:De,Ie=(e,t,n,r,a)=>{let[o,s]=ct(()=>({key:e,state:Cn(e)})),[l,i]=ct(0),[d,y]=ct(0),u=ut(t),c=ut(null),b=ut(l);ha(()=>{u.current=t}),ba(()=>{if(e===null){s({key:null,state:Ae});return}let h=new AbortController;c.current=e;let T=l===b.current?"revision":"reload";return b.current=l,s(v=>Object.is(v.key,e)?{key:e,state:r(v.state,T)}:{key:e,state:De}),u.current(h.signal).then(v=>{h.signal.aborted||(c.current=null,s(k=>({key:e,state:a(k.state,v)})))},v=>{h.signal.aborted||s(()=>{throw v})}),()=>{h.abort(),c.current=null}},[e,n,l,d]);let f=Me(()=>i(h=>h+1),[]),m=Me(()=>y(h=>h+1),[]),R=Me((h,T)=>{s(v=>Object.is(v.key,h)?{key:h,state:T(v.state)}:v)},[]),p=Me((h,T)=>{R(h,T),Object.is(c.current,h)&&m()},[R,m]);return{state:Object.is(o.key,e)?o.state:Cn(e),reload:f,refresh:m,update:R,write:p}};var Ta=(e,t,n)=>{let r=pt(t);kn(()=>{r.current=t});let a=re(p=>r.current.first(p),[]),{state:o,reload:s,refresh:l,update:i,write:d}=Ie(e,a,n,Nt,Ct),y=pt({key:e,state:o});kn(()=>{y.current={key:e,state:o}});let u=pt(null),c=re(()=>{u.current?.controller.abort(),u.current=null},[]);Ra(()=>c,[e,n,c]);let b=re(()=>{c(),s()},[c,s]),f=re(()=>{c(),l()},[c,l]),m=re(()=>{let{key:p,state:E}=y.current;if(p===null||E.kind!=="ready"||E.refreshing||E.value.next===null||E.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 h=E.value.next,T={key:p,controller:new AbortController,maps:[]};u.current=T,i(p,kt),r.current.next(h,T.controller.signal).then(v=>{u.current===T&&(u.current=null,i(p,k=>T.maps.reduce(($,oe)=>Oe($,oe),Lt(k,h,v))))},v=>{u.current===T&&i(p,()=>{throw v})})},[i]),R=re((p,E)=>{let h=u.current;h!==null&&Object.is(h.key,p)&&h.maps.push(E),d(p,T=>Oe(T,E))},[d]);return{state:o,reload:b,refresh:f,loadMore:m,updateList:R}};import{useCallback as Ea,useRef as va,useState as xa}from"react";var wa=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",Pa=()=>{let[e,t]=xa(null),n=va(null),r=Ea((a,o)=>{let s=o();if(!wa(s))return;let l=Symbol(a);n.current=l,t(a);let i=()=>{n.current===l&&(n.current=null,t(null))};s.then(i,i)},[]);return{pendingKey:e,press:r}};import{useCallback as Na}from"react";var Ca=(e,t,n)=>{let{state:r,reload:a,refresh:o,write:s}=Ie(e,t,n,Pt,He),l=Na((i,d)=>s(i,y=>He(y,{ok:!0,value:d})),[s]);return{state:r,reload:a,refresh:o,put:l}};import{jsx as La}from"react/jsx-runtime";var ka=({testId:e,children:t})=>(g(),La("span",{className:"cui-visually-hidden","data-testid":e,children:t}));export{ge as ANNOUNCE_SETTLE_MS,rr as AccessFailureNotice,ce as AlertMessage,or as Breadcrumb,I as Button,ht as COMPACT_ROW_PX,Ka as CONSOLE_UI_LABEL_CATALOGS,_a as CONTRAST_MINIMUM,bt as CONTRAST_PAIRS,We as Card,ur as CardSection,jr as CheckboxGroup,Ge as Cluster,pr as CodeBlock,mr as ComparisonGrid,Hn as ConsoleUiRoot,Lr as DataTable,Sr as DescriptionList,Ar as Dialog,Or as Disclosure,X as FIGURE_RING_REACH_PX,Za as FLEXIBLE_COLUMN_MIN_PX,et as FailureMessage,qr as Field,oo as Figure,so as FigureEdge,io as FigureNode,Xn as FragmentLink,si as HTTP_FORBIDDEN,uo as Heading,yo as InlineChange,To as JobCard,Fe as LATTICE_PX,Jn as Link,wo as List,Po as ListItem,Lo as LoadMore,qa as MORE_CONTRAST_MINIMUM,Mo as MasterDetail,Ne as Measured,Io as Meter,ua as MetricTile,Kr as Notice,Ho as PanelTabs,Vr as PasswordInput,rt as Pill,ot as ProgressBar,Va as ROW_WITH_CONTROL_PX,Jr as RadioGroup,Uo as ResourceFailed,bn as RowButton,Wo as RowLink,qo as SegmentedControl,zr as Select,zo as SelectableList,jo as Slider,Zn as Stack,Yo as Stepper,ea as Switch,j as TARGET_PX,M as TOKENS,fi as TONES,pi as TONE_HUES,yi as TONE_ROLES,aa as Tabs,P as Text,Wr as TextArea,Gr as TextInput,ca as TileGrid,ya as Toolbar,ka as VisuallyHidden,$a as ZonedTimeError,kt as beginPage,Nt as beginPagedReload,Pt as beginReload,ja as ceil8,Ga as ceilToLattice,Xa as cellContentInlinePx,Qa as comparisonAttributePx,Ba as contrastRatio,ti as countSampleText,Wa as cssVar,Rt as figureBoxPlan,Et as figureDiscLabelPlan,Ha as fillLabel,Ya as fixedColumnPx,li as flatMapOutcome,Sa as formatByteSize,me as formatCount,Da as formatInstant,oi as goldenSectionPx,Ua as hexToSrgb,ei as instantSampleText,O as isReadableText,He as keepLastGood,ui as lightDark,di as mapOutcome,Oe as mapPagedList,ai as masterDetailPlan,Ja as monoTextWidthEm,ci as placeholderRule,F as pxToRem,Ma as readDecimalText,Ia as readIntegerText,Oa as reasonAside,gt as resolveConsoleUiLabels,Ct as settleFirstPage,Lt as settlePage,ri as spacedTextWidthEm,ii as tableFrameMinInlinePx,xt as tableMinInlinePx,za as textWidthEm,wt as tileGridPlan,ni as tileMinInlinePx,Fa as toOffsetIso,Aa as toWallTime,ft as topmostModalOf,On as useAccessFailure,Be as useAnnounce,C as useConsoleUi,dr as useEscapeToClose,ga as useFailureOccurrence,le as useFocusRescue,Ta as usePagedResource,Pa as usePendingPress,Ca as useResource};
|
|
@@ -1724,11 +1724,18 @@
|
|
|
1724
1724
|
|
|
1725
1725
|
/* 対話: 枠 1 と、枠の幅を引いた余白 23 (枠と余白の和 24 が格子に乗る) の容器。幅は 40 字の段落 (WCAG 1.4.8) と両側の 24 の和
|
|
1726
1726
|
(--cui-measure-dialog。ホストが同じ外の幅の箱を作る時も同じ変数を使う) 以下で、表示域から左右 24 ずつを除いた幅を超えない。見出しは
|
|
1727
|
-
カードの見出しの規則を共にする (題の行 28 に閉じるボタン 44 を中央で揃え、上下 −8 で重ねる)
|
|
1727
|
+
カードの見出しの規則を共にする (題の行 28 に閉じるボタン 44 を中央で揃え、上下 −8 で重ねる)。
|
|
1728
|
+
置き場所と高さの上限は UA の既定に任せない。中央に置く UA の margin: auto は、cui より下の層に置かれたホストのリセット (全ての要素の
|
|
1729
|
+
margin を 0 にするもの) が消すので宣言し直す。UA の高さの上限 calc(100% - 6px - 2em) は格子を外れるので、包含ブロックから上下 24 ずつを
|
|
1730
|
+
除いた高さを格子へ切り下げる (上下の余りは 24 以上 26 未満で、外向きの焦点の輪が表示域の縁で切れない)。モーダルの包含ブロックは
|
|
1731
|
+
表示域からスクロールバーを除いた箱で、百分率はそれを読むので、古典的な横のスクロールバーの出た頁でも余りは 24 を保つ (表示域の単位は
|
|
1732
|
+
スクロールバーを数えないので、帯の分だけ余りが減る)。百分率は長さへ解けるので、round() の引数の型は揃う */
|
|
1728
1733
|
.cui-dialog {
|
|
1729
1734
|
box-sizing: border-box;
|
|
1730
1735
|
inline-size: var(--cui-measure-dialog);
|
|
1731
1736
|
max-inline-size: calc(100% - 2 * var(--cui-space-6));
|
|
1737
|
+
max-block-size: round(down, 100% - 2 * var(--cui-space-6), var(--cui-space-1));
|
|
1738
|
+
margin: auto;
|
|
1732
1739
|
padding: calc(var(--cui-space-6) - var(--cui-border-width));
|
|
1733
1740
|
border: var(--cui-border-width) solid var(--cui-border-subtle);
|
|
1734
1741
|
border-radius: var(--cui-radius-container);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiquants/console-ui",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Host-agnostic UI foundation for React admin consoles, with a React entry, a React-free core entry, a DOM testing entry and a stylesheet.",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css"
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"react-dom": ">=19"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@aiquants/auth-core": "0.9.
|
|
68
|
+
"@aiquants/auth-core": "0.9.3",
|
|
69
69
|
"@testing-library/jest-dom": "^6.9.1",
|
|
70
70
|
"@testing-library/react": "^16.3.2",
|
|
71
71
|
"@testing-library/user-event": "^14.6.1",
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
"@types/react-dom": "^19.2.3",
|
|
75
75
|
"@vitest/coverage-v8": "^4.1.8",
|
|
76
76
|
"jsdom": "^27.4.0",
|
|
77
|
+
"playwright": "^1.64.1",
|
|
77
78
|
"postcss": "^8.5.6",
|
|
78
79
|
"react": "^19.2.7",
|
|
79
80
|
"react-dom": "^19.2.7",
|