@aiquants/console-ui 0.4.1 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -254,10 +254,10 @@ Draw a modal as a `Dialog`: a modal `<dialog>` (`showModal()`) makes everything
254
254
  | `Measured` | A count, or the `unmeasured` label for `null` (never `0`). |
255
255
  | `MetricTile`, `TileGrid` | Metric tiles (100 px high) and the divisor grid. `count` is checked against the element children: a Fragment's children count one by one, a condition that renders no tile (`false`, `null`) does not count, a text child throws, and a component child counts as one tile whatever it renders (a wrapper returning `null` or two tiles is still one), so render `MetricTile` elements directly. |
256
256
  | `DataTable`, `LoadMore` | Fixed-layout table in a focusable named scroll frame; load-more that moves focus to the first row the page appended or the end-of-records text. |
257
- | `CodeBlock` | Preformatted text (a JSON document, an excerpt of a log) drawn exactly as given in the mono face and the `body` type, without wrapping, in a scroll frame on `sunken` with 8 px padding: a region named by `label` that takes keyboard focus, so a long line can be scrolled into view from the keyboard. |
257
+ | `CodeBlock` | Preformatted text (a JSON document, an excerpt of a log) drawn exactly as given in the mono face and the `body` type, without wrapping, in a scroll frame on `sunken` with 8 px padding: a region named by `label` that takes keyboard focus, so a long line can be scrolled into view from the keyboard. As a focusable frame it is never lower than the 44 px target (one line draws 44 px; k lines draw 2 × 8 + 20k px from two lines on). |
258
258
  | `SelectableList`, `RowButton` | Master list of selectable rows (`data-selected`, `aria-expanded`, `aria-controls`); the list carries an explicit `role="list"`, which WebKit needs to expose an unstyled list as a list. |
259
259
  | `ComparisonGrid` | Side-by-side comparison: a table named by its (visually hidden) `caption`, or one group per column named by its heading. Both layouts are in the DOM; each cell is a function called once per layout with `"table"` or `"stack"`, so every cell is rendered and mounted twice (the hidden copy included) and the caller gives each copy its own ids, test ids and refs. Cells must be presentational: no data read (`useResource`), announcement (`useAnnounce`) or focus management (`useFocusRescue`); keep state and effects above the grid and pass values into the cells. |
260
- | `Field`, `TextInput`, `TextArea`, `Select`, `RadioGroup` | Fields tied to their label, description and error with `useId`. |
260
+ | `Field`, `TextInput`, `PasswordInput`, `TextArea`, `Select`, `RadioGroup` | Fields tied to their label, description and error with `useId`. `PasswordInput` masks what is typed, tells the browser's password manager what the password is (`autoComplete`: `new-password` for one the operator sets, `current-password` for a sign-in) and turns spell checking and capitalization off. |
261
261
  | `ProgressBar` | Determinate with a maximum (clamped at 100 %); indeterminate without, drawn as a quarter-length segment that sweeps the track when motion is allowed and rests in its middle otherwise. The visible label names the bar; the visible value text is hidden from assistive technology, which reads it once as the bar's `aria-valuetext`. |
262
262
  | `Meter` | A value at its place in a fixed range (a score in [0, 1], a share of a quota), not progress: `role="meter"` named by `label` (no visible label; the row or field around it says what it measures), its fill in `info-accent` on a `sunken` track as long as the value's place in the range, beside the value text in `fg` (hidden from assistive technology, which reads it once as the meter's `aria-valuetext`). It is phrasing content that fits one `body` line, so it can be a line of a `RowButton`: it takes its parent's whole width even where the parent aligns its lines to the start (a `RowButton`), and the 8 px track is centred on the value text's 20 px line and takes the width left after the text, never less than 48 px. Refuses a range that is not finite or whose `min` is not below `max`, and a value outside the range. |
263
263
  | `MasterDetail` | Master–detail layout by container width; side by side, neither pane goes below its minimum. |
@@ -297,7 +297,7 @@ The test ids a component derives from its `testId` are public test hooks:
297
297
  | `SelectableList` | `<testId>-empty` (the `empty` text) |
298
298
  | `LoadMore` | `<testId>-button`, `<testId>-failure`, `<testId>-end` |
299
299
  | `ResourceFailed` | `<testId>-alert`, `<testId>-reload` |
300
- | `TextInput`, `TextArea`, `Select` | `<testId>-field` (the field root; `testId` itself is on the control), `<testId>-description`, `<testId>-error` |
300
+ | `TextInput`, `PasswordInput`, `TextArea`, `Select` | `<testId>-field` (the field root; `testId` itself is on the control), `<testId>-description`, `<testId>-error` |
301
301
  | `Field`, `RadioGroup` | `<testId>-description`, `<testId>-error`; `RadioGroup` also `<testId>-option-<value>` |
302
302
  | `ProgressBar` | `<testId>-bar` (the `progressbar`), `<testId>-fill`, `<testId>-value` (the visible value text) |
303
303
  | `Meter` | `<testId>-bar` (the `meter`), `<testId>-fill`, `<testId>-value` (the visible value text) |
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 _chunkA4D4K2WFcjs = require('./chunk-A4D4K2WF.cjs');var _chunkIR2WTSOWcjs = require('./chunk-IR2WTSOW.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var ce=_react.createContext.call(void 0, null),xt=" ",Be='[inert], [aria-hidden="true" i]',_e="dialog:modal",pe="data-cui-dialog-announcer",Et=`:scope > [${pe}]`,Nt=e=>{if(e.closest(Be)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=e.ownerDocument,o=[...t.querySelectorAll(_e)],r=t.activeElement,n=o.filter(c=>c.contains(r)),a=n.length>0?n:o,s=a.filter(c=>c.contains(e)).length;if(s===a.length)return{region:e};let d=a.find(c=>a.every(p=>p.contains(c))),i=_nullishCoalesce(_optionalChain([d, 'optionalAccess', _2 => _2.querySelector, 'call', _3 => _3(Et)]), () => (null));return d!==void 0&&i!==null&&e.parentElement.contains(d)&&i.closest(Be)===null?{region:i}:s===0?{hidden:"the topmost open modal dialog does not contain the console"}:{hidden:"open modal dialogs both contain and do not contain the console, and focus does not tell which one is topmost"}},Pt=e=>{try{e.querySelectorAll(_e)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},ue= exports.ANNOUNCE_SETTLE_MS =150,wt=1e3,Mt= exports.ConsoleUiRoot =({locale:e,formatLocale:t,timeZone:o,testId:r,children:n})=>{if(_react.useContext.call(void 0, ce)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");let s=_chunkA4D4K2WFcjs.o.call(void 0, e),[d]=Intl.getCanonicalLocales(t),i=_react.useMemo.call(void 0, ()=>new Intl.DateTimeFormat(d,{timeZone:o}).resolvedOptions().timeZone,[d,o]),c=_react.useRef.call(void 0, null),p=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{Pt(c.current.ownerDocument)},[]);let l=_react.useCallback.call(void 0, m=>{if(m.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let g=()=>{let{texts:w,settle:b,deadline:R}=p.current;p.current=null,clearTimeout(b),clearTimeout(R);let f=c.current;if(f===null)return;let h=w.join(xt),T=Nt(f);if("hidden"in T)throw new Error(`announce: the live region is hidden from assistive technology (${T.hidden}), so this announcement would be lost: ${h}`);let L=f.ownerDocument.createElement("span");L.textContent=h,T.region.replaceChildren(L)},x=p.current;if(x===null){p.current={texts:[m],settle:setTimeout(g,ue),deadline:setTimeout(g,wt)};return}x.texts.push(m),clearTimeout(x.settle),x.settle=setTimeout(g,ue)},[]),y=_react.useMemo.call(void 0, ()=>({locale:e,formatLocale:d,timeZone:i,labels:s,announce:l}),[e,d,i,s,l]);return _jsxruntime.jsx.call(void 0, ce.Provider,{value:y,children:_jsxruntime.jsxs.call(void 0, "div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":r,children:[n,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${r}-announcer`,ref:c})]})})},N= exports.useConsoleUi =()=>{let e=_react.useContext.call(void 0, ce);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},u=()=>{N()},St= exports.useAnnounce =()=>N().announce;var J=(e,t,o)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),o(t))};var kt=({items:e,current:t,onNavigate:o,testId:r})=>{let{labels:n}=N();if(new Set(e.map(a=>a.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(a=>a.id).join(", ")}`);return _jsxruntime.jsx.call(void 0, "nav",{className:"cui-breadcrumb","aria-label":n.breadcrumb,"data-testid":r,children:_jsxruntime.jsxs.call(void 0, "ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(a=>_jsxruntime.jsxs.call(void 0, "li",{className:"cui-breadcrumb-item",children:[_jsxruntime.jsx.call(void 0, "a",{className:"cui-link",href:a.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${r}-${a.id}`,onClick:s=>J(s,a.href,o),children:a.label}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},a.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 P=e=>{if(e===void 0)return{};for(let t of Object.keys(e))if(!t.startsWith("data-")||t.startsWith("data-cui-")||t==="data-testid")throw new RangeError(`Caller attributes must be data-* and must not override data-cui-* or data-testid: ${t}`);return e};var v=({fg:e,type:t,face:o,as:r="span",testId:n,id:a,tabIndex:s,ref:d,children:i})=>(u(),_jsxruntime.jsx.call(void 0, r,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":o,"data-testid":n,id:a,tabIndex:s,ref:d,children:i}));var Dt={primary:{fg:"on-solid",surface:"info-solid",type:"body"},secondary:{fg:"fg",surface:void 0,type:"body"},danger:{fg:"on-solid",surface:"danger-solid",type:"body"},link:{fg:"info-fg",surface:void 0,type:"body"}},Ve=({children:e})=>_jsxruntime.jsx.call(void 0, "span",{children:e}),S= exports.Button =({variant:e,children:t,testId:o,type:r="button",onClick:n,unavailable:a,expanded:s,controls:d,ref:i,dataAttributes:c,busy:p,busyLabel:l})=>{u();let y=_react.useId.call(void 0, ),m=p===!0||a!==void 0,g=Dt[e],x=w=>{if(m){w.preventDefault();return}_optionalChain([n, 'optionalCall', _4 => _4(w)])};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":g.fg,"data-cui-surface":g.surface,"data-cui-type":g.type,"data-testid":o,"aria-disabled":m?!0:void 0,"aria-busy":p===!0?!0:void 0,"aria-describedby":a===void 0?void 0:y,"aria-expanded":s,"aria-controls":d,onClick:x,ref:i,...P(c),children:_jsxruntime.jsx.call(void 0, Ve,{children:p===!0?l:t})}),a===void 0?null:_jsxruntime.jsx.call(void 0, v,{fg:"fg-muted",type:"body",id:y,testId:`${o}-reason`,children:a.reason})]})},$t= exports.Link =({onNavigate:e,children:t,testId:o,ref:r})=>(u(),_jsxruntime.jsx.call(void 0, "button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":o,onClick:e,ref:r,children:_jsxruntime.jsx.call(void 0, Ve,{children:t})}));var ye=({id:e,title:t,description:o,actions:r,testId:n,headingRef:a,ref:s,dataAttributes:d,children:i})=>{u();let c=_react.useId.call(void 0, );return _jsxruntime.jsxs.call(void 0, "section",{className:"cui-card",id:e,"aria-labelledby":c,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":n,ref:s,...P(d),children:[_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:c,"data-cui-type":"title",ref:a,tabIndex:a===void 0?void 0:-1,children:t}),o===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),r===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-actions",children:r})]}),i]})},Ft= exports.CardSection =({id:e,title:t,subtitle:o,region:r=!1,testId:n,headingRef:a,ref:s,dataAttributes:d,children:i})=>{u();let c=_react.useId.call(void 0, ),p=_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, "h3",{className:"cui-card-section-title",id:c,"data-cui-type":"body",ref:a,tabIndex:a===void 0?void 0:-1,children:t}),o===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),i]});return r?_jsxruntime.jsx.call(void 0, "section",{className:"cui-card-section",id:e,"aria-labelledby":c,"data-testid":n,ref:s,...P(d),children:p}):_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section",id:e,"data-testid":n,ref:s,...P(d),children:p})};var Ot=({label:e,code:t,testId:o})=>(u(),_jsxruntime.jsx.call(void 0, "section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":o,children:_jsxruntime.jsx.call(void 0, "pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${o}-code`,children:t})}));var H=({ruleKey:e,css:t})=>_jsxruntime.jsx.call(void 0, "style",{href:e,precedence:"cui",children:t});var qt=({caption:e,attributes:t,columns:o,attributePx:r,columnMinPx:n,testId:a})=>{u();let s=_react.useId.call(void 0, );for(let l of[r,n])if(!(Number.isFinite(l)&&l>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${l}`);if(o.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let l of o)for(let y of t)if(!Object.hasOwn(l.cells,y.key))throw new RangeError(`Column "${l.key}" has no value for attribute "${y.key}"`);let d=r+o.length*n,i=`cui-comparison-a${r}-c${n}-n${o.length}`,c=l=>`[data-cui-comparison="${i}"][data-cui-comparison-layout="${l}"]`,p=`${c("table")}{display:none}@container (min-width:${_chunkA4D4K2WFcjs.p.call(void 0, d)}){${c("table")}{display:block}${c("stack")}{display:none}}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-cui-stack-below-px":d,"data-testid":a,children:[_jsxruntime.jsx.call(void 0, H,{ruleKey:i,css:p}),_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:_chunkA4D4K2WFcjs.p.call(void 0, r)}}),o.map(l=>_jsxruntime.jsx.call(void 0, "col",{},l.key))]}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "td",{}),o.map(l=>_jsxruntime.jsx.call(void 0, "th",{scope:"col",children:l.heading},l.key))]})}),_jsxruntime.jsx.call(void 0, "tbody",{children:t.map(l=>_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "th",{scope:"row",children:l.label}),o.map(y=>_jsxruntime.jsx.call(void 0, "td",{children:y.cells[l.key]("table")},y.key))]},l.key))})]})}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-stack","data-cui-comparison":i,"data-cui-comparison-layout":"stack",children:o.map((l,y)=>{let m=`${s}-column-${y}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-comparison-column",role:"group","aria-labelledby":m,"data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-comparison-heading",id:m,children:l.heading}),_jsxruntime.jsx.call(void 0, "dl",{className:"cui-comparison-list",children:t.map(g=>_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "dt",{children:g.label}),_jsxruntime.jsx.call(void 0, "dd",{children:l.cells[g.key]("stack")})]},g.key))})]},l.key)})})]})};var Gt=({caption:e,captionHidden:t,columns:o,rows:r,rowKey:n,rowTestId:a,rowData:s,rowSize:d,empty:i,testId:c,ref:p})=>{u();let l=_react.useId.call(void 0, ),y=_chunkA4D4K2WFcjs.s.call(void 0, o);return _jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":c,ref:p,children:r.length===0?_jsxruntime.jsx.call(void 0, v,{as:"p",fg:"fg-muted",type:"prose",testId:`${c}-empty`,children:i}):_jsxruntime.jsx.call(void 0, "section",{className:"cui-table-frame",tabIndex:0,"aria-labelledby":l,"data-testid":`${c}-frame`,children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":d,style:{"--cui-table-min":_chunkA4D4K2WFcjs.p.call(void 0, y)},children:[_jsxruntime.jsx.call(void 0, "caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:l,children:e}),_jsxruntime.jsx.call(void 0, "colgroup",{children:o.map(m=>_jsxruntime.jsx.call(void 0, "col",{style:m.width.fixedPx===void 0?void 0:{width:_chunkA4D4K2WFcjs.p.call(void 0, m.width.fixedPx)}},m.key))}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsx.call(void 0, "tr",{children:o.map(m=>_jsxruntime.jsx.call(void 0, "th",{scope:"col","data-cui-align":m.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:m.header},m.key))})}),_jsxruntime.jsx.call(void 0, "tbody",{children:r.map(m=>_jsxruntime.jsx.call(void 0, "tr",{tabIndex:-1,"data-cui-row-focus":"","data-testid":a,...P(_optionalChain([s, 'optionalCall', _5 => _5(m)])),children:o.map(g=>_jsxruntime.jsx.call(void 0, "td",{"data-cui-align":g.align,children:g.cell(m)},g.key))},n(m)))})]})})})};var zt=({items:e,testId:t})=>{if(u(),new Set(e.map(o=>o.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(o=>o.key).join(", ")}`);return _jsxruntime.jsx.call(void 0, "dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(o=>_jsxruntime.jsxs.call(void 0, "div",{className:"cui-description-row","data-testid":`${t}-${o.key}`,children:[_jsxruntime.jsx.call(void 0, "dt",{"data-cui-fg":"fg-secondary",children:o.term}),_jsxruntime.jsx.call(void 0, "dd",{"data-cui-fg":"fg",children:o.description})]},o.key))})};var Zt=229,Yt=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),fe=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&Yt.has(e.type)&&(e.value!==""||e.validity.badInput),Xt= exports.useEscapeToClose =e=>_react.useCallback.call(void 0, t=>{t.key!=="Escape"||t.nativeEvent.isComposing||t.keyCode===Zt||fe(t.target)||(t.stopPropagation(),e())},[e]);var Ye=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},jt= exports.Dialog =({title:e,open:t,onClose:o,testId:r,children:n})=>{let{labels:a}=N(),s=_react.useId.call(void 0, ),d=_react.useRef.call(void 0, null),i=_react.useRef.call(void 0, null);return _react.useLayoutEffect.call(void 0, ()=>{let l=d.current;t&&!l.open?(i.current=l.ownerDocument.activeElement,l.showModal()):!t&&l.open&&l.close()},[t]),_react.useLayoutEffect.call(void 0, ()=>{let l=d.current;return()=>{l.open&&(l.close(),Ye(i.current),i.current=null)}},[]),_jsxruntime.jsxs.call(void 0, "dialog",{className:"cui-dialog","aria-labelledby":s,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":r,ref:d,onClose:()=>{Ye(i.current),i.current=null,t&&o()},onCancel:l=>{fe(l.currentTarget.ownerDocument.activeElement)&&l.preventDefault()},children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-dialog-header",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"cui-dialog-title",id:s,"data-cui-type":"title",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-dialog-actions",children:_jsxruntime.jsx.call(void 0, S,{variant:"secondary",testId:`${r}-close`,onClick:()=>_optionalChain([d, 'access', _6 => _6.current, 'optionalAccess', _7 => _7.close, 'call', _8 => _8()]),children:a.close})})]}),n,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[pe]:"","data-testid":`${r}-announcer`})]})};var to=({summary:e,open:t,onOpenChange:o,testId:r,children:n})=>{u();let a=_react.useId.call(void 0, );return _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":a,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${r}-button`,onClick:()=>o(!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",{children:e})]}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-disclosure-panel",id:a,hidden:!t,"data-testid":`${r}-panel`,children:n})]})};var q=({description:e,error:t})=>{u();let o=_react.useId.call(void 0, ),r=_react.useId.call(void 0, ),n=_react.useId.call(void 0, ),a=[e===void 0?null:r,t===void 0?null:n].filter(d=>d!==null).join(" ");return{control:{id:o,"aria-describedby":a===""?void 0:a,"aria-invalid":t===void 0?void 0:!0},descriptionId:r,errorId:n}},_=({description:e,error:t,descriptionId:o,errorId:r,testId:n})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[e===void 0?null:_jsxruntime.jsx.call(void 0, v,{as:"p",fg:"fg-muted",type:"body",id:o,testId:`${n}-description`,children:e}),t===void 0?null:_jsxruntime.jsx.call(void 0, v,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${n}-error`,children:t})]}),oo= exports.Field =({label:e,description:t,error:o,testId:r,children:n})=>{let{control:a,descriptionId:s,errorId:d}=q({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":r,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:a.id,"data-cui-type":"body",children:e}),n(a),_jsxruntime.jsx.call(void 0, _,{description:t,error:o,descriptionId:s,errorId:d,testId:r})]})},ro= exports.TextInput =({label:e,description:t,error:o,value:r,onValueChange:n,type:a,list:s,required:d,testId:i,ref:c})=>{let{control:p,descriptionId:l,errorId:y}=q({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${i}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:p.id,"data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "input",{className:"cui-input",type:a,value:r,list:s,required:d,onChange:m=>n(m.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":i,ref:c,...p}),_jsxruntime.jsx.call(void 0, _,{description:t,error:o,descriptionId:l,errorId:y,testId:i})]})},ao= exports.TextArea =({label:e,description:t,error:o,value:r,onValueChange:n,required:a,testId:s,ref:d})=>{let{control:i,descriptionId:c,errorId:p}=q({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:i.id,"data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "textarea",{className:"cui-input cui-textarea",value:r,required:a,onChange:l=>n(l.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":s,ref:d,...i}),_jsxruntime.jsx.call(void 0, _,{description:t,error:o,descriptionId:c,errorId:p,testId:s})]})},no= exports.Select =({label:e,description:t,error:o,value:r,options:n,onValueChange:a,testId:s,ref:d})=>{let{control:i,descriptionId:c,errorId:p}=q({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:i.id,"data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "select",{className:"cui-input",value:r,onChange:l=>a(l.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":s,ref:d,...i,children:n.map(l=>_jsxruntime.jsx.call(void 0, "option",{value:l.value,children:l.label},l.value))}),_jsxruntime.jsx.call(void 0, _,{description:t,error:o,descriptionId:c,errorId:p,testId:s})]})},so= exports.RadioGroup =({legend:e,description:t,error:o,value:r,options:n,onValueChange:a,testId:s,ref:d})=>{let i=_react.useId.call(void 0, ),{control:c,descriptionId:p,errorId:l}=q({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-radio-group","aria-describedby":c["aria-describedby"],"data-invalid":o!==void 0,"data-testid":s,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),n.map((y,m)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-radio","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"radio",name:i,value:y.value,checked:y.value===r,onChange:()=>a(y.value),"aria-invalid":c["aria-invalid"],"data-testid":`${s}-option-${y.value}`,ref:m===0?d:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:y.label})]},y.value)),_jsxruntime.jsx.call(void 0, _,{description:t,error:o,descriptionId:p,errorId:l,testId:s})]})};var lo={1:"h1",2:"h2",3:"h3"},co= exports.Heading =({level:e,type:t,testId:o,headingRef:r,children:n})=>{u();let a=lo[e];return _jsxruntime.jsx.call(void 0, a,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":o,ref:r,tabIndex:r===void 0?void 0:-1,children:n})};var po={neutral:{fg:"fg-secondary",surface:"sunken"},info:{fg:"info-fg",surface:"info-tint"},success:{fg:"success-fg",surface:"success-tint"},warning:{fg:"warning-fg",surface:"warning-tint"},danger:{fg:"danger-fg",surface:"danger-tint"}},yo={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},be= exports.Pill =({tone:e,variant:t,testId:o,dataAttributes:r,children:n})=>{u();let a=t==="tint"?po[e]:{fg:"on-solid",surface:yo[e]};return _jsxruntime.jsx.call(void 0, "span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":a.fg,"data-cui-surface":a.surface,"data-cui-type":"caption","data-testid":o,...P(r),children:n})};var Re=({label:e,valueText:t,value:o,max:r,testId:n})=>{u();let a=_react.useId.call(void 0, );if(r!==null){if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Progress maximum must be positive: ${r}`);if(o===null||!(Number.isFinite(o)&&o>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${o}`)}let s=r===null?null:{max:r,now:Math.min(o,r)};return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-progress","data-testid":n,children:[_jsxruntime.jsx.call(void 0, v,{as:"p",fg:"fg",type:"body",id:a,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":a,"aria-valuetext":t,"aria-valuemin":s===null?void 0:0,"aria-valuemax":_optionalChain([s, 'optionalAccess', _9 => _9.max]),"aria-valuenow":_optionalChain([s, 'optionalAccess', _10 => _10.now]),"data-cui-surface":"sunken","data-cui-indeterminate":s===null,"data-testid":`${n}-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":`${n}-fill`})}),_jsxruntime.jsx.call(void 0, "div",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, v,{as:"p",fg:"fg-secondary",type:"body",testId:`${n}-value`,children:t})})]})};var bo=({title:e,status:t,progress:o,cancel:r,testId:n,children:a})=>_jsxruntime.jsxs.call(void 0, ye,{title:e,actions:r===void 0?void 0:_jsxruntime.jsx.call(void 0, S,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${n}-cancel`,children:r.label}),testId:n,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${n}-status`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:`${e} `}),_jsxruntime.jsx.call(void 0, be,{tone:t.tone,variant:"tint",testId:`${n}-status-pill`,children:t.label})]}),o===void 0?null:_jsxruntime.jsx.call(void 0, Re,{...o,testId:`${n}-progress`}),a]});var Ro=({tone:e,testId:t,children:o})=>(u(),_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-testid":t,children:o})),V= exports.AlertMessage =({occurrence:e,testId:t,children:o})=>(u(),_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-occurrence":e,"data-testid":t,children:o},e));var vo=e=>e+1,Te= exports.useFocusRescue =e=>{let t=_react.useRef.call(void 0, e),o=_react.useRef.call(void 0, null),[,r]=_react.useReducer.call(void 0, vo,0),n=_react.useCallback.call(void 0, (a=>()=>{a.contains(document.activeElement)&&(o.current=a,r())}),[]);return _react.useLayoutEffect.call(void 0, ()=>{t.current=e}),_react.useLayoutEffect.call(void 0, ()=>{let a=o.current;if(a===null)return;o.current=null;let s=[null,document.body].includes(document.activeElement);a.isConnected||!s||_optionalChain([t, 'access', _11 => _11.current, 'call', _12 => _12(), 'optionalAccess', _13 => _13.focus, 'call', _14 => _14()])}),n};var he="[data-cui-row-focus]",xo=e=>{let t=e.ref.current;if(t===null)throw new Error("LoadMore: rows.ref is not attached to the element holding the rows");let o=[...t.querySelectorAll(he)];if(o.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${o.length} ${he} elements for ${e.count} rows`);return o},Eo=(e,t)=>{let o=-1;return e.forEach((r,n)=>{t.has(r)&&(o=n)}),e[o+1]},No= exports.LoadMore =({onLoad:e,busy:t,done:o,failure:r,limit:n,rows:a,testId:s})=>{let{formatLocale:d,labels:i}=N(),c=_react.useRef.call(void 0, null),p=_react.useRef.call(void 0, null),l=_react.useRef.call(void 0, null),y=_react.useRef.call(void 0, !1),m=()=>{let b=a.ref.current;c.current={shown:new Set(b===null?[]:b.querySelectorAll(he)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};_react.useLayoutEffect.call(void 0, ()=>{let b=y.current;y.current=!1;let R=c.current;if(R===null)return;let f=xo(a);if(t){R.busySeen=!0,R.shown=new Set(f);return}let h=Eo(f,R.shown),T=r!==null&&r.occurrence!==R.failureOccurrence;if(!(R.busySeen||h!==void 0||T||o)||(c.current=null,T||h===void 0))return;let L=[null,document.body].includes(document.activeElement);(l.current!==null&&document.activeElement===l.current||b&&L)&&h.focus()});let g=Te(()=>o?p.current:l.current),x=_react.useCallback.call(void 0, (b=>{l.current=b;let R=g(b);return()=>{l.current=null,y.current=b===document.activeElement,R()}}),[g]),w=_react.useCallback.call(void 0, (b=>{p.current=b;let R=g(b);return()=>{p.current=null,R()}}),[g]);return o?_jsxruntime.jsx.call(void 0, "div",{className:"cui-load-more","data-testid":s,children:_jsxruntime.jsx.call(void 0, v,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:w,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, S,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:m,ref:x,testId:`${s}-button`,children:i.loadMore(_chunkA4D4K2WFcjs.a.call(void 0, n,d))}),r===null?null:_jsxruntime.jsx.call(void 0, V,{occurrence:r.occurrence,testId:`${s}-failure`,children:i.loadFailed(r.reason)})]})};var wo=({master:e,detail:t,masterMinPx:o,detailMinPx:r,testId:n})=>{u();let a=_chunkA4D4K2WFcjs.r.call(void 0, {masterMinPx:o,detailMinPx:r,gapPx:_chunkA4D4K2WFcjs.G.space["space-6"]});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":n,children:[_jsxruntime.jsx.call(void 0, H,{ruleKey:a.key,css:a.css}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-master-detail","data-cui-master-detail":a.key,children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${n}-master`,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${n}-detail`,children:t})]})]})};var Ce=({value:e,unit:t,testId:o})=>{let{formatLocale:r,labels:n}=N();if(e===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-testid":o,children:n.unmeasured});let a=_chunkA4D4K2WFcjs.a.call(void 0, e,r);return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-testid":o,children:t===void 0?a:`${a} ${t}`})};var Mo=({label:e,value:t,min:o,max:r,valueText:n,testId:a})=>{if(u(),!(Number.isFinite(o)&&Number.isFinite(r)&&o<r))throw new RangeError(`Meter needs a finite range with min below max: min ${o}, max ${r}`);if(!(Number.isFinite(t)&&t>=o&&t<=r))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${o}, max ${r}`);return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-meter","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":t,"aria-valuetext":n,"data-cui-surface":"sunken","data-testid":`${a}-bar`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-o)/(r-o)*100}%`},"data-testid":`${a}-fill`})}),_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, v,{fg:"fg",type:"body",testId:`${a}-value`,children:n})})]})};var Lo=({failure:e,onReload:t,forbiddenMessage:o,failureMessage:r,rescueRef:n,testId:a})=>{let{labels:s}=N();return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-resource-failed","data-testid":a,children:[_jsxruntime.jsx.call(void 0, V,{occurrence:e.occurrence,testId:`${a}-alert`,children:s.failureSentence(e,o,r===void 0?s.loadFailed:r)}),e.status===403?null:_jsxruntime.jsx.call(void 0, S,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:n,testId:`${a}-reload`,children:s.reload})]})};var Io=({label:e,options:t,value:o,onValueChange:r,testId:n})=>{u();let a=new Set(t.map(s=>s.value));if(t.length<2||a.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(s=>s.value).join(", ")}`);if(!a.has(o))throw new RangeError(`The pressed value "${o}" is not one of the options: ${[...a].join(", ")}`);return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-segmented-group","data-testid":n,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(s=>{let d=s.value===o;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":`${n}-${s.value}`,onClick:()=>{d||r(s.value)},children:s.label},s.value)})})]})};var it=({selected:e,controls:t,onSelect:o,testId:r,dataAttributes:n,ref:a,children:s})=>(u(),_jsxruntime.jsx.call(void 0, "button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:o,ref:a,...P(n),children:s})),Do= exports.SelectableList =({label:e,items:t,itemKey:o,selectedKey:r,onSelect:n,detailId:a,renderRow:s,rowTestId:d,rowData:i,empty:c,testId:p,ref:l})=>(u(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-selectable","data-testid":p,ref:l,children:t.length===0?_jsxruntime.jsx.call(void 0, v,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:c}):_jsxruntime.jsx.call(void 0, "ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(y=>{let m=o(y);return _jsxruntime.jsx.call(void 0, "li",{children:_jsxruntime.jsx.call(void 0, it,{selected:m===r,controls:a,onSelect:()=>n(y),testId:d,dataAttributes:_optionalChain([i, 'optionalCall', _15 => _15(y)]),children:s(y)})},m)})})}));var Ho=({label:e,value:t,min:o,max:r,step:n,valueText:a,onValueChange:s,testId:d})=>{u();let i=_react.useId.call(void 0, );if(!([t,o,r,n].every(Number.isFinite)&&o<r&&n>0&&o<=t&&t<=r))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${o}, max ${r}, step ${n}`);let c=a(t);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-testid":`${d}-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:o,max:r,step:n,value:t,"aria-valuetext":c,"data-testid":d,onChange:p=>s(p.currentTarget.valueAsNumber)}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-slider-value","aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, v,{fg:"fg",type:"body",testId:`${d}-value`,children:c})})]})]})};var Fo=({gap:e,testId:t,children:o})=>(u(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:o})),Uo= exports.Cluster =({gap:e,testId:t,children:o})=>(u(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-cluster","data-cui-gap":e,"data-testid":t,children:o}));var ct={done:0,current:1,pending:2},Oo={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Bo= exports.Stepper =({label:e,steps:t,testId:o})=>{let{labels:r}=N();if(t.length===0||new Set(t.map(a=>a.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(a=>a.id).join(", ")}`);if(t.filter(a=>a.state==="current").length>1||t.some((a,s)=>s>0&&ct[a.state]<ct[t[s-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(a=>a.state).join(", ")}`);let n={done:r.stepDone,current:null,pending:r.stepPending};return _jsxruntime.jsx.call(void 0, "ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":o,children:t.map((a,s)=>{let d=Oo[a.state],i=n[a.state];return _jsxruntime.jsxs.call(void 0, "li",{className:"cui-step","aria-current":a.state==="current"?"step":void 0,"data-cui-step":a.state,"data-testid":`${o}-${a.id}`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":d.fg,"data-cui-surface":d.surface,"data-cui-type":"caption",children:a.state==="done"?"\u2713":s+1}),_jsxruntime.jsxs.call(void 0, "span",{className:"cui-step-label","data-cui-fg":"fg",children:[a.label,i===null?null:_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:` (${i})`})]})]},a.id)})})};var Ko=({label:e,checked:t,onCheckedChange:o,testId:r})=>(u(),_jsxruntime.jsxs.call(void 0, "button",{className:"cui-switch",type:"button",role:"switch","aria-checked":t,"data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:()=>o(!t),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":t?"info-solid":"sunken","data-testid":`${r}-track`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-thumb","data-cui-surface":t?"surface":"neutral-solid","data-testid":`${r}-thumb`})}),_jsxruntime.jsx.call(void 0, "span",{children:e})]}));var _o=({label:e,items:t,currentId:o,onNavigate:r,testId:n})=>{if(u(),t.length===0)throw new RangeError("Tabs needs at least one tab");let a=new Set(t.map(s=>s.id));if(a.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(s=>s.id).join(", ")}`);if(!a.has(o))throw new RangeError(`The current tab "${o}" is not one of the tabs: ${[...a].join(", ")}`);return _jsxruntime.jsx.call(void 0, "nav",{className:"cui-tabs","aria-label":e,"data-testid":n,children:_jsxruntime.jsx.call(void 0, "ul",{className:"cui-tabs-list",role:"list",children:t.map(s=>{let d=s.id===o;return _jsxruntime.jsx.call(void 0, "li",{className:"cui-tabs-item",children:_jsxruntime.jsx.call(void 0, "a",{className:"cui-tab",href:s.href,"aria-current":d?"page":void 0,"data-cui-fg":d?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${n}-${s.id}`,onClick:i=>J(i,s.href,r),children:s.label})},s.id)})})})};var Wo={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},Jo= exports.MetricTile =({label:e,sublabel:t,value:o,tone:r,testId:n,dataAttributes:a})=>{if(u(),o===null&&r!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${r}`);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":n,...P(a),children:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-label","data-cui-type":"caption",children:e}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption",children:t}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-value","data-cui-fg":Wo[r],"data-cui-type":"heading",children:_jsxruntime.jsx.call(void 0, Ce,{value:o,testId:`${n}-value`})})]})},pt=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?pt(t.props.children):[t]}),Zo= exports.TileGrid =({count:e,minInlinePx:t,testId:o,children:r})=>{u();let n=_chunkA4D4K2WFcjs.w.call(void 0, e,t,_chunkA4D4K2WFcjs.G.space["space-2"]),a=pt(r).length;if(a!==e)throw new RangeError(`TileGrid has ${a} tiles but count is ${e}`);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":o,children:[_jsxruntime.jsx.call(void 0, H,{ruleKey:n.key,css:n.css}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-tile-grid","data-cui-tile-grid":n.key,"data-cui-gap":"space-2",children:r})]})};var re=e=>[...e.querySelectorAll("button")],Xo= exports.Toolbar =({label:e,testId:t,children:o})=>{u();let r=_react.useRef.call(void 0, null),n=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{let i=re(r.current),c=n.current!==null&&i.includes(n.current)?n.current:_nullishCoalesce(i[0], () => (null));n.current=c;for(let p of i)p.tabIndex=p===c?0:-1});let a=i=>{for(let c of re(r.current))c.tabIndex=c===i?0:-1;n.current=i};return _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 c=re(i.currentTarget).find(p=>p.contains(i.target));c!==void 0&&a(c)},onKeyDown:i=>{let c=re(i.currentTarget),p=c.indexOf(i.target);if(p===-1)return;let l=getComputedStyle(i.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",y=l==="ArrowRight"?"ArrowLeft":"ArrowRight",g={[l]:(p+1)%c.length,[y]:(p-1+c.length)%c.length,Home:0,End:c.length-1}[i.key];if(g===void 0)return;i.preventDefault();let x=c[g];a(x),x.focus()},children:o})};var ft=e=>e===null?_chunkA4D4K2WFcjs.i:_chunkA4D4K2WFcjs.j,ne=(e,t,o,r,n)=>{let[a,s]=_react.useState.call(void 0, ()=>({key:e,state:ft(e)})),[d,i]=_react.useState.call(void 0, 0),[c,p]=_react.useState.call(void 0, 0),l=_react.useRef.call(void 0, t),y=_react.useRef.call(void 0, null),m=_react.useRef.call(void 0, d);_react.useLayoutEffect.call(void 0, ()=>{l.current=t}),_react.useEffect.call(void 0, ()=>{if(e===null){s({key:null,state:_chunkA4D4K2WFcjs.i});return}let f=new AbortController;y.current=e;let h=d===m.current?"revision":"reload";return m.current=d,s(T=>Object.is(T.key,e)?{key:e,state:r(T.state,h)}:{key:e,state:_chunkA4D4K2WFcjs.j}),l.current(f.signal).then(T=>{f.signal.aborted||(y.current=null,s(L=>({key:e,state:n(L.state,T)})))},T=>{f.signal.aborted||s(()=>{throw T})}),()=>{f.abort(),y.current=null}},[e,o,d,c]);let g=_react.useCallback.call(void 0, ()=>i(f=>f+1),[]),x=_react.useCallback.call(void 0, ()=>p(f=>f+1),[]),w=_react.useCallback.call(void 0, (f,h)=>{s(T=>Object.is(T.key,f)?{key:f,state:h(T.state)}:T)},[]),b=_react.useCallback.call(void 0, (f,h)=>{w(f,h),Object.is(y.current,f)&&x()},[w,x]);return{state:Object.is(a.key,e)?a.state:ft(e),reload:g,refresh:x,update:w,write:b}};var or=(e,t,o)=>{let r=_react.useRef.call(void 0, t);_react.useLayoutEffect.call(void 0, ()=>{r.current=t});let n=_react.useCallback.call(void 0, b=>r.current.first(b),[]),{state:a,reload:s,refresh:d,update:i,write:c}=ne(e,n,o,_chunkA4D4K2WFcjs.x,_chunkA4D4K2WFcjs.y),p=_react.useRef.call(void 0, {key:e,state:a});_react.useLayoutEffect.call(void 0, ()=>{p.current={key:e,state:a}});let l=_react.useRef.call(void 0, null),y=_react.useCallback.call(void 0, ()=>{_optionalChain([l, 'access', _16 => _16.current, 'optionalAccess', _17 => _17.controller, 'access', _18 => _18.abort, 'call', _19 => _19()]),l.current=null},[]);_react.useEffect.call(void 0, ()=>y,[e,o,y]);let m=_react.useCallback.call(void 0, ()=>{y(),s()},[y,s]),g=_react.useCallback.call(void 0, ()=>{y(),d()},[y,d]),x=_react.useCallback.call(void 0, ()=>{let{key:b,state:R}=p.current;if(b===null||R.kind!=="ready"||R.refreshing||R.value.next===null||R.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let f=R.value.next,h={key:b,controller:new AbortController,maps:[]};l.current=h,i(b,_chunkA4D4K2WFcjs.z),r.current.next(f,h.controller.signal).then(T=>{l.current===h&&(l.current=null,i(b,L=>h.maps.reduce((bt,Rt)=>_chunkA4D4K2WFcjs.B.call(void 0, bt,Rt),_chunkA4D4K2WFcjs.A.call(void 0, L,f,T))))},T=>{l.current===h&&i(b,()=>{throw T})})},[i]),w=_react.useCallback.call(void 0, (b,R)=>{let f=l.current;f!==null&&Object.is(f.key,b)&&f.maps.push(R),c(b,h=>_chunkA4D4K2WFcjs.B.call(void 0, h,R))},[c]);return{state:a,reload:m,refresh:g,loadMore:x,updateList:w}};var ar=(e,t,o)=>{let{state:r,reload:n,refresh:a,write:s}=ne(e,t,o,_chunkA4D4K2WFcjs.k,_chunkA4D4K2WFcjs.l),d=_react.useCallback.call(void 0, (i,c)=>s(i,p=>_chunkA4D4K2WFcjs.l.call(void 0, p,{ok:!0,value:c})),[s]);return{state:r,reload:n,refresh:a,put:d}};var nr=({testId:e,children:t})=>(u(),_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden","data-testid":e,children:t}));exports.ANNOUNCE_SETTLE_MS = ue; exports.AlertMessage = V; exports.Breadcrumb = kt; exports.Button = S; exports.CONSOLE_UI_LABEL_CATALOGS = _chunkA4D4K2WFcjs.n; exports.CONTRAST_MINIMUM = _chunkIR2WTSOWcjs.c; exports.CONTRAST_PAIRS = _chunkIR2WTSOWcjs.d; exports.Card = ye; exports.CardSection = Ft; exports.Cluster = Uo; exports.CodeBlock = Ot; exports.ComparisonGrid = qt; exports.ConsoleUiRoot = Mt; exports.DataTable = Gt; exports.DescriptionList = zt; exports.Dialog = jt; exports.Disclosure = to; exports.Field = oo; exports.HTTP_FORBIDDEN = _chunkA4D4K2WFcjs.f; exports.Heading = co; exports.JobCard = bo; exports.LATTICE_PX = _chunkA4D4K2WFcjs.C; exports.Link = $t; exports.LoadMore = No; exports.MasterDetail = wo; exports.Measured = Ce; exports.Meter = Mo; exports.MetricTile = Jo; exports.Notice = Ro; exports.Pill = be; exports.ProgressBar = Re; exports.ROW_WITH_CONTROL_PX = _chunkA4D4K2WFcjs.F; exports.RadioGroup = so; exports.ResourceFailed = Lo; exports.RowButton = it; exports.SegmentedControl = Io; exports.Select = no; exports.SelectableList = Do; exports.Slider = Ho; exports.Stack = Fo; exports.Stepper = Bo; exports.Switch = Ko; exports.TARGET_PX = _chunkA4D4K2WFcjs.E; exports.TOKENS = _chunkA4D4K2WFcjs.G; exports.Tabs = _o; exports.Text = v; exports.TextArea = ao; exports.TextInput = ro; exports.TileGrid = Zo; exports.Toolbar = Xo; exports.VisuallyHidden = nr; exports.ZonedTimeError = _chunkA4D4K2WFcjs.b; exports.beginPage = _chunkA4D4K2WFcjs.z; exports.beginPagedReload = _chunkA4D4K2WFcjs.x; exports.beginReload = _chunkA4D4K2WFcjs.k; exports.ceil8 = _chunkA4D4K2WFcjs.v; exports.ceilToLattice = _chunkA4D4K2WFcjs.D; exports.contrastRatio = _chunkIR2WTSOWcjs.b; exports.cssVar = _chunkA4D4K2WFcjs.H; exports.flatMapOutcome = _chunkA4D4K2WFcjs.h; exports.formatCount = _chunkA4D4K2WFcjs.a; exports.formatInstant = _chunkA4D4K2WFcjs.e; exports.hexToSrgb = _chunkIR2WTSOWcjs.a; exports.keepLastGood = _chunkA4D4K2WFcjs.l; exports.mapOutcome = _chunkA4D4K2WFcjs.g; exports.mapPagedList = _chunkA4D4K2WFcjs.B; exports.masterDetailPlan = _chunkA4D4K2WFcjs.q; exports.monoTextWidthEm = _chunkA4D4K2WFcjs.u; exports.reasonAside = _chunkA4D4K2WFcjs.m; exports.resolveConsoleUiLabels = _chunkA4D4K2WFcjs.o; exports.settleFirstPage = _chunkA4D4K2WFcjs.y; exports.settlePage = _chunkA4D4K2WFcjs.A; exports.tableMinInlinePx = _chunkA4D4K2WFcjs.s; exports.textWidthEm = _chunkA4D4K2WFcjs.t; exports.tileGridPlan = _chunkA4D4K2WFcjs.w; exports.toOffsetIso = _chunkA4D4K2WFcjs.c; exports.toWallTime = _chunkA4D4K2WFcjs.d; exports.useAnnounce = St; exports.useConsoleUi = N; exports.useEscapeToClose = Xt; exports.useFocusRescue = Te; exports.usePagedResource = or; exports.useResource = ar;
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 _chunkA4D4K2WFcjs = require('./chunk-A4D4K2WF.cjs');var _chunkIR2WTSOWcjs = require('./chunk-IR2WTSOW.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var ce=_react.createContext.call(void 0, null),Pt=" ",Be='[inert], [aria-hidden="true" i]',_e="dialog:modal",pe="data-cui-dialog-announcer",Et=`:scope > [${pe}]`,Nt=e=>{if(e.closest(Be)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=e.ownerDocument,o=[...t.querySelectorAll(_e)],r=t.activeElement,n=o.filter(c=>c.contains(r)),a=n.length>0?n:o,s=a.filter(c=>c.contains(e)).length;if(s===a.length)return{region:e};let d=a.find(c=>a.every(p=>p.contains(c))),i=_nullishCoalesce(_optionalChain([d, 'optionalAccess', _2 => _2.querySelector, 'call', _3 => _3(Et)]), () => (null));return d!==void 0&&i!==null&&e.parentElement.contains(d)&&i.closest(Be)===null?{region:i}:s===0?{hidden:"the topmost open modal dialog does not contain the console"}:{hidden:"open modal dialogs both contain and do not contain the console, and focus does not tell which one is topmost"}},wt=e=>{try{e.querySelectorAll(_e)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},ue= exports.ANNOUNCE_SETTLE_MS =150,Mt=1e3,Lt= exports.ConsoleUiRoot =({locale:e,formatLocale:t,timeZone:o,testId:r,children:n})=>{if(_react.useContext.call(void 0, ce)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");let s=_chunkA4D4K2WFcjs.o.call(void 0, e),[d]=Intl.getCanonicalLocales(t),i=_react.useMemo.call(void 0, ()=>new Intl.DateTimeFormat(d,{timeZone:o}).resolvedOptions().timeZone,[d,o]),c=_react.useRef.call(void 0, null),p=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{wt(c.current.ownerDocument)},[]);let l=_react.useCallback.call(void 0, m=>{if(m.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let f=()=>{let{texts:w,settle:b,deadline:R}=p.current;p.current=null,clearTimeout(b),clearTimeout(R);let g=c.current;if(g===null)return;let h=w.join(Pt),T=Nt(g);if("hidden"in T)throw new Error(`announce: the live region is hidden from assistive technology (${T.hidden}), so this announcement would be lost: ${h}`);let S=g.ownerDocument.createElement("span");S.textContent=h,T.region.replaceChildren(S)},C=p.current;if(C===null){p.current={texts:[m],settle:setTimeout(f,ue),deadline:setTimeout(f,Mt)};return}C.texts.push(m),clearTimeout(C.settle),C.settle=setTimeout(f,ue)},[]),y=_react.useMemo.call(void 0, ()=>({locale:e,formatLocale:d,timeZone:i,labels:s,announce:l}),[e,d,i,s,l]);return _jsxruntime.jsx.call(void 0, ce.Provider,{value:y,children:_jsxruntime.jsxs.call(void 0, "div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":r,children:[n,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${r}-announcer`,ref:c})]})})},E= exports.useConsoleUi =()=>{let e=_react.useContext.call(void 0, ce);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},u=()=>{E()},St= exports.useAnnounce =()=>E().announce;var J=(e,t,o)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),o(t))};var It=({items:e,current:t,onNavigate:o,testId:r})=>{let{labels:n}=E();if(new Set(e.map(a=>a.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(a=>a.id).join(", ")}`);return _jsxruntime.jsx.call(void 0, "nav",{className:"cui-breadcrumb","aria-label":n.breadcrumb,"data-testid":r,children:_jsxruntime.jsxs.call(void 0, "ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(a=>_jsxruntime.jsxs.call(void 0, "li",{className:"cui-breadcrumb-item",children:[_jsxruntime.jsx.call(void 0, "a",{className:"cui-link",href:a.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${r}-${a.id}`,onClick:s=>J(s,a.href,o),children:a.label}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},a.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 N=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 x=({fg:e,type:t,face:o,as:r="span",testId:n,id:a,tabIndex:s,ref:d,children:i})=>(u(),_jsxruntime.jsx.call(void 0, r,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":o,"data-testid":n,id:a,tabIndex:s,ref:d,children:i}));var $t={primary:{fg:"on-solid",surface:"info-solid",type:"body"},secondary:{fg:"fg",surface:void 0,type:"body"},danger:{fg:"on-solid",surface:"danger-solid",type:"body"},link:{fg:"info-fg",surface:void 0,type:"body"}},Ve=({children:e})=>_jsxruntime.jsx.call(void 0, "span",{children:e}),L= exports.Button =({variant:e,children:t,testId:o,type:r="button",onClick:n,unavailable:a,expanded:s,controls:d,ref:i,dataAttributes:c,busy:p,busyLabel:l})=>{u();let y=_react.useId.call(void 0, ),m=p===!0||a!==void 0,f=$t[e],C=w=>{if(m){w.preventDefault();return}_optionalChain([n, 'optionalCall', _4 => _4(w)])};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":f.fg,"data-cui-surface":f.surface,"data-cui-type":f.type,"data-testid":o,"aria-disabled":m?!0:void 0,"aria-busy":p===!0?!0:void 0,"aria-describedby":a===void 0?void 0:y,"aria-expanded":s,"aria-controls":d,onClick:C,ref:i,...N(c),children:_jsxruntime.jsx.call(void 0, Ve,{children:p===!0?l:t})}),a===void 0?null:_jsxruntime.jsx.call(void 0, x,{fg:"fg-muted",type:"body",id:y,testId:`${o}-reason`,children:a.reason})]})},Ht= exports.Link =({onNavigate:e,children:t,testId:o,ref:r})=>(u(),_jsxruntime.jsx.call(void 0, "button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":o,onClick:e,ref:r,children:_jsxruntime.jsx.call(void 0, Ve,{children:t})}));var ye=({id:e,title:t,description:o,actions:r,testId:n,headingRef:a,ref:s,dataAttributes:d,children:i})=>{u();let c=_react.useId.call(void 0, );return _jsxruntime.jsxs.call(void 0, "section",{className:"cui-card",id:e,"aria-labelledby":c,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":n,ref:s,...N(d),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:c,"data-cui-type":"title",ref:a,tabIndex:a===void 0?void 0:-1,children:t}),o===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),r===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-actions",children:r})]}),i]})},Ut= exports.CardSection =({id:e,title:t,subtitle:o,region:r=!1,testId:n,headingRef:a,ref:s,dataAttributes:d,children:i})=>{u();let c=_react.useId.call(void 0, ),p=_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, "h3",{className:"cui-card-section-title",id:c,"data-cui-type":"body",ref:a,tabIndex:a===void 0?void 0:-1,children:t}),o===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),i]});return r?_jsxruntime.jsx.call(void 0, "section",{className:"cui-card-section",id:e,"aria-labelledby":c,"data-testid":n,ref:s,...N(d),children:p}):_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section",id:e,"data-testid":n,ref:s,...N(d),children:p})};var Bt=({label:e,code:t,testId:o})=>(u(),_jsxruntime.jsx.call(void 0, "section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":o,children:_jsxruntime.jsx.call(void 0, "pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${o}-code`,children:t})}));var H=({ruleKey:e,css:t})=>_jsxruntime.jsx.call(void 0, "style",{href:e,precedence:"cui",children:t});var _t=({caption:e,attributes:t,columns:o,attributePx:r,columnMinPx:n,testId:a})=>{u();let s=_react.useId.call(void 0, );for(let l of[r,n])if(!(Number.isFinite(l)&&l>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${l}`);if(o.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let l of o)for(let y of t)if(!Object.hasOwn(l.cells,y.key))throw new RangeError(`Column "${l.key}" has no value for attribute "${y.key}"`);let d=r+o.length*n,i=`cui-comparison-a${r}-c${n}-n${o.length}`,c=l=>`[data-cui-comparison="${i}"][data-cui-comparison-layout="${l}"]`,p=`${c("table")}{display:none}@container (min-width:${_chunkA4D4K2WFcjs.p.call(void 0, d)}){${c("table")}{display:block}${c("stack")}{display:none}}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-cui-stack-below-px":d,"data-testid":a,children:[_jsxruntime.jsx.call(void 0, H,{ruleKey:i,css:p}),_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:_chunkA4D4K2WFcjs.p.call(void 0, r)}}),o.map(l=>_jsxruntime.jsx.call(void 0, "col",{},l.key))]}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "td",{}),o.map(l=>_jsxruntime.jsx.call(void 0, "th",{scope:"col",children:l.heading},l.key))]})}),_jsxruntime.jsx.call(void 0, "tbody",{children:t.map(l=>_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "th",{scope:"row",children:l.label}),o.map(y=>_jsxruntime.jsx.call(void 0, "td",{children:y.cells[l.key]("table")},y.key))]},l.key))})]})}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-stack","data-cui-comparison":i,"data-cui-comparison-layout":"stack",children:o.map((l,y)=>{let m=`${s}-column-${y}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-comparison-column",role:"group","aria-labelledby":m,"data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-comparison-heading",id:m,children:l.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:l.cells[f.key]("stack")})]},f.key))})]},l.key)})})]})};var Vt=({caption:e,captionHidden:t,columns:o,rows:r,rowKey:n,rowTestId:a,rowData:s,rowSize:d,empty:i,testId:c,ref:p})=>{u();let l=_react.useId.call(void 0, ),y=_chunkA4D4K2WFcjs.s.call(void 0, o);return _jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":c,ref:p,children:r.length===0?_jsxruntime.jsx.call(void 0, x,{as:"p",fg:"fg-muted",type:"prose",testId:`${c}-empty`,children:i}):_jsxruntime.jsx.call(void 0, "section",{className:"cui-table-frame",tabIndex:0,"aria-labelledby":l,"data-testid":`${c}-frame`,children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":d,style:{"--cui-table-min":_chunkA4D4K2WFcjs.p.call(void 0, y)},children:[_jsxruntime.jsx.call(void 0, "caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:l,children:e}),_jsxruntime.jsx.call(void 0, "colgroup",{children:o.map(m=>_jsxruntime.jsx.call(void 0, "col",{style:m.width.fixedPx===void 0?void 0:{width:_chunkA4D4K2WFcjs.p.call(void 0, m.width.fixedPx)}},m.key))}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsx.call(void 0, "tr",{children:o.map(m=>_jsxruntime.jsx.call(void 0, "th",{scope:"col","data-cui-align":m.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:m.header},m.key))})}),_jsxruntime.jsx.call(void 0, "tbody",{children:r.map(m=>_jsxruntime.jsx.call(void 0, "tr",{tabIndex:-1,"data-cui-row-focus":"","data-testid":a,...N(_optionalChain([s, 'optionalCall', _5 => _5(m)])),children:o.map(f=>_jsxruntime.jsx.call(void 0, "td",{"data-cui-align":f.align,children:f.cell(m)},f.key))},n(m)))})]})})})};var Wt=({items:e,testId:t})=>{if(u(),new Set(e.map(o=>o.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(o=>o.key).join(", ")}`);return _jsxruntime.jsx.call(void 0, "dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(o=>_jsxruntime.jsxs.call(void 0, "div",{className:"cui-description-row","data-testid":`${t}-${o.key}`,children:[_jsxruntime.jsx.call(void 0, "dt",{"data-cui-fg":"fg-secondary",children:o.term}),_jsxruntime.jsx.call(void 0, "dd",{"data-cui-fg":"fg",children:o.description})]},o.key))})};var Yt=229,Xt=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),fe=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&Xt.has(e.type)&&(e.value!==""||e.validity.badInput),Qt= exports.useEscapeToClose =e=>_react.useCallback.call(void 0, t=>{t.key!=="Escape"||t.nativeEvent.isComposing||t.keyCode===Yt||fe(t.target)||(t.stopPropagation(),e())},[e]);var Ye=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},eo= exports.Dialog =({title:e,open:t,onClose:o,testId:r,children:n})=>{let{labels:a}=E(),s=_react.useId.call(void 0, ),d=_react.useRef.call(void 0, null),i=_react.useRef.call(void 0, null);return _react.useLayoutEffect.call(void 0, ()=>{let l=d.current;t&&!l.open?(i.current=l.ownerDocument.activeElement,l.showModal()):!t&&l.open&&l.close()},[t]),_react.useLayoutEffect.call(void 0, ()=>{let l=d.current;return()=>{l.open&&(l.close(),Ye(i.current),i.current=null)}},[]),_jsxruntime.jsxs.call(void 0, "dialog",{className:"cui-dialog","aria-labelledby":s,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":r,ref:d,onClose:()=>{Ye(i.current),i.current=null,t&&o()},onCancel:l=>{fe(l.currentTarget.ownerDocument.activeElement)&&l.preventDefault()},children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-dialog-header",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"cui-dialog-title",id:s,"data-cui-type":"title",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-dialog-actions",children:_jsxruntime.jsx.call(void 0, L,{variant:"secondary",testId:`${r}-close`,onClick:()=>_optionalChain([d, 'access', _6 => _6.current, 'optionalAccess', _7 => _7.close, 'call', _8 => _8()]),children:a.close})})]}),n,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[pe]:"","data-testid":`${r}-announcer`})]})};var oo=({summary:e,open:t,onOpenChange:o,testId:r,children:n})=>{u();let a=_react.useId.call(void 0, );return _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":a,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${r}-button`,onClick:()=>o(!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",{children:e})]}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-disclosure-panel",id:a,hidden:!t,"data-testid":`${r}-panel`,children:n})]})};var q=({description:e,error:t})=>{u();let o=_react.useId.call(void 0, ),r=_react.useId.call(void 0, ),n=_react.useId.call(void 0, ),a=[e===void 0?null:r,t===void 0?null:n].filter(d=>d!==null).join(" ");return{control:{id:o,"aria-describedby":a===""?void 0:a,"aria-invalid":t===void 0?void 0:!0},descriptionId:r,errorId:n}},_=({description:e,error:t,descriptionId:o,errorId:r,testId:n})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[e===void 0?null:_jsxruntime.jsx.call(void 0, x,{as:"p",fg:"fg-muted",type:"body",id:o,testId:`${n}-description`,children:e}),t===void 0?null:_jsxruntime.jsx.call(void 0, x,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${n}-error`,children:t})]}),ro= exports.Field =({label:e,description:t,error:o,testId:r,children:n})=>{let{control:a,descriptionId:s,errorId:d}=q({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":r,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:a.id,"data-cui-type":"body",children:e}),n(a),_jsxruntime.jsx.call(void 0, _,{description:t,error:o,descriptionId:s,errorId:d,testId:r})]})},je=({label:e,description:t,error:o,value:r,onValueChange:n,type:a,list:s,autoComplete:d,required:i,testId:c,ref:p})=>{let{control:l,descriptionId:y,errorId:m}=q({label:e,description:t,error:o}),f=a==="password";return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${c}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:l.id,"data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "input",{className:"cui-input",type:a,value:r,list:s,autoComplete:d,spellCheck:f?!1:void 0,autoCapitalize:f?"none":void 0,required:i,onChange:C=>n(C.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":c,ref:p,...l}),_jsxruntime.jsx.call(void 0, _,{description:t,error:o,descriptionId:y,errorId:m,testId:c})]})},ao= exports.TextInput =e=>_jsxruntime.jsx.call(void 0, je,{...e}),no= exports.PasswordInput =e=>_jsxruntime.jsx.call(void 0, je,{...e,type:"password"}),so= exports.TextArea =({label:e,description:t,error:o,value:r,onValueChange:n,required:a,testId:s,ref:d})=>{let{control:i,descriptionId:c,errorId:p}=q({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:i.id,"data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "textarea",{className:"cui-input cui-textarea",value:r,required:a,onChange:l=>n(l.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":s,ref:d,...i}),_jsxruntime.jsx.call(void 0, _,{description:t,error:o,descriptionId:c,errorId:p,testId:s})]})},io= exports.Select =({label:e,description:t,error:o,value:r,options:n,onValueChange:a,testId:s,ref:d})=>{let{control:i,descriptionId:c,errorId:p}=q({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:i.id,"data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "select",{className:"cui-input",value:r,onChange:l=>a(l.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":s,ref:d,...i,children:n.map(l=>_jsxruntime.jsx.call(void 0, "option",{value:l.value,children:l.label},l.value))}),_jsxruntime.jsx.call(void 0, _,{description:t,error:o,descriptionId:c,errorId:p,testId:s})]})},lo= exports.RadioGroup =({legend:e,description:t,error:o,value:r,options:n,onValueChange:a,testId:s,ref:d})=>{let i=_react.useId.call(void 0, ),{control:c,descriptionId:p,errorId:l}=q({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-radio-group","aria-describedby":c["aria-describedby"],"data-invalid":o!==void 0,"data-testid":s,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),n.map((y,m)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-radio","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"radio",name:i,value:y.value,checked:y.value===r,onChange:()=>a(y.value),"aria-invalid":c["aria-invalid"],"data-testid":`${s}-option-${y.value}`,ref:m===0?d:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:y.label})]},y.value)),_jsxruntime.jsx.call(void 0, _,{description:t,error:o,descriptionId:p,errorId:l,testId:s})]})};var uo={1:"h1",2:"h2",3:"h3"},po= exports.Heading =({level:e,type:t,testId:o,headingRef:r,children:n})=>{u();let a=uo[e];return _jsxruntime.jsx.call(void 0, a,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":o,ref:r,tabIndex:r===void 0?void 0:-1,children:n})};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"}},fo={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},be= exports.Pill =({tone:e,variant:t,testId:o,dataAttributes:r,children:n})=>{u();let a=t==="tint"?mo[e]:{fg:"on-solid",surface:fo[e]};return _jsxruntime.jsx.call(void 0, "span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":a.fg,"data-cui-surface":a.surface,"data-cui-type":"caption","data-testid":o,...N(r),children:n})};var Re=({label:e,valueText:t,value:o,max:r,testId:n})=>{u();let a=_react.useId.call(void 0, );if(r!==null){if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Progress maximum must be positive: ${r}`);if(o===null||!(Number.isFinite(o)&&o>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${o}`)}let s=r===null?null:{max:r,now:Math.min(o,r)};return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-progress","data-testid":n,children:[_jsxruntime.jsx.call(void 0, x,{as:"p",fg:"fg",type:"body",id:a,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":a,"aria-valuetext":t,"aria-valuemin":s===null?void 0:0,"aria-valuemax":_optionalChain([s, 'optionalAccess', _9 => _9.max]),"aria-valuenow":_optionalChain([s, 'optionalAccess', _10 => _10.now]),"data-cui-surface":"sunken","data-cui-indeterminate":s===null,"data-testid":`${n}-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":`${n}-fill`})}),_jsxruntime.jsx.call(void 0, "div",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, x,{as:"p",fg:"fg-secondary",type:"body",testId:`${n}-value`,children:t})})]})};var To=({title:e,status:t,progress:o,cancel:r,testId:n,children:a})=>_jsxruntime.jsxs.call(void 0, ye,{title:e,actions:r===void 0?void 0:_jsxruntime.jsx.call(void 0, L,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${n}-cancel`,children:r.label}),testId:n,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${n}-status`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:`${e} `}),_jsxruntime.jsx.call(void 0, be,{tone:t.tone,variant:"tint",testId:`${n}-status-pill`,children:t.label})]}),o===void 0?null:_jsxruntime.jsx.call(void 0, Re,{...o,testId:`${n}-progress`}),a]});var ho=({tone:e,testId:t,children:o})=>(u(),_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-testid":t,children:o})),V= exports.AlertMessage =({occurrence:e,testId:t,children:o})=>(u(),_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-occurrence":e,"data-testid":t,children:o},e));var xo=e=>e+1,Te= exports.useFocusRescue =e=>{let t=_react.useRef.call(void 0, e),o=_react.useRef.call(void 0, null),[,r]=_react.useReducer.call(void 0, xo,0),n=_react.useCallback.call(void 0, (a=>()=>{a.contains(document.activeElement)&&(o.current=a,r())}),[]);return _react.useLayoutEffect.call(void 0, ()=>{t.current=e}),_react.useLayoutEffect.call(void 0, ()=>{let a=o.current;if(a===null)return;o.current=null;let s=[null,document.body].includes(document.activeElement);a.isConnected||!s||_optionalChain([t, 'access', _11 => _11.current, 'call', _12 => _12(), 'optionalAccess', _13 => _13.focus, 'call', _14 => _14()])}),n};var he="[data-cui-row-focus]",Eo=e=>{let t=e.ref.current;if(t===null)throw new Error("LoadMore: rows.ref is not attached to the element holding the rows");let o=[...t.querySelectorAll(he)];if(o.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${o.length} ${he} elements for ${e.count} rows`);return o},No=(e,t)=>{let o=-1;return e.forEach((r,n)=>{t.has(r)&&(o=n)}),e[o+1]},wo= exports.LoadMore =({onLoad:e,busy:t,done:o,failure:r,limit:n,rows:a,testId:s})=>{let{formatLocale:d,labels:i}=E(),c=_react.useRef.call(void 0, null),p=_react.useRef.call(void 0, null),l=_react.useRef.call(void 0, null),y=_react.useRef.call(void 0, !1),m=()=>{let b=a.ref.current;c.current={shown:new Set(b===null?[]:b.querySelectorAll(he)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};_react.useLayoutEffect.call(void 0, ()=>{let b=y.current;y.current=!1;let R=c.current;if(R===null)return;let g=Eo(a);if(t){R.busySeen=!0,R.shown=new Set(g);return}let h=No(g,R.shown),T=r!==null&&r.occurrence!==R.failureOccurrence;if(!(R.busySeen||h!==void 0||T||o)||(c.current=null,T||h===void 0))return;let S=[null,document.body].includes(document.activeElement);(l.current!==null&&document.activeElement===l.current||b&&S)&&h.focus()});let f=Te(()=>o?p.current:l.current),C=_react.useCallback.call(void 0, (b=>{l.current=b;let R=f(b);return()=>{l.current=null,y.current=b===document.activeElement,R()}}),[f]),w=_react.useCallback.call(void 0, (b=>{p.current=b;let R=f(b);return()=>{p.current=null,R()}}),[f]);return o?_jsxruntime.jsx.call(void 0, "div",{className:"cui-load-more","data-testid":s,children:_jsxruntime.jsx.call(void 0, x,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:w,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, L,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:m,ref:C,testId:`${s}-button`,children:i.loadMore(_chunkA4D4K2WFcjs.a.call(void 0, n,d))}),r===null?null:_jsxruntime.jsx.call(void 0, V,{occurrence:r.occurrence,testId:`${s}-failure`,children:i.loadFailed(r.reason)})]})};var Lo=({master:e,detail:t,masterMinPx:o,detailMinPx:r,testId:n})=>{u();let a=_chunkA4D4K2WFcjs.r.call(void 0, {masterMinPx:o,detailMinPx:r,gapPx:_chunkA4D4K2WFcjs.G.space["space-6"]});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":n,children:[_jsxruntime.jsx.call(void 0, H,{ruleKey:a.key,css:a.css}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-master-detail","data-cui-master-detail":a.key,children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${n}-master`,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${n}-detail`,children:t})]})]})};var Ce=({value:e,unit:t,testId:o})=>{let{formatLocale:r,labels:n}=E();if(e===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-testid":o,children:n.unmeasured});let a=_chunkA4D4K2WFcjs.a.call(void 0, e,r);return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-testid":o,children:t===void 0?a:`${a} ${t}`})};var So=({label:e,value:t,min:o,max:r,valueText:n,testId:a})=>{if(u(),!(Number.isFinite(o)&&Number.isFinite(r)&&o<r))throw new RangeError(`Meter needs a finite range with min below max: min ${o}, max ${r}`);if(!(Number.isFinite(t)&&t>=o&&t<=r))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${o}, max ${r}`);return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-meter","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":t,"aria-valuetext":n,"data-cui-surface":"sunken","data-testid":`${a}-bar`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-o)/(r-o)*100}%`},"data-testid":`${a}-fill`})}),_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, x,{fg:"fg",type:"body",testId:`${a}-value`,children:n})})]})};var Io=({failure:e,onReload:t,forbiddenMessage:o,failureMessage:r,rescueRef:n,testId:a})=>{let{labels:s}=E();return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-resource-failed","data-testid":a,children:[_jsxruntime.jsx.call(void 0, V,{occurrence:e.occurrence,testId:`${a}-alert`,children:s.failureSentence(e,o,r===void 0?s.loadFailed:r)}),e.status===403?null:_jsxruntime.jsx.call(void 0, L,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:n,testId:`${a}-reload`,children:s.reload})]})};var Do=({label:e,options:t,value:o,onValueChange:r,testId:n})=>{u();let a=new Set(t.map(s=>s.value));if(t.length<2||a.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(s=>s.value).join(", ")}`);if(!a.has(o))throw new RangeError(`The pressed value "${o}" is not one of the options: ${[...a].join(", ")}`);return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-segmented-group","data-testid":n,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(s=>{let d=s.value===o;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":`${n}-${s.value}`,onClick:()=>{d||r(s.value)},children:s.label},s.value)})})]})};var lt=({selected:e,controls:t,onSelect:o,testId:r,dataAttributes:n,ref:a,children:s})=>(u(),_jsxruntime.jsx.call(void 0, "button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:o,ref:a,...N(n),children:s})),Ho= exports.SelectableList =({label:e,items:t,itemKey:o,selectedKey:r,onSelect:n,detailId:a,renderRow:s,rowTestId:d,rowData:i,empty:c,testId:p,ref:l})=>(u(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-selectable","data-testid":p,ref:l,children:t.length===0?_jsxruntime.jsx.call(void 0, x,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:c}):_jsxruntime.jsx.call(void 0, "ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(y=>{let m=o(y);return _jsxruntime.jsx.call(void 0, "li",{children:_jsxruntime.jsx.call(void 0, lt,{selected:m===r,controls:a,onSelect:()=>n(y),testId:d,dataAttributes:_optionalChain([i, 'optionalCall', _15 => _15(y)]),children:s(y)})},m)})})}));var Uo=({label:e,value:t,min:o,max:r,step:n,valueText:a,onValueChange:s,testId:d})=>{u();let i=_react.useId.call(void 0, );if(!([t,o,r,n].every(Number.isFinite)&&o<r&&n>0&&o<=t&&t<=r))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${o}, max ${r}, step ${n}`);let c=a(t);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-testid":`${d}-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:o,max:r,step:n,value:t,"aria-valuetext":c,"data-testid":d,onChange:p=>s(p.currentTarget.valueAsNumber)}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-slider-value","aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, x,{fg:"fg",type:"body",testId:`${d}-value`,children:c})})]})]})};var Oo=({gap:e,testId:t,children:o})=>(u(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:o})),Bo= exports.Cluster =({gap:e,testId:t,children:o})=>(u(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-cluster","data-cui-gap":e,"data-testid":t,children:o}));var ut={done:0,current:1,pending:2},Ko={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},qo= exports.Stepper =({label:e,steps:t,testId:o})=>{let{labels:r}=E();if(t.length===0||new Set(t.map(a=>a.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(a=>a.id).join(", ")}`);if(t.filter(a=>a.state==="current").length>1||t.some((a,s)=>s>0&&ut[a.state]<ut[t[s-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(a=>a.state).join(", ")}`);let n={done:r.stepDone,current:null,pending:r.stepPending};return _jsxruntime.jsx.call(void 0, "ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":o,children:t.map((a,s)=>{let d=Ko[a.state],i=n[a.state];return _jsxruntime.jsxs.call(void 0, "li",{className:"cui-step","aria-current":a.state==="current"?"step":void 0,"data-cui-step":a.state,"data-testid":`${o}-${a.id}`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":d.fg,"data-cui-surface":d.surface,"data-cui-type":"caption",children:a.state==="done"?"\u2713":s+1}),_jsxruntime.jsxs.call(void 0, "span",{className:"cui-step-label","data-cui-fg":"fg",children:[a.label,i===null?null:_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:` (${i})`})]})]},a.id)})})};var _o=({label:e,checked:t,onCheckedChange:o,testId:r})=>(u(),_jsxruntime.jsxs.call(void 0, "button",{className:"cui-switch",type:"button",role:"switch","aria-checked":t,"data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:()=>o(!t),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":t?"info-solid":"sunken","data-testid":`${r}-track`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-thumb","data-cui-surface":t?"surface":"neutral-solid","data-testid":`${r}-thumb`})}),_jsxruntime.jsx.call(void 0, "span",{children:e})]}));var Vo=({label:e,items:t,currentId:o,onNavigate:r,testId:n})=>{if(u(),t.length===0)throw new RangeError("Tabs needs at least one tab");let a=new Set(t.map(s=>s.id));if(a.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(s=>s.id).join(", ")}`);if(!a.has(o))throw new RangeError(`The current tab "${o}" is not one of the tabs: ${[...a].join(", ")}`);return _jsxruntime.jsx.call(void 0, "nav",{className:"cui-tabs","aria-label":e,"data-testid":n,children:_jsxruntime.jsx.call(void 0, "ul",{className:"cui-tabs-list",role:"list",children:t.map(s=>{let d=s.id===o;return _jsxruntime.jsx.call(void 0, "li",{className:"cui-tabs-item",children:_jsxruntime.jsx.call(void 0, "a",{className:"cui-tab",href:s.href,"aria-current":d?"page":void 0,"data-cui-fg":d?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${n}-${s.id}`,onClick:i=>J(i,s.href,r),children:s.label})},s.id)})})})};var Zo={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},Yo= exports.MetricTile =({label:e,sublabel:t,value:o,tone:r,testId:n,dataAttributes:a})=>{if(u(),o===null&&r!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${r}`);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":n,...N(a),children:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-label","data-cui-type":"caption",children:e}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption",children:t}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-value","data-cui-fg":Zo[r],"data-cui-type":"heading",children:_jsxruntime.jsx.call(void 0, Ce,{value:o,testId:`${n}-value`})})]})},yt=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?yt(t.props.children):[t]}),Xo= exports.TileGrid =({count:e,minInlinePx:t,testId:o,children:r})=>{u();let n=_chunkA4D4K2WFcjs.w.call(void 0, e,t,_chunkA4D4K2WFcjs.G.space["space-2"]),a=yt(r).length;if(a!==e)throw new RangeError(`TileGrid has ${a} tiles but count is ${e}`);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":o,children:[_jsxruntime.jsx.call(void 0, H,{ruleKey:n.key,css:n.css}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-tile-grid","data-cui-tile-grid":n.key,"data-cui-gap":"space-2",children:r})]})};var re=e=>[...e.querySelectorAll("button")],jo= exports.Toolbar =({label:e,testId:t,children:o})=>{u();let r=_react.useRef.call(void 0, null),n=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{let i=re(r.current),c=n.current!==null&&i.includes(n.current)?n.current:_nullishCoalesce(i[0], () => (null));n.current=c;for(let p of i)p.tabIndex=p===c?0:-1});let a=i=>{for(let c of re(r.current))c.tabIndex=c===i?0:-1;n.current=i};return _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 c=re(i.currentTarget).find(p=>p.contains(i.target));c!==void 0&&a(c)},onKeyDown:i=>{let c=re(i.currentTarget),p=c.indexOf(i.target);if(p===-1)return;let l=getComputedStyle(i.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",y=l==="ArrowRight"?"ArrowLeft":"ArrowRight",f={[l]:(p+1)%c.length,[y]:(p-1+c.length)%c.length,Home:0,End:c.length-1}[i.key];if(f===void 0)return;i.preventDefault();let C=c[f];a(C),C.focus()},children:o})};var gt=e=>e===null?_chunkA4D4K2WFcjs.i:_chunkA4D4K2WFcjs.j,ne=(e,t,o,r,n)=>{let[a,s]=_react.useState.call(void 0, ()=>({key:e,state:gt(e)})),[d,i]=_react.useState.call(void 0, 0),[c,p]=_react.useState.call(void 0, 0),l=_react.useRef.call(void 0, t),y=_react.useRef.call(void 0, null),m=_react.useRef.call(void 0, d);_react.useLayoutEffect.call(void 0, ()=>{l.current=t}),_react.useEffect.call(void 0, ()=>{if(e===null){s({key:null,state:_chunkA4D4K2WFcjs.i});return}let g=new AbortController;y.current=e;let h=d===m.current?"revision":"reload";return m.current=d,s(T=>Object.is(T.key,e)?{key:e,state:r(T.state,h)}:{key:e,state:_chunkA4D4K2WFcjs.j}),l.current(g.signal).then(T=>{g.signal.aborted||(y.current=null,s(S=>({key:e,state:n(S.state,T)})))},T=>{g.signal.aborted||s(()=>{throw T})}),()=>{g.abort(),y.current=null}},[e,o,d,c]);let f=_react.useCallback.call(void 0, ()=>i(g=>g+1),[]),C=_react.useCallback.call(void 0, ()=>p(g=>g+1),[]),w=_react.useCallback.call(void 0, (g,h)=>{s(T=>Object.is(T.key,g)?{key:g,state:h(T.state)}:T)},[]),b=_react.useCallback.call(void 0, (g,h)=>{w(g,h),Object.is(y.current,g)&&C()},[w,C]);return{state:Object.is(a.key,e)?a.state:gt(e),reload:f,refresh:C,update:w,write:b}};var ar=(e,t,o)=>{let r=_react.useRef.call(void 0, t);_react.useLayoutEffect.call(void 0, ()=>{r.current=t});let n=_react.useCallback.call(void 0, b=>r.current.first(b),[]),{state:a,reload:s,refresh:d,update:i,write:c}=ne(e,n,o,_chunkA4D4K2WFcjs.x,_chunkA4D4K2WFcjs.y),p=_react.useRef.call(void 0, {key:e,state:a});_react.useLayoutEffect.call(void 0, ()=>{p.current={key:e,state:a}});let l=_react.useRef.call(void 0, null),y=_react.useCallback.call(void 0, ()=>{_optionalChain([l, 'access', _16 => _16.current, 'optionalAccess', _17 => _17.controller, 'access', _18 => _18.abort, 'call', _19 => _19()]),l.current=null},[]);_react.useEffect.call(void 0, ()=>y,[e,o,y]);let m=_react.useCallback.call(void 0, ()=>{y(),s()},[y,s]),f=_react.useCallback.call(void 0, ()=>{y(),d()},[y,d]),C=_react.useCallback.call(void 0, ()=>{let{key:b,state:R}=p.current;if(b===null||R.kind!=="ready"||R.refreshing||R.value.next===null||R.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let g=R.value.next,h={key:b,controller:new AbortController,maps:[]};l.current=h,i(b,_chunkA4D4K2WFcjs.z),r.current.next(g,h.controller.signal).then(T=>{l.current===h&&(l.current=null,i(b,S=>h.maps.reduce((Rt,Tt)=>_chunkA4D4K2WFcjs.B.call(void 0, Rt,Tt),_chunkA4D4K2WFcjs.A.call(void 0, S,g,T))))},T=>{l.current===h&&i(b,()=>{throw T})})},[i]),w=_react.useCallback.call(void 0, (b,R)=>{let g=l.current;g!==null&&Object.is(g.key,b)&&g.maps.push(R),c(b,h=>_chunkA4D4K2WFcjs.B.call(void 0, h,R))},[c]);return{state:a,reload:m,refresh:f,loadMore:C,updateList:w}};var sr=(e,t,o)=>{let{state:r,reload:n,refresh:a,write:s}=ne(e,t,o,_chunkA4D4K2WFcjs.k,_chunkA4D4K2WFcjs.l),d=_react.useCallback.call(void 0, (i,c)=>s(i,p=>_chunkA4D4K2WFcjs.l.call(void 0, p,{ok:!0,value:c})),[s]);return{state:r,reload:n,refresh:a,put:d}};var ir=({testId:e,children:t})=>(u(),_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden","data-testid":e,children:t}));exports.ANNOUNCE_SETTLE_MS = ue; exports.AlertMessage = V; exports.Breadcrumb = It; exports.Button = L; exports.CONSOLE_UI_LABEL_CATALOGS = _chunkA4D4K2WFcjs.n; exports.CONTRAST_MINIMUM = _chunkIR2WTSOWcjs.c; exports.CONTRAST_PAIRS = _chunkIR2WTSOWcjs.d; exports.Card = ye; exports.CardSection = Ut; exports.Cluster = Bo; exports.CodeBlock = Bt; exports.ComparisonGrid = _t; exports.ConsoleUiRoot = Lt; exports.DataTable = Vt; exports.DescriptionList = Wt; exports.Dialog = eo; exports.Disclosure = oo; exports.Field = ro; exports.HTTP_FORBIDDEN = _chunkA4D4K2WFcjs.f; exports.Heading = po; exports.JobCard = To; exports.LATTICE_PX = _chunkA4D4K2WFcjs.C; exports.Link = Ht; exports.LoadMore = wo; exports.MasterDetail = Lo; exports.Measured = Ce; exports.Meter = So; exports.MetricTile = Yo; exports.Notice = ho; exports.PasswordInput = no; exports.Pill = be; exports.ProgressBar = Re; exports.ROW_WITH_CONTROL_PX = _chunkA4D4K2WFcjs.F; exports.RadioGroup = lo; exports.ResourceFailed = Io; exports.RowButton = lt; exports.SegmentedControl = Do; exports.Select = io; exports.SelectableList = Ho; exports.Slider = Uo; exports.Stack = Oo; exports.Stepper = qo; exports.Switch = _o; exports.TARGET_PX = _chunkA4D4K2WFcjs.E; exports.TOKENS = _chunkA4D4K2WFcjs.G; exports.Tabs = Vo; exports.Text = x; exports.TextArea = so; exports.TextInput = ao; exports.TileGrid = Xo; exports.Toolbar = jo; exports.VisuallyHidden = ir; exports.ZonedTimeError = _chunkA4D4K2WFcjs.b; exports.beginPage = _chunkA4D4K2WFcjs.z; exports.beginPagedReload = _chunkA4D4K2WFcjs.x; exports.beginReload = _chunkA4D4K2WFcjs.k; exports.ceil8 = _chunkA4D4K2WFcjs.v; exports.ceilToLattice = _chunkA4D4K2WFcjs.D; exports.contrastRatio = _chunkIR2WTSOWcjs.b; exports.cssVar = _chunkA4D4K2WFcjs.H; exports.flatMapOutcome = _chunkA4D4K2WFcjs.h; exports.formatCount = _chunkA4D4K2WFcjs.a; exports.formatInstant = _chunkA4D4K2WFcjs.e; exports.hexToSrgb = _chunkIR2WTSOWcjs.a; exports.keepLastGood = _chunkA4D4K2WFcjs.l; exports.mapOutcome = _chunkA4D4K2WFcjs.g; exports.mapPagedList = _chunkA4D4K2WFcjs.B; exports.masterDetailPlan = _chunkA4D4K2WFcjs.q; exports.monoTextWidthEm = _chunkA4D4K2WFcjs.u; exports.reasonAside = _chunkA4D4K2WFcjs.m; exports.resolveConsoleUiLabels = _chunkA4D4K2WFcjs.o; exports.settleFirstPage = _chunkA4D4K2WFcjs.y; exports.settlePage = _chunkA4D4K2WFcjs.A; exports.tableMinInlinePx = _chunkA4D4K2WFcjs.s; exports.textWidthEm = _chunkA4D4K2WFcjs.t; exports.tileGridPlan = _chunkA4D4K2WFcjs.w; exports.toOffsetIso = _chunkA4D4K2WFcjs.c; exports.toWallTime = _chunkA4D4K2WFcjs.d; exports.useAnnounce = St; exports.useConsoleUi = E; exports.useEscapeToClose = Qt; exports.useFocusRescue = Te; exports.usePagedResource = ar; exports.useResource = sr;
package/dist/index.d.cts CHANGED
@@ -182,7 +182,16 @@ type TextInputProps = FieldTexts & {
182
182
  readonly testId: string;
183
183
  readonly ref?: Ref<HTMLInputElement>;
184
184
  };
185
- declare const TextInput: ({ label, description, error, value, onValueChange, type, list, required, testId, ref }: TextInputProps) => react.JSX.Element;
185
+ type PasswordInputProps = FieldTexts & {
186
+ readonly value: string;
187
+ readonly onValueChange: (value: string) => void;
188
+ readonly autoComplete: "new-password" | "current-password";
189
+ readonly required?: boolean;
190
+ readonly testId: string;
191
+ readonly ref?: Ref<HTMLInputElement>;
192
+ };
193
+ declare const TextInput: (props: TextInputProps) => react.JSX.Element;
194
+ declare const PasswordInput: (props: PasswordInputProps) => react.JSX.Element;
186
195
  type TextAreaProps = FieldTexts & {
187
196
  readonly value: string;
188
197
  readonly onValueChange: (value: string) => void;
@@ -467,4 +476,4 @@ type VisuallyHiddenProps = {
467
476
  readonly children: ReactNode;
468
477
  };
469
478
  declare const VisuallyHidden: ({ testId, children }: VisuallyHiddenProps) => react.JSX.Element;
470
- export { ANNOUNCE_SETTLE_MS, AlertMessage, type AlertMessageProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, Cluster, CodeBlock, type CodeBlockProps, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, type DataAttributes, DataTable, type DataTableProps, type DescriptionItem, DescriptionList, type DescriptionListProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, Heading, type HeadingProps, type HeadingType, type JobCancel, JobCard, type JobCardProps, KeysetPage, Link, type LinkProps, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredProps, Meter, type MeterProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, SelectableList, type SelectableListProps, Slider, type SliderProps, SpaceToken, Stack, type StackProps, type StepState, Stepper, type StepperItem, type StepperProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, type TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, Toolbar, type ToolbarProps, TypeToken, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAnnounce, useConsoleUi, useEscapeToClose, useFocusRescue, usePagedResource, useResource };
479
+ export { ANNOUNCE_SETTLE_MS, AlertMessage, type AlertMessageProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, Cluster, CodeBlock, type CodeBlockProps, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, type DataAttributes, DataTable, type DataTableProps, type DescriptionItem, DescriptionList, type DescriptionListProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, Heading, type HeadingProps, type HeadingType, type JobCancel, JobCard, type JobCardProps, KeysetPage, Link, type LinkProps, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredProps, Meter, type MeterProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, PasswordInput, type PasswordInputProps, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, SelectableList, type SelectableListProps, Slider, type SliderProps, SpaceToken, Stack, type StackProps, type StepState, Stepper, type StepperItem, type StepperProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, type TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, Toolbar, type ToolbarProps, TypeToken, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAnnounce, useConsoleUi, useEscapeToClose, useFocusRescue, usePagedResource, useResource };
package/dist/index.d.ts CHANGED
@@ -182,7 +182,16 @@ type TextInputProps = FieldTexts & {
182
182
  readonly testId: string;
183
183
  readonly ref?: Ref<HTMLInputElement>;
184
184
  };
185
- declare const TextInput: ({ label, description, error, value, onValueChange, type, list, required, testId, ref }: TextInputProps) => react.JSX.Element;
185
+ type PasswordInputProps = FieldTexts & {
186
+ readonly value: string;
187
+ readonly onValueChange: (value: string) => void;
188
+ readonly autoComplete: "new-password" | "current-password";
189
+ readonly required?: boolean;
190
+ readonly testId: string;
191
+ readonly ref?: Ref<HTMLInputElement>;
192
+ };
193
+ declare const TextInput: (props: TextInputProps) => react.JSX.Element;
194
+ declare const PasswordInput: (props: PasswordInputProps) => react.JSX.Element;
186
195
  type TextAreaProps = FieldTexts & {
187
196
  readonly value: string;
188
197
  readonly onValueChange: (value: string) => void;
@@ -467,4 +476,4 @@ type VisuallyHiddenProps = {
467
476
  readonly children: ReactNode;
468
477
  };
469
478
  declare const VisuallyHidden: ({ testId, children }: VisuallyHiddenProps) => react.JSX.Element;
470
- export { ANNOUNCE_SETTLE_MS, AlertMessage, type AlertMessageProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, Cluster, CodeBlock, type CodeBlockProps, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, type DataAttributes, DataTable, type DataTableProps, type DescriptionItem, DescriptionList, type DescriptionListProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, Heading, type HeadingProps, type HeadingType, type JobCancel, JobCard, type JobCardProps, KeysetPage, Link, type LinkProps, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredProps, Meter, type MeterProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, SelectableList, type SelectableListProps, Slider, type SliderProps, SpaceToken, Stack, type StackProps, type StepState, Stepper, type StepperItem, type StepperProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, type TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, Toolbar, type ToolbarProps, TypeToken, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAnnounce, useConsoleUi, useEscapeToClose, useFocusRescue, usePagedResource, useResource };
479
+ export { ANNOUNCE_SETTLE_MS, AlertMessage, type AlertMessageProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, Cluster, CodeBlock, type CodeBlockProps, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, type DataAttributes, DataTable, type DataTableProps, type DescriptionItem, DescriptionList, type DescriptionListProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, Heading, type HeadingProps, type HeadingType, type JobCancel, JobCard, type JobCardProps, KeysetPage, Link, type LinkProps, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredProps, Meter, type MeterProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, PasswordInput, type PasswordInputProps, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, SelectableList, type SelectableListProps, Slider, type SliderProps, SpaceToken, Stack, type StackProps, type StepState, Stepper, type StepperItem, type StepperProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, type TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, Toolbar, type ToolbarProps, TypeToken, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAnnounce, useConsoleUi, useEscapeToClose, useFocusRescue, usePagedResource, useResource };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{A as Fe,B as de,C as xr,D as Er,E as Nr,F as Pr,G as W,H as wr,a as z,b as ir,c as lr,d as dr,e as cr,f as Tt,g as ur,h as pr,i as se,j as ie,k as Se,l as le,m as yr,n as mr,o as Le,p as D,q as fr,r as ke,s as Ie,t as gr,u as br,v as Rr,w as Ae,x as De,y as $e,z as He}from"./chunk-BUX2DNVR.js";import{a as Tr,b as hr,c as vr,d as Cr}from"./chunk-BMGBEN26.js";import{createContext as ht,useCallback as vt,useContext as qe,useLayoutEffect as Ct,useMemo as Ue,useRef as Oe}from"react";import{jsx as Ke,jsxs as Lt}from"react/jsx-runtime";var ce=ht(null),xt=" ",Be='[inert], [aria-hidden="true" i]',_e="dialog:modal",pe="data-cui-dialog-announcer",Et=`:scope > [${pe}]`,Nt=e=>{if(e.closest(Be)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=e.ownerDocument,o=[...t.querySelectorAll(_e)],r=t.activeElement,n=o.filter(c=>c.contains(r)),a=n.length>0?n:o,s=a.filter(c=>c.contains(e)).length;if(s===a.length)return{region:e};let d=a.find(c=>a.every(p=>p.contains(c))),i=d?.querySelector(Et)??null;return d!==void 0&&i!==null&&e.parentElement.contains(d)&&i.closest(Be)===null?{region:i}:s===0?{hidden:"the topmost open modal dialog does not contain the console"}:{hidden:"open modal dialogs both contain and do not contain the console, and focus does not tell which one is topmost"}},Pt=e=>{try{e.querySelectorAll(_e)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},ue=150,wt=1e3,Mt=({locale:e,formatLocale:t,timeZone:o,testId:r,children:n})=>{if(qe(ce)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");let s=Le(e),[d]=Intl.getCanonicalLocales(t),i=Ue(()=>new Intl.DateTimeFormat(d,{timeZone:o}).resolvedOptions().timeZone,[d,o]),c=Oe(null),p=Oe(null);Ct(()=>{Pt(c.current.ownerDocument)},[]);let l=vt(m=>{if(m.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let g=()=>{let{texts:w,settle:b,deadline:R}=p.current;p.current=null,clearTimeout(b),clearTimeout(R);let f=c.current;if(f===null)return;let h=w.join(xt),T=Nt(f);if("hidden"in T)throw new Error(`announce: the live region is hidden from assistive technology (${T.hidden}), so this announcement would be lost: ${h}`);let L=f.ownerDocument.createElement("span");L.textContent=h,T.region.replaceChildren(L)},x=p.current;if(x===null){p.current={texts:[m],settle:setTimeout(g,ue),deadline:setTimeout(g,wt)};return}x.texts.push(m),clearTimeout(x.settle),x.settle=setTimeout(g,ue)},[]),y=Ue(()=>({locale:e,formatLocale:d,timeZone:i,labels:s,announce:l}),[e,d,i,s,l]);return Ke(ce.Provider,{value:y,children:Lt("div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":r,children:[n,Ke("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${r}-announcer`,ref:c})]})})},N=()=>{let e=qe(ce);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},u=()=>{N()},St=()=>N().announce;var J=(e,t,o)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),o(t))};import{jsx as B,jsxs as Ge}from"react/jsx-runtime";var kt=({items:e,current:t,onNavigate:o,testId:r})=>{let{labels:n}=N();if(new Set(e.map(a=>a.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(a=>a.id).join(", ")}`);return B("nav",{className:"cui-breadcrumb","aria-label":n.breadcrumb,"data-testid":r,children:Ge("ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(a=>Ge("li",{className:"cui-breadcrumb-item",children:[B("a",{className:"cui-link",href:a.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${r}-${a.id}`,onClick:s=>J(s,a.href,o),children:a.label}),B("span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},a.id)),B("li",{className:"cui-breadcrumb-item",children:B("span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${r}-current`,children:t})})]})})};import{useId as At}from"react";var P=e=>{if(e===void 0)return{};for(let t of Object.keys(e))if(!t.startsWith("data-")||t.startsWith("data-cui-")||t==="data-testid")throw new RangeError(`Caller attributes must be data-* and must not override data-cui-* or data-testid: ${t}`);return e};import{jsx as It}from"react/jsx-runtime";var v=({fg:e,type:t,face:o,as:r="span",testId:n,id:a,tabIndex:s,ref:d,children:i})=>(u(),It(r,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":o,"data-testid":n,id:a,tabIndex:s,ref:d,children:i}));import{jsx as $,jsxs as Ht}from"react/jsx-runtime";var Dt={primary:{fg:"on-solid",surface:"info-solid",type:"body"},secondary:{fg:"fg",surface:void 0,type:"body"},danger:{fg:"on-solid",surface:"danger-solid",type:"body"},link:{fg:"info-fg",surface:void 0,type:"body"}},Ve=({children:e})=>$("span",{children:e}),S=({variant:e,children:t,testId:o,type:r="button",onClick:n,unavailable:a,expanded:s,controls:d,ref:i,dataAttributes:c,busy:p,busyLabel:l})=>{u();let y=At(),m=p===!0||a!==void 0,g=Dt[e],x=w=>{if(m){w.preventDefault();return}n?.(w)};return Ht("span",{className:"cui-button-group",children:[$("button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":g.fg,"data-cui-surface":g.surface,"data-cui-type":g.type,"data-testid":o,"aria-disabled":m?!0:void 0,"aria-busy":p===!0?!0:void 0,"aria-describedby":a===void 0?void 0:y,"aria-expanded":s,"aria-controls":d,onClick:x,ref:i,...P(c),children:$(Ve,{children:p===!0?l:t})}),a===void 0?null:$(v,{fg:"fg-muted",type:"body",id:y,testId:`${o}-reason`,children:a.reason})]})},$t=({onNavigate:e,children:t,testId:o,ref:r})=>(u(),$("button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":o,onClick:e,ref:r,children:$(Ve,{children:t})}));import{useId as ze}from"react";import{Fragment as Ut,jsx as k,jsxs as K}from"react/jsx-runtime";var ye=({id:e,title:t,description:o,actions:r,testId:n,headingRef:a,ref:s,dataAttributes:d,children:i})=>{u();let c=ze();return K("section",{className:"cui-card",id:e,"aria-labelledby":c,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":n,ref:s,...P(d),children:[K("div",{className:"cui-card-header",children:[K("div",{className:"cui-card-heading",children:[k("h2",{className:"cui-card-title",id:c,"data-cui-type":"title",ref:a,tabIndex:a===void 0?void 0:-1,children:t}),o===void 0?null:k("div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),r===void 0?null:k("div",{className:"cui-card-actions",children:r})]}),i]})},Ft=({id:e,title:t,subtitle:o,region:r=!1,testId:n,headingRef:a,ref:s,dataAttributes:d,children:i})=>{u();let c=ze(),p=K(Ut,{children:[K("div",{className:"cui-card-section-heading",children:[k("h3",{className:"cui-card-section-title",id:c,"data-cui-type":"body",ref:a,tabIndex:a===void 0?void 0:-1,children:t}),o===void 0?null:k("div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),i]});return r?k("section",{className:"cui-card-section",id:e,"aria-labelledby":c,"data-testid":n,ref:s,...P(d),children:p}):k("div",{className:"cui-card-section",id:e,"data-testid":n,ref:s,...P(d),children:p})};import{jsx as We}from"react/jsx-runtime";var Ot=({label:e,code:t,testId:o})=>(u(),We("section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":o,children:We("pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${o}-code`,children:t})}));import{useId as Kt}from"react";import{jsx as Bt}from"react/jsx-runtime";var H=({ruleKey:e,css:t})=>Bt("style",{href:e,precedence:"cui",children:t});import{jsx as E,jsxs as I}from"react/jsx-runtime";var qt=({caption:e,attributes:t,columns:o,attributePx:r,columnMinPx:n,testId:a})=>{u();let s=Kt();for(let l of[r,n])if(!(Number.isFinite(l)&&l>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${l}`);if(o.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let l of o)for(let y of t)if(!Object.hasOwn(l.cells,y.key))throw new RangeError(`Column "${l.key}" has no value for attribute "${y.key}"`);let d=r+o.length*n,i=`cui-comparison-a${r}-c${n}-n${o.length}`,c=l=>`[data-cui-comparison="${i}"][data-cui-comparison-layout="${l}"]`,p=`${c("table")}{display:none}@container (min-width:${D(d)}){${c("table")}{display:block}${c("stack")}{display:none}}`;return I("div",{className:"cui-container","data-cui-stack-below-px":d,"data-testid":a,children:[E(H,{ruleKey:i,css:p}),E("div",{className:"cui-comparison-frame","data-cui-comparison":i,"data-cui-comparison-layout":"table",children:I("table",{className:"cui-comparison-table","data-cui-type":"body",children:[E("caption",{className:"cui-visually-hidden",children:e}),I("colgroup",{children:[E("col",{style:{width:D(r)}}),o.map(l=>E("col",{},l.key))]}),E("thead",{children:I("tr",{children:[E("td",{}),o.map(l=>E("th",{scope:"col",children:l.heading},l.key))]})}),E("tbody",{children:t.map(l=>I("tr",{children:[E("th",{scope:"row",children:l.label}),o.map(y=>E("td",{children:y.cells[l.key]("table")},y.key))]},l.key))})]})}),E("div",{className:"cui-comparison-stack","data-cui-comparison":i,"data-cui-comparison-layout":"stack",children:o.map((l,y)=>{let m=`${s}-column-${y}`;return I("div",{className:"cui-comparison-column",role:"group","aria-labelledby":m,"data-cui-type":"body",children:[E("p",{className:"cui-comparison-heading",id:m,children:l.heading}),E("dl",{className:"cui-comparison-list",children:t.map(g=>I("div",{children:[E("dt",{children:g.label}),E("dd",{children:l.cells[g.key]("stack")})]},g.key))})]},l.key)})})]})};import{useId as _t}from"react";import{jsx as M,jsxs as Vt}from"react/jsx-runtime";var Gt=({caption:e,captionHidden:t,columns:o,rows:r,rowKey:n,rowTestId:a,rowData:s,rowSize:d,empty:i,testId:c,ref:p})=>{u();let l=_t(),y=Ie(o);return M("div",{className:"cui-container","data-testid":c,ref:p,children:r.length===0?M(v,{as:"p",fg:"fg-muted",type:"prose",testId:`${c}-empty`,children:i}):M("section",{className:"cui-table-frame",tabIndex:0,"aria-labelledby":l,"data-testid":`${c}-frame`,children:Vt("table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":d,style:{"--cui-table-min":D(y)},children:[M("caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:l,children:e}),M("colgroup",{children:o.map(m=>M("col",{style:m.width.fixedPx===void 0?void 0:{width:D(m.width.fixedPx)}},m.key))}),M("thead",{children:M("tr",{children:o.map(m=>M("th",{scope:"col","data-cui-align":m.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:m.header},m.key))})}),M("tbody",{children:r.map(m=>M("tr",{tabIndex:-1,"data-cui-row-focus":"","data-testid":a,...P(s?.(m)),children:o.map(g=>M("td",{"data-cui-align":g.align,children:g.cell(m)},g.key))},n(m)))})]})})})};import{jsx as me,jsxs as Wt}from"react/jsx-runtime";var zt=({items:e,testId:t})=>{if(u(),new Set(e.map(o=>o.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(o=>o.key).join(", ")}`);return me("dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(o=>Wt("div",{className:"cui-description-row","data-testid":`${t}-${o.key}`,children:[me("dt",{"data-cui-fg":"fg-secondary",children:o.term}),me("dd",{"data-cui-fg":"fg",children:o.description})]},o.key))})};import{useId as Qt,useLayoutEffect as Je,useRef as Ze}from"react";import{useCallback as Jt}from"react";var Zt=229,Yt=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),fe=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&Yt.has(e.type)&&(e.value!==""||e.validity.badInput),Xt=e=>Jt(t=>{t.key!=="Escape"||t.nativeEvent.isComposing||t.keyCode===Zt||fe(t.target)||(t.stopPropagation(),e())},[e]);import{jsx as Z,jsxs as Xe}from"react/jsx-runtime";var Ye=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},jt=({title:e,open:t,onClose:o,testId:r,children:n})=>{let{labels:a}=N(),s=Qt(),d=Ze(null),i=Ze(null);return Je(()=>{let l=d.current;t&&!l.open?(i.current=l.ownerDocument.activeElement,l.showModal()):!t&&l.open&&l.close()},[t]),Je(()=>{let l=d.current;return()=>{l.open&&(l.close(),Ye(i.current),i.current=null)}},[]),Xe("dialog",{className:"cui-dialog","aria-labelledby":s,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":r,ref:d,onClose:()=>{Ye(i.current),i.current=null,t&&o()},onCancel:l=>{fe(l.currentTarget.ownerDocument.activeElement)&&l.preventDefault()},children:[Xe("div",{className:"cui-dialog-header",children:[Z("h2",{className:"cui-dialog-title",id:s,"data-cui-type":"title",children:e}),Z("div",{className:"cui-dialog-actions",children:Z(S,{variant:"secondary",testId:`${r}-close`,onClick:()=>d.current?.close(),children:a.close})})]}),n,Z("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[pe]:"","data-testid":`${r}-announcer`})]})};import{useId as eo}from"react";import{jsx as ge,jsxs as Qe}from"react/jsx-runtime";var to=({summary:e,open:t,onOpenChange:o,testId:r,children:n})=>{u();let a=eo();return Qe("div",{className:"cui-disclosure","data-testid":r,children:[Qe("button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":a,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${r}-button`,onClick:()=>o(!t),children:[ge("span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),ge("span",{children:e})]}),ge("div",{className:"cui-disclosure-panel",id:a,hidden:!t,"data-testid":`${r}-panel`,children:n})]})};import{useId as Y}from"react";import{Fragment as io,jsx as C,jsxs as A}from"react/jsx-runtime";var q=({description:e,error:t})=>{u();let o=Y(),r=Y(),n=Y(),a=[e===void 0?null:r,t===void 0?null:n].filter(d=>d!==null).join(" ");return{control:{id:o,"aria-describedby":a===""?void 0:a,"aria-invalid":t===void 0?void 0:!0},descriptionId:r,errorId:n}},_=({description:e,error:t,descriptionId:o,errorId:r,testId:n})=>A(io,{children:[e===void 0?null:C(v,{as:"p",fg:"fg-muted",type:"body",id:o,testId:`${n}-description`,children:e}),t===void 0?null:C(v,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${n}-error`,children:t})]}),oo=({label:e,description:t,error:o,testId:r,children:n})=>{let{control:a,descriptionId:s,errorId:d}=q({label:e,description:t,error:o});return A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":r,children:[C("label",{className:"cui-field-label",htmlFor:a.id,"data-cui-type":"body",children:e}),n(a),C(_,{description:t,error:o,descriptionId:s,errorId:d,testId:r})]})},ro=({label:e,description:t,error:o,value:r,onValueChange:n,type:a,list:s,required:d,testId:i,ref:c})=>{let{control:p,descriptionId:l,errorId:y}=q({label:e,description:t,error:o});return A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${i}-field`,children:[C("label",{className:"cui-field-label",htmlFor:p.id,"data-cui-type":"body",children:e}),C("input",{className:"cui-input",type:a,value:r,list:s,required:d,onChange:m=>n(m.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":i,ref:c,...p}),C(_,{description:t,error:o,descriptionId:l,errorId:y,testId:i})]})},ao=({label:e,description:t,error:o,value:r,onValueChange:n,required:a,testId:s,ref:d})=>{let{control:i,descriptionId:c,errorId:p}=q({label:e,description:t,error:o});return A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[C("label",{className:"cui-field-label",htmlFor:i.id,"data-cui-type":"body",children:e}),C("textarea",{className:"cui-input cui-textarea",value:r,required:a,onChange:l=>n(l.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":s,ref:d,...i}),C(_,{description:t,error:o,descriptionId:c,errorId:p,testId:s})]})},no=({label:e,description:t,error:o,value:r,options:n,onValueChange:a,testId:s,ref:d})=>{let{control:i,descriptionId:c,errorId:p}=q({label:e,description:t,error:o});return A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[C("label",{className:"cui-field-label",htmlFor:i.id,"data-cui-type":"body",children:e}),C("select",{className:"cui-input",value:r,onChange:l=>a(l.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":s,ref:d,...i,children:n.map(l=>C("option",{value:l.value,children:l.label},l.value))}),C(_,{description:t,error:o,descriptionId:c,errorId:p,testId:s})]})},so=({legend:e,description:t,error:o,value:r,options:n,onValueChange:a,testId:s,ref:d})=>{let i=Y(),{control:c,descriptionId:p,errorId:l}=q({label:e,description:t,error:o});return A("fieldset",{className:"cui-radio-group","aria-describedby":c["aria-describedby"],"data-invalid":o!==void 0,"data-testid":s,children:[C("legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),n.map((y,m)=>A("label",{className:"cui-radio","data-cui-type":"body",children:[C("input",{type:"radio",name:i,value:y.value,checked:y.value===r,onChange:()=>a(y.value),"aria-invalid":c["aria-invalid"],"data-testid":`${s}-option-${y.value}`,ref:m===0?d:void 0}),C("span",{children:y.label})]},y.value)),C(_,{description:t,error:o,descriptionId:p,errorId:l,testId:s})]})};import{jsx as uo}from"react/jsx-runtime";var lo={1:"h1",2:"h2",3:"h3"},co=({level:e,type:t,testId:o,headingRef:r,children:n})=>{u();let a=lo[e];return uo(a,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":o,ref:r,tabIndex:r===void 0?void 0:-1,children:n})};import{jsx as mo}from"react/jsx-runtime";var po={neutral:{fg:"fg-secondary",surface:"sunken"},info:{fg:"info-fg",surface:"info-tint"},success:{fg:"success-fg",surface:"success-tint"},warning:{fg:"warning-fg",surface:"warning-tint"},danger:{fg:"danger-fg",surface:"danger-tint"}},yo={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},be=({tone:e,variant:t,testId:o,dataAttributes:r,children:n})=>{u();let a=t==="tint"?po[e]:{fg:"on-solid",surface:yo[e]};return mo("span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":a.fg,"data-cui-surface":a.surface,"data-cui-type":"caption","data-testid":o,...P(r),children:n})};import{useId as fo}from"react";import{jsx as G,jsxs as go}from"react/jsx-runtime";var Re=({label:e,valueText:t,value:o,max:r,testId:n})=>{u();let a=fo();if(r!==null){if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Progress maximum must be positive: ${r}`);if(o===null||!(Number.isFinite(o)&&o>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${o}`)}let s=r===null?null:{max:r,now:Math.min(o,r)};return go("div",{className:"cui-progress","data-testid":n,children:[G(v,{as:"p",fg:"fg",type:"body",id:a,children:e}),G("div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":a,"aria-valuetext":t,"aria-valuemin":s===null?void 0:0,"aria-valuemax":s?.max,"aria-valuenow":s?.now,"data-cui-surface":"sunken","data-cui-indeterminate":s===null,"data-testid":`${n}-bar`,children:G("div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:s===null?void 0:{inlineSize:`${s.now/s.max*100}%`},"data-testid":`${n}-fill`})}),G("div",{"aria-hidden":"true",children:G(v,{as:"p",fg:"fg-secondary",type:"body",testId:`${n}-value`,children:t})})]})};import{jsx as X,jsxs as je}from"react/jsx-runtime";var bo=({title:e,status:t,progress:o,cancel:r,testId:n,children:a})=>je(ye,{title:e,actions:r===void 0?void 0:X(S,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${n}-cancel`,children:r.label}),testId:n,children:[je("div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${n}-status`,children:[X("span",{className:"cui-visually-hidden",children:`${e} `}),X(be,{tone:t.tone,variant:"tint",testId:`${n}-status-pill`,children:t.label})]}),o===void 0?null:X(Re,{...o,testId:`${n}-progress`}),a]});import{useCallback as rt,useLayoutEffect as Co,useRef as Q}from"react";import{jsx as et}from"react/jsx-runtime";var Ro=({tone:e,testId:t,children:o})=>(u(),et("div",{className:"cui-notice","data-cui-tone":e,"data-cui-surface":e==="info"?"info-tint":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-testid":t,children:o})),V=({occurrence:e,testId:t,children:o})=>(u(),et("div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-occurrence":e,"data-testid":t,children:o},e));import{useCallback as To,useLayoutEffect as tt,useReducer as ho,useRef as ot}from"react";var vo=e=>e+1,Te=e=>{let t=ot(e),o=ot(null),[,r]=ho(vo,0),n=To((a=>()=>{a.contains(document.activeElement)&&(o.current=a,r())}),[]);return tt(()=>{t.current=e}),tt(()=>{let a=o.current;if(a===null)return;o.current=null;let s=[null,document.body].includes(document.activeElement);a.isConnected||!s||t.current()?.focus()}),n};import{jsx as j,jsxs as Po}from"react/jsx-runtime";var he="[data-cui-row-focus]",xo=e=>{let t=e.ref.current;if(t===null)throw new Error("LoadMore: rows.ref is not attached to the element holding the rows");let o=[...t.querySelectorAll(he)];if(o.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${o.length} ${he} elements for ${e.count} rows`);return o},Eo=(e,t)=>{let o=-1;return e.forEach((r,n)=>{t.has(r)&&(o=n)}),e[o+1]},No=({onLoad:e,busy:t,done:o,failure:r,limit:n,rows:a,testId:s})=>{let{formatLocale:d,labels:i}=N(),c=Q(null),p=Q(null),l=Q(null),y=Q(!1),m=()=>{let b=a.ref.current;c.current={shown:new Set(b===null?[]:b.querySelectorAll(he)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};Co(()=>{let b=y.current;y.current=!1;let R=c.current;if(R===null)return;let f=xo(a);if(t){R.busySeen=!0,R.shown=new Set(f);return}let h=Eo(f,R.shown),T=r!==null&&r.occurrence!==R.failureOccurrence;if(!(R.busySeen||h!==void 0||T||o)||(c.current=null,T||h===void 0))return;let L=[null,document.body].includes(document.activeElement);(l.current!==null&&document.activeElement===l.current||b&&L)&&h.focus()});let g=Te(()=>o?p.current:l.current),x=rt((b=>{l.current=b;let R=g(b);return()=>{l.current=null,y.current=b===document.activeElement,R()}}),[g]),w=rt((b=>{p.current=b;let R=g(b);return()=>{p.current=null,R()}}),[g]);return o?j("div",{className:"cui-load-more","data-testid":s,children:j(v,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:w,testId:`${s}-end`,children:i.endOfRecords})}):Po("div",{className:"cui-load-more","data-testid":s,children:[j(S,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:m,ref:x,testId:`${s}-button`,children:i.loadMore(z(n,d))}),r===null?null:j(V,{occurrence:r.occurrence,testId:`${s}-failure`,children:i.loadFailed(r.reason)})]})};import{jsx as ve,jsxs as at}from"react/jsx-runtime";var wo=({master:e,detail:t,masterMinPx:o,detailMinPx:r,testId:n})=>{u();let a=ke({masterMinPx:o,detailMinPx:r,gapPx:W.space["space-6"]});return at("div",{className:"cui-container","data-testid":n,children:[ve(H,{ruleKey:a.key,css:a.css}),at("div",{className:"cui-master-detail","data-cui-master-detail":a.key,children:[ve("div",{className:"cui-master-detail-pane","data-testid":`${n}-master`,children:e}),ve("div",{className:"cui-master-detail-pane","data-testid":`${n}-detail`,children:t})]})]})};import{jsx as nt}from"react/jsx-runtime";var Ce=({value:e,unit:t,testId:o})=>{let{formatLocale:r,labels:n}=N();if(e===null)return nt("span",{className:"cui-measured","data-measured":"false","data-testid":o,children:n.unmeasured});let a=z(e,r);return nt("span",{className:"cui-measured","data-measured":"true","data-testid":o,children:t===void 0?a:`${a} ${t}`})};import{jsx as ee,jsxs as So}from"react/jsx-runtime";var Mo=({label:e,value:t,min:o,max:r,valueText:n,testId:a})=>{if(u(),!(Number.isFinite(o)&&Number.isFinite(r)&&o<r))throw new RangeError(`Meter needs a finite range with min below max: min ${o}, max ${r}`);if(!(Number.isFinite(t)&&t>=o&&t<=r))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${o}, max ${r}`);return So("span",{className:"cui-meter","data-testid":a,children:[ee("span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":t,"aria-valuetext":n,"data-cui-surface":"sunken","data-testid":`${a}-bar`,children:ee("span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-o)/(r-o)*100}%`},"data-testid":`${a}-fill`})}),ee("span",{"aria-hidden":"true",children:ee(v,{fg:"fg",type:"body",testId:`${a}-value`,children:n})})]})};import{jsx as st,jsxs as ko}from"react/jsx-runtime";var Lo=({failure:e,onReload:t,forbiddenMessage:o,failureMessage:r,rescueRef:n,testId:a})=>{let{labels:s}=N();return ko("div",{className:"cui-resource-failed","data-testid":a,children:[st(V,{occurrence:e.occurrence,testId:`${a}-alert`,children:s.failureSentence(e,o,r===void 0?s.loadFailed:r)}),e.status===403?null:st(S,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:n,testId:`${a}-reload`,children:s.reload})]})};import{jsx as xe,jsxs as Ao}from"react/jsx-runtime";var Io=({label:e,options:t,value:o,onValueChange:r,testId:n})=>{u();let a=new Set(t.map(s=>s.value));if(t.length<2||a.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(s=>s.value).join(", ")}`);if(!a.has(o))throw new RangeError(`The pressed value "${o}" is not one of the options: ${[...a].join(", ")}`);return Ao("fieldset",{className:"cui-segmented-group","data-testid":n,children:[xe("legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),xe("div",{className:"cui-segmented",children:t.map(s=>{let d=s.value===o;return xe("button",{className:"cui-segment",type:"button","aria-pressed":d,"data-cui-fg":d?"on-solid":"fg","data-cui-surface":d?"info-solid":void 0,"data-cui-type":"body","data-testid":`${n}-${s.value}`,onClick:()=>{d||r(s.value)},children:s.label},s.value)})})]})};import{jsx as F}from"react/jsx-runtime";var it=({selected:e,controls:t,onSelect:o,testId:r,dataAttributes:n,ref:a,children:s})=>(u(),F("button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:o,ref:a,...P(n),children:s})),Do=({label:e,items:t,itemKey:o,selectedKey:r,onSelect:n,detailId:a,renderRow:s,rowTestId:d,rowData:i,empty:c,testId:p,ref:l})=>(u(),F("div",{className:"cui-selectable","data-testid":p,ref:l,children:t.length===0?F(v,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:c}):F("ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(y=>{let m=o(y);return F("li",{children:F(it,{selected:m===r,controls:a,onSelect:()=>n(y),testId:d,dataAttributes:i?.(y),children:s(y)})},m)})})}));import{useId as $o}from"react";import{jsx as te,jsxs as lt}from"react/jsx-runtime";var Ho=({label:e,value:t,min:o,max:r,step:n,valueText:a,onValueChange:s,testId:d})=>{u();let i=$o();if(!([t,o,r,n].every(Number.isFinite)&&o<r&&n>0&&o<=t&&t<=r))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${o}, max ${r}, step ${n}`);let c=a(t);return lt("div",{className:"cui-field","data-testid":`${d}-field`,children:[te("label",{className:"cui-field-label",htmlFor:i,"data-cui-type":"body",children:e}),lt("div",{className:"cui-slider",children:[te("input",{className:"cui-slider-input",id:i,type:"range",min:o,max:r,step:n,value:t,"aria-valuetext":c,"data-testid":d,onChange:p=>s(p.currentTarget.valueAsNumber)}),te("span",{className:"cui-slider-value","aria-hidden":"true",children:te(v,{fg:"fg",type:"body",testId:`${d}-value`,children:c})})]})]})};import{jsx as dt}from"react/jsx-runtime";var Fo=({gap:e,testId:t,children:o})=>(u(),dt("div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:o})),Uo=({gap:e,testId:t,children:o})=>(u(),dt("div",{className:"cui-cluster","data-cui-gap":e,"data-testid":t,children:o}));import{jsx as Ee,jsxs as ut}from"react/jsx-runtime";var ct={done:0,current:1,pending:2},Oo={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Bo=({label:e,steps:t,testId:o})=>{let{labels:r}=N();if(t.length===0||new Set(t.map(a=>a.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(a=>a.id).join(", ")}`);if(t.filter(a=>a.state==="current").length>1||t.some((a,s)=>s>0&&ct[a.state]<ct[t[s-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(a=>a.state).join(", ")}`);let n={done:r.stepDone,current:null,pending:r.stepPending};return Ee("ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":o,children:t.map((a,s)=>{let d=Oo[a.state],i=n[a.state];return ut("li",{className:"cui-step","aria-current":a.state==="current"?"step":void 0,"data-cui-step":a.state,"data-testid":`${o}-${a.id}`,children:[Ee("span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":d.fg,"data-cui-surface":d.surface,"data-cui-type":"caption",children:a.state==="done"?"\u2713":s+1}),ut("span",{className:"cui-step-label","data-cui-fg":"fg",children:[a.label,i===null?null:Ee("span",{className:"cui-visually-hidden",children:` (${i})`})]})]},a.id)})})};import{jsx as Ne,jsxs as qo}from"react/jsx-runtime";var Ko=({label:e,checked:t,onCheckedChange:o,testId:r})=>(u(),qo("button",{className:"cui-switch",type:"button",role:"switch","aria-checked":t,"data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:()=>o(!t),children:[Ne("span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":t?"info-solid":"sunken","data-testid":`${r}-track`,children:Ne("span",{className:"cui-switch-thumb","data-cui-surface":t?"surface":"neutral-solid","data-testid":`${r}-thumb`})}),Ne("span",{children:e})]}));import{jsx as oe}from"react/jsx-runtime";var _o=({label:e,items:t,currentId:o,onNavigate:r,testId:n})=>{if(u(),t.length===0)throw new RangeError("Tabs needs at least one tab");let a=new Set(t.map(s=>s.id));if(a.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(s=>s.id).join(", ")}`);if(!a.has(o))throw new RangeError(`The current tab "${o}" is not one of the tabs: ${[...a].join(", ")}`);return oe("nav",{className:"cui-tabs","aria-label":e,"data-testid":n,children:oe("ul",{className:"cui-tabs-list",role:"list",children:t.map(s=>{let d=s.id===o;return oe("li",{className:"cui-tabs-item",children:oe("a",{className:"cui-tab",href:s.href,"aria-current":d?"page":void 0,"data-cui-fg":d?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${n}-${s.id}`,onClick:i=>J(i,s.href,r),children:s.label})},s.id)})})})};import{Children as Go,Fragment as Vo,isValidElement as zo}from"react";import{jsx as U,jsxs as yt}from"react/jsx-runtime";var Wo={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},Jo=({label:e,sublabel:t,value:o,tone:r,testId:n,dataAttributes:a})=>{if(u(),o===null&&r!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${r}`);return yt("div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":n,...P(a),children:[U("p",{className:"cui-tile-label","data-cui-type":"caption",children:e}),U("p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption",children:t}),U("p",{className:"cui-tile-value","data-cui-fg":Wo[r],"data-cui-type":"heading",children:U(Ce,{value:o,testId:`${n}-value`})})]})},pt=e=>Go.toArray(e).flatMap(t=>{if(!zo(t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===Vo?pt(t.props.children):[t]}),Zo=({count:e,minInlinePx:t,testId:o,children:r})=>{u();let n=Ae(e,t,W.space["space-2"]),a=pt(r).length;if(a!==e)throw new RangeError(`TileGrid has ${a} tiles but count is ${e}`);return yt("div",{className:"cui-container","data-testid":o,children:[U(H,{ruleKey:n.key,css:n.css}),U("div",{className:"cui-tile-grid","data-cui-tile-grid":n.key,"data-cui-gap":"space-2",children:r})]})};import{useLayoutEffect as Yo,useRef as mt}from"react";import{jsx as Qo}from"react/jsx-runtime";var re=e=>[...e.querySelectorAll("button")],Xo=({label:e,testId:t,children:o})=>{u();let r=mt(null),n=mt(null);Yo(()=>{let i=re(r.current),c=n.current!==null&&i.includes(n.current)?n.current:i[0]??null;n.current=c;for(let p of i)p.tabIndex=p===c?0:-1});let a=i=>{for(let c of re(r.current))c.tabIndex=c===i?0:-1;n.current=i};return Qo("div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:r,onFocus:i=>{let c=re(i.currentTarget).find(p=>p.contains(i.target));c!==void 0&&a(c)},onKeyDown:i=>{let c=re(i.currentTarget),p=c.indexOf(i.target);if(p===-1)return;let l=getComputedStyle(i.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",y=l==="ArrowRight"?"ArrowLeft":"ArrowRight",g={[l]:(p+1)%c.length,[y]:(p-1+c.length)%c.length,Home:0,End:c.length-1}[i.key];if(g===void 0)return;i.preventDefault();let x=c[g];a(x),x.focus()},children:o})};import{useCallback as O,useEffect as tr,useLayoutEffect as gt,useRef as Me}from"react";import{useCallback as ae,useEffect as jo,useLayoutEffect as er,useRef as Pe,useState as we}from"react";var ft=e=>e===null?se:ie,ne=(e,t,o,r,n)=>{let[a,s]=we(()=>({key:e,state:ft(e)})),[d,i]=we(0),[c,p]=we(0),l=Pe(t),y=Pe(null),m=Pe(d);er(()=>{l.current=t}),jo(()=>{if(e===null){s({key:null,state:se});return}let f=new AbortController;y.current=e;let h=d===m.current?"revision":"reload";return m.current=d,s(T=>Object.is(T.key,e)?{key:e,state:r(T.state,h)}:{key:e,state:ie}),l.current(f.signal).then(T=>{f.signal.aborted||(y.current=null,s(L=>({key:e,state:n(L.state,T)})))},T=>{f.signal.aborted||s(()=>{throw T})}),()=>{f.abort(),y.current=null}},[e,o,d,c]);let g=ae(()=>i(f=>f+1),[]),x=ae(()=>p(f=>f+1),[]),w=ae((f,h)=>{s(T=>Object.is(T.key,f)?{key:f,state:h(T.state)}:T)},[]),b=ae((f,h)=>{w(f,h),Object.is(y.current,f)&&x()},[w,x]);return{state:Object.is(a.key,e)?a.state:ft(e),reload:g,refresh:x,update:w,write:b}};var or=(e,t,o)=>{let r=Me(t);gt(()=>{r.current=t});let n=O(b=>r.current.first(b),[]),{state:a,reload:s,refresh:d,update:i,write:c}=ne(e,n,o,De,$e),p=Me({key:e,state:a});gt(()=>{p.current={key:e,state:a}});let l=Me(null),y=O(()=>{l.current?.controller.abort(),l.current=null},[]);tr(()=>y,[e,o,y]);let m=O(()=>{y(),s()},[y,s]),g=O(()=>{y(),d()},[y,d]),x=O(()=>{let{key:b,state:R}=p.current;if(b===null||R.kind!=="ready"||R.refreshing||R.value.next===null||R.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let f=R.value.next,h={key:b,controller:new AbortController,maps:[]};l.current=h,i(b,He),r.current.next(f,h.controller.signal).then(T=>{l.current===h&&(l.current=null,i(b,L=>h.maps.reduce((bt,Rt)=>de(bt,Rt),Fe(L,f,T))))},T=>{l.current===h&&i(b,()=>{throw T})})},[i]),w=O((b,R)=>{let f=l.current;f!==null&&Object.is(f.key,b)&&f.maps.push(R),c(b,h=>de(h,R))},[c]);return{state:a,reload:m,refresh:g,loadMore:x,updateList:w}};import{useCallback as rr}from"react";var ar=(e,t,o)=>{let{state:r,reload:n,refresh:a,write:s}=ne(e,t,o,Se,le),d=rr((i,c)=>s(i,p=>le(p,{ok:!0,value:c})),[s]);return{state:r,reload:n,refresh:a,put:d}};import{jsx as sr}from"react/jsx-runtime";var nr=({testId:e,children:t})=>(u(),sr("span",{className:"cui-visually-hidden","data-testid":e,children:t}));export{ue as ANNOUNCE_SETTLE_MS,V as AlertMessage,kt as Breadcrumb,S as Button,mr as CONSOLE_UI_LABEL_CATALOGS,vr as CONTRAST_MINIMUM,Cr as CONTRAST_PAIRS,ye as Card,Ft as CardSection,Uo as Cluster,Ot as CodeBlock,qt as ComparisonGrid,Mt as ConsoleUiRoot,Gt as DataTable,zt as DescriptionList,jt as Dialog,to as Disclosure,oo as Field,Tt as HTTP_FORBIDDEN,co as Heading,bo as JobCard,xr as LATTICE_PX,$t as Link,No as LoadMore,wo as MasterDetail,Ce as Measured,Mo as Meter,Jo as MetricTile,Ro as Notice,be as Pill,Re as ProgressBar,Pr as ROW_WITH_CONTROL_PX,so as RadioGroup,Lo as ResourceFailed,it as RowButton,Io as SegmentedControl,no as Select,Do as SelectableList,Ho as Slider,Fo as Stack,Bo as Stepper,Ko as Switch,Nr as TARGET_PX,W as TOKENS,_o as Tabs,v as Text,ao as TextArea,ro as TextInput,Zo as TileGrid,Xo as Toolbar,nr as VisuallyHidden,ir as ZonedTimeError,He as beginPage,De as beginPagedReload,Se as beginReload,Rr as ceil8,Er as ceilToLattice,hr as contrastRatio,wr as cssVar,pr as flatMapOutcome,z as formatCount,cr as formatInstant,Tr as hexToSrgb,le as keepLastGood,ur as mapOutcome,de as mapPagedList,fr as masterDetailPlan,br as monoTextWidthEm,yr as reasonAside,Le as resolveConsoleUiLabels,$e as settleFirstPage,Fe as settlePage,Ie as tableMinInlinePx,gr as textWidthEm,Ae as tileGridPlan,lr as toOffsetIso,dr as toWallTime,St as useAnnounce,N as useConsoleUi,Xt as useEscapeToClose,Te as useFocusRescue,or as usePagedResource,ar as useResource};
1
+ import{A as Fe,B as de,C as Er,D as Nr,E as wr,F as Mr,G as W,H as Lr,a as z,b as dr,c as cr,d as ur,e as pr,f as ht,g as yr,h as mr,i as se,j as ie,k as Le,l as le,m as fr,n as gr,o as Se,p as D,q as br,r as ke,s as Ie,t as Rr,u as Tr,v as hr,w as Ae,x as De,y as $e,z as He}from"./chunk-BUX2DNVR.js";import{a as vr,b as Cr,c as xr,d as Pr}from"./chunk-BMGBEN26.js";import{createContext as vt,useCallback as Ct,useContext as qe,useLayoutEffect as xt,useMemo as Ue,useRef as Oe}from"react";import{jsx as Ke,jsxs as kt}from"react/jsx-runtime";var ce=vt(null),Pt=" ",Be='[inert], [aria-hidden="true" i]',_e="dialog:modal",pe="data-cui-dialog-announcer",Et=`:scope > [${pe}]`,Nt=e=>{if(e.closest(Be)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=e.ownerDocument,o=[...t.querySelectorAll(_e)],r=t.activeElement,n=o.filter(c=>c.contains(r)),a=n.length>0?n:o,s=a.filter(c=>c.contains(e)).length;if(s===a.length)return{region:e};let d=a.find(c=>a.every(p=>p.contains(c))),i=d?.querySelector(Et)??null;return d!==void 0&&i!==null&&e.parentElement.contains(d)&&i.closest(Be)===null?{region:i}:s===0?{hidden:"the topmost open modal dialog does not contain the console"}:{hidden:"open modal dialogs both contain and do not contain the console, and focus does not tell which one is topmost"}},wt=e=>{try{e.querySelectorAll(_e)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},ue=150,Mt=1e3,Lt=({locale:e,formatLocale:t,timeZone:o,testId:r,children:n})=>{if(qe(ce)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");let s=Se(e),[d]=Intl.getCanonicalLocales(t),i=Ue(()=>new Intl.DateTimeFormat(d,{timeZone:o}).resolvedOptions().timeZone,[d,o]),c=Oe(null),p=Oe(null);xt(()=>{wt(c.current.ownerDocument)},[]);let l=Ct(m=>{if(m.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let f=()=>{let{texts:w,settle:b,deadline:R}=p.current;p.current=null,clearTimeout(b),clearTimeout(R);let g=c.current;if(g===null)return;let h=w.join(Pt),T=Nt(g);if("hidden"in T)throw new Error(`announce: the live region is hidden from assistive technology (${T.hidden}), so this announcement would be lost: ${h}`);let S=g.ownerDocument.createElement("span");S.textContent=h,T.region.replaceChildren(S)},C=p.current;if(C===null){p.current={texts:[m],settle:setTimeout(f,ue),deadline:setTimeout(f,Mt)};return}C.texts.push(m),clearTimeout(C.settle),C.settle=setTimeout(f,ue)},[]),y=Ue(()=>({locale:e,formatLocale:d,timeZone:i,labels:s,announce:l}),[e,d,i,s,l]);return Ke(ce.Provider,{value:y,children:kt("div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":r,children:[n,Ke("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${r}-announcer`,ref:c})]})})},E=()=>{let e=qe(ce);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},u=()=>{E()},St=()=>E().announce;var J=(e,t,o)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),o(t))};import{jsx as B,jsxs as Ge}from"react/jsx-runtime";var It=({items:e,current:t,onNavigate:o,testId:r})=>{let{labels:n}=E();if(new Set(e.map(a=>a.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(a=>a.id).join(", ")}`);return B("nav",{className:"cui-breadcrumb","aria-label":n.breadcrumb,"data-testid":r,children:Ge("ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(a=>Ge("li",{className:"cui-breadcrumb-item",children:[B("a",{className:"cui-link",href:a.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${r}-${a.id}`,onClick:s=>J(s,a.href,o),children:a.label}),B("span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},a.id)),B("li",{className:"cui-breadcrumb-item",children:B("span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${r}-current`,children:t})})]})})};import{useId as Dt}from"react";var N=e=>{if(e===void 0)return{};for(let t of Object.keys(e))if(!t.startsWith("data-")||t.startsWith("data-cui-")||t==="data-testid")throw new RangeError(`Caller attributes must be data-* and must not override data-cui-* or data-testid: ${t}`);return e};import{jsx as At}from"react/jsx-runtime";var x=({fg:e,type:t,face:o,as:r="span",testId:n,id:a,tabIndex:s,ref:d,children:i})=>(u(),At(r,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":o,"data-testid":n,id:a,tabIndex:s,ref:d,children:i}));import{jsx as $,jsxs as Ft}from"react/jsx-runtime";var $t={primary:{fg:"on-solid",surface:"info-solid",type:"body"},secondary:{fg:"fg",surface:void 0,type:"body"},danger:{fg:"on-solid",surface:"danger-solid",type:"body"},link:{fg:"info-fg",surface:void 0,type:"body"}},Ve=({children:e})=>$("span",{children:e}),L=({variant:e,children:t,testId:o,type:r="button",onClick:n,unavailable:a,expanded:s,controls:d,ref:i,dataAttributes:c,busy:p,busyLabel:l})=>{u();let y=Dt(),m=p===!0||a!==void 0,f=$t[e],C=w=>{if(m){w.preventDefault();return}n?.(w)};return Ft("span",{className:"cui-button-group",children:[$("button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":f.fg,"data-cui-surface":f.surface,"data-cui-type":f.type,"data-testid":o,"aria-disabled":m?!0:void 0,"aria-busy":p===!0?!0:void 0,"aria-describedby":a===void 0?void 0:y,"aria-expanded":s,"aria-controls":d,onClick:C,ref:i,...N(c),children:$(Ve,{children:p===!0?l:t})}),a===void 0?null:$(x,{fg:"fg-muted",type:"body",id:y,testId:`${o}-reason`,children:a.reason})]})},Ht=({onNavigate:e,children:t,testId:o,ref:r})=>(u(),$("button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":o,onClick:e,ref:r,children:$(Ve,{children:t})}));import{useId as ze}from"react";import{Fragment as Ot,jsx as k,jsxs as K}from"react/jsx-runtime";var ye=({id:e,title:t,description:o,actions:r,testId:n,headingRef:a,ref:s,dataAttributes:d,children:i})=>{u();let c=ze();return K("section",{className:"cui-card",id:e,"aria-labelledby":c,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":n,ref:s,...N(d),children:[K("div",{className:"cui-card-header",children:[K("div",{className:"cui-card-heading",children:[k("h2",{className:"cui-card-title",id:c,"data-cui-type":"title",ref:a,tabIndex:a===void 0?void 0:-1,children:t}),o===void 0?null:k("div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),r===void 0?null:k("div",{className:"cui-card-actions",children:r})]}),i]})},Ut=({id:e,title:t,subtitle:o,region:r=!1,testId:n,headingRef:a,ref:s,dataAttributes:d,children:i})=>{u();let c=ze(),p=K(Ot,{children:[K("div",{className:"cui-card-section-heading",children:[k("h3",{className:"cui-card-section-title",id:c,"data-cui-type":"body",ref:a,tabIndex:a===void 0?void 0:-1,children:t}),o===void 0?null:k("div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),i]});return r?k("section",{className:"cui-card-section",id:e,"aria-labelledby":c,"data-testid":n,ref:s,...N(d),children:p}):k("div",{className:"cui-card-section",id:e,"data-testid":n,ref:s,...N(d),children:p})};import{jsx as We}from"react/jsx-runtime";var Bt=({label:e,code:t,testId:o})=>(u(),We("section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":o,children:We("pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${o}-code`,children:t})}));import{useId as qt}from"react";import{jsx as Kt}from"react/jsx-runtime";var H=({ruleKey:e,css:t})=>Kt("style",{href:e,precedence:"cui",children:t});import{jsx as P,jsxs as I}from"react/jsx-runtime";var _t=({caption:e,attributes:t,columns:o,attributePx:r,columnMinPx:n,testId:a})=>{u();let s=qt();for(let l of[r,n])if(!(Number.isFinite(l)&&l>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${l}`);if(o.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let l of o)for(let y of t)if(!Object.hasOwn(l.cells,y.key))throw new RangeError(`Column "${l.key}" has no value for attribute "${y.key}"`);let d=r+o.length*n,i=`cui-comparison-a${r}-c${n}-n${o.length}`,c=l=>`[data-cui-comparison="${i}"][data-cui-comparison-layout="${l}"]`,p=`${c("table")}{display:none}@container (min-width:${D(d)}){${c("table")}{display:block}${c("stack")}{display:none}}`;return I("div",{className:"cui-container","data-cui-stack-below-px":d,"data-testid":a,children:[P(H,{ruleKey:i,css:p}),P("div",{className:"cui-comparison-frame","data-cui-comparison":i,"data-cui-comparison-layout":"table",children:I("table",{className:"cui-comparison-table","data-cui-type":"body",children:[P("caption",{className:"cui-visually-hidden",children:e}),I("colgroup",{children:[P("col",{style:{width:D(r)}}),o.map(l=>P("col",{},l.key))]}),P("thead",{children:I("tr",{children:[P("td",{}),o.map(l=>P("th",{scope:"col",children:l.heading},l.key))]})}),P("tbody",{children:t.map(l=>I("tr",{children:[P("th",{scope:"row",children:l.label}),o.map(y=>P("td",{children:y.cells[l.key]("table")},y.key))]},l.key))})]})}),P("div",{className:"cui-comparison-stack","data-cui-comparison":i,"data-cui-comparison-layout":"stack",children:o.map((l,y)=>{let m=`${s}-column-${y}`;return I("div",{className:"cui-comparison-column",role:"group","aria-labelledby":m,"data-cui-type":"body",children:[P("p",{className:"cui-comparison-heading",id:m,children:l.heading}),P("dl",{className:"cui-comparison-list",children:t.map(f=>I("div",{children:[P("dt",{children:f.label}),P("dd",{children:l.cells[f.key]("stack")})]},f.key))})]},l.key)})})]})};import{useId as Gt}from"react";import{jsx as M,jsxs as zt}from"react/jsx-runtime";var Vt=({caption:e,captionHidden:t,columns:o,rows:r,rowKey:n,rowTestId:a,rowData:s,rowSize:d,empty:i,testId:c,ref:p})=>{u();let l=Gt(),y=Ie(o);return M("div",{className:"cui-container","data-testid":c,ref:p,children:r.length===0?M(x,{as:"p",fg:"fg-muted",type:"prose",testId:`${c}-empty`,children:i}):M("section",{className:"cui-table-frame",tabIndex:0,"aria-labelledby":l,"data-testid":`${c}-frame`,children:zt("table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":d,style:{"--cui-table-min":D(y)},children:[M("caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:l,children:e}),M("colgroup",{children:o.map(m=>M("col",{style:m.width.fixedPx===void 0?void 0:{width:D(m.width.fixedPx)}},m.key))}),M("thead",{children:M("tr",{children:o.map(m=>M("th",{scope:"col","data-cui-align":m.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:m.header},m.key))})}),M("tbody",{children:r.map(m=>M("tr",{tabIndex:-1,"data-cui-row-focus":"","data-testid":a,...N(s?.(m)),children:o.map(f=>M("td",{"data-cui-align":f.align,children:f.cell(m)},f.key))},n(m)))})]})})})};import{jsx as me,jsxs as Jt}from"react/jsx-runtime";var Wt=({items:e,testId:t})=>{if(u(),new Set(e.map(o=>o.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(o=>o.key).join(", ")}`);return me("dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(o=>Jt("div",{className:"cui-description-row","data-testid":`${t}-${o.key}`,children:[me("dt",{"data-cui-fg":"fg-secondary",children:o.term}),me("dd",{"data-cui-fg":"fg",children:o.description})]},o.key))})};import{useId as jt,useLayoutEffect as Je,useRef as Ze}from"react";import{useCallback as Zt}from"react";var Yt=229,Xt=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),fe=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&Xt.has(e.type)&&(e.value!==""||e.validity.badInput),Qt=e=>Zt(t=>{t.key!=="Escape"||t.nativeEvent.isComposing||t.keyCode===Yt||fe(t.target)||(t.stopPropagation(),e())},[e]);import{jsx as Z,jsxs as Xe}from"react/jsx-runtime";var Ye=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},eo=({title:e,open:t,onClose:o,testId:r,children:n})=>{let{labels:a}=E(),s=jt(),d=Ze(null),i=Ze(null);return Je(()=>{let l=d.current;t&&!l.open?(i.current=l.ownerDocument.activeElement,l.showModal()):!t&&l.open&&l.close()},[t]),Je(()=>{let l=d.current;return()=>{l.open&&(l.close(),Ye(i.current),i.current=null)}},[]),Xe("dialog",{className:"cui-dialog","aria-labelledby":s,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":r,ref:d,onClose:()=>{Ye(i.current),i.current=null,t&&o()},onCancel:l=>{fe(l.currentTarget.ownerDocument.activeElement)&&l.preventDefault()},children:[Xe("div",{className:"cui-dialog-header",children:[Z("h2",{className:"cui-dialog-title",id:s,"data-cui-type":"title",children:e}),Z("div",{className:"cui-dialog-actions",children:Z(L,{variant:"secondary",testId:`${r}-close`,onClick:()=>d.current?.close(),children:a.close})})]}),n,Z("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[pe]:"","data-testid":`${r}-announcer`})]})};import{useId as to}from"react";import{jsx as ge,jsxs as Qe}from"react/jsx-runtime";var oo=({summary:e,open:t,onOpenChange:o,testId:r,children:n})=>{u();let a=to();return Qe("div",{className:"cui-disclosure","data-testid":r,children:[Qe("button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":a,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${r}-button`,onClick:()=>o(!t),children:[ge("span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),ge("span",{children:e})]}),ge("div",{className:"cui-disclosure-panel",id:a,hidden:!t,"data-testid":`${r}-panel`,children:n})]})};import{useId as Y}from"react";import{Fragment as co,jsx as v,jsxs as A}from"react/jsx-runtime";var q=({description:e,error:t})=>{u();let o=Y(),r=Y(),n=Y(),a=[e===void 0?null:r,t===void 0?null:n].filter(d=>d!==null).join(" ");return{control:{id:o,"aria-describedby":a===""?void 0:a,"aria-invalid":t===void 0?void 0:!0},descriptionId:r,errorId:n}},_=({description:e,error:t,descriptionId:o,errorId:r,testId:n})=>A(co,{children:[e===void 0?null:v(x,{as:"p",fg:"fg-muted",type:"body",id:o,testId:`${n}-description`,children:e}),t===void 0?null:v(x,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${n}-error`,children:t})]}),ro=({label:e,description:t,error:o,testId:r,children:n})=>{let{control:a,descriptionId:s,errorId:d}=q({label:e,description:t,error:o});return A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":r,children:[v("label",{className:"cui-field-label",htmlFor:a.id,"data-cui-type":"body",children:e}),n(a),v(_,{description:t,error:o,descriptionId:s,errorId:d,testId:r})]})},je=({label:e,description:t,error:o,value:r,onValueChange:n,type:a,list:s,autoComplete:d,required:i,testId:c,ref:p})=>{let{control:l,descriptionId:y,errorId:m}=q({label:e,description:t,error:o}),f=a==="password";return A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${c}-field`,children:[v("label",{className:"cui-field-label",htmlFor:l.id,"data-cui-type":"body",children:e}),v("input",{className:"cui-input",type:a,value:r,list:s,autoComplete:d,spellCheck:f?!1:void 0,autoCapitalize:f?"none":void 0,required:i,onChange:C=>n(C.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":c,ref:p,...l}),v(_,{description:t,error:o,descriptionId:y,errorId:m,testId:c})]})},ao=e=>v(je,{...e}),no=e=>v(je,{...e,type:"password"}),so=({label:e,description:t,error:o,value:r,onValueChange:n,required:a,testId:s,ref:d})=>{let{control:i,descriptionId:c,errorId:p}=q({label:e,description:t,error:o});return A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[v("label",{className:"cui-field-label",htmlFor:i.id,"data-cui-type":"body",children:e}),v("textarea",{className:"cui-input cui-textarea",value:r,required:a,onChange:l=>n(l.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":s,ref:d,...i}),v(_,{description:t,error:o,descriptionId:c,errorId:p,testId:s})]})},io=({label:e,description:t,error:o,value:r,options:n,onValueChange:a,testId:s,ref:d})=>{let{control:i,descriptionId:c,errorId:p}=q({label:e,description:t,error:o});return A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[v("label",{className:"cui-field-label",htmlFor:i.id,"data-cui-type":"body",children:e}),v("select",{className:"cui-input",value:r,onChange:l=>a(l.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":s,ref:d,...i,children:n.map(l=>v("option",{value:l.value,children:l.label},l.value))}),v(_,{description:t,error:o,descriptionId:c,errorId:p,testId:s})]})},lo=({legend:e,description:t,error:o,value:r,options:n,onValueChange:a,testId:s,ref:d})=>{let i=Y(),{control:c,descriptionId:p,errorId:l}=q({label:e,description:t,error:o});return A("fieldset",{className:"cui-radio-group","aria-describedby":c["aria-describedby"],"data-invalid":o!==void 0,"data-testid":s,children:[v("legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),n.map((y,m)=>A("label",{className:"cui-radio","data-cui-type":"body",children:[v("input",{type:"radio",name:i,value:y.value,checked:y.value===r,onChange:()=>a(y.value),"aria-invalid":c["aria-invalid"],"data-testid":`${s}-option-${y.value}`,ref:m===0?d:void 0}),v("span",{children:y.label})]},y.value)),v(_,{description:t,error:o,descriptionId:p,errorId:l,testId:s})]})};import{jsx as yo}from"react/jsx-runtime";var uo={1:"h1",2:"h2",3:"h3"},po=({level:e,type:t,testId:o,headingRef:r,children:n})=>{u();let a=uo[e];return yo(a,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":o,ref:r,tabIndex:r===void 0?void 0:-1,children:n})};import{jsx as go}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"}},fo={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},be=({tone:e,variant:t,testId:o,dataAttributes:r,children:n})=>{u();let a=t==="tint"?mo[e]:{fg:"on-solid",surface:fo[e]};return go("span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":a.fg,"data-cui-surface":a.surface,"data-cui-type":"caption","data-testid":o,...N(r),children:n})};import{useId as bo}from"react";import{jsx as G,jsxs as Ro}from"react/jsx-runtime";var Re=({label:e,valueText:t,value:o,max:r,testId:n})=>{u();let a=bo();if(r!==null){if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Progress maximum must be positive: ${r}`);if(o===null||!(Number.isFinite(o)&&o>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${o}`)}let s=r===null?null:{max:r,now:Math.min(o,r)};return Ro("div",{className:"cui-progress","data-testid":n,children:[G(x,{as:"p",fg:"fg",type:"body",id:a,children:e}),G("div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":a,"aria-valuetext":t,"aria-valuemin":s===null?void 0:0,"aria-valuemax":s?.max,"aria-valuenow":s?.now,"data-cui-surface":"sunken","data-cui-indeterminate":s===null,"data-testid":`${n}-bar`,children:G("div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:s===null?void 0:{inlineSize:`${s.now/s.max*100}%`},"data-testid":`${n}-fill`})}),G("div",{"aria-hidden":"true",children:G(x,{as:"p",fg:"fg-secondary",type:"body",testId:`${n}-value`,children:t})})]})};import{jsx as X,jsxs as et}from"react/jsx-runtime";var To=({title:e,status:t,progress:o,cancel:r,testId:n,children:a})=>et(ye,{title:e,actions:r===void 0?void 0:X(L,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${n}-cancel`,children:r.label}),testId:n,children:[et("div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${n}-status`,children:[X("span",{className:"cui-visually-hidden",children:`${e} `}),X(be,{tone:t.tone,variant:"tint",testId:`${n}-status-pill`,children:t.label})]}),o===void 0?null:X(Re,{...o,testId:`${n}-progress`}),a]});import{useCallback as at,useLayoutEffect as Po,useRef as Q}from"react";import{jsx as tt}from"react/jsx-runtime";var ho=({tone:e,testId:t,children:o})=>(u(),tt("div",{className:"cui-notice","data-cui-tone":e,"data-cui-surface":e==="info"?"info-tint":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-testid":t,children:o})),V=({occurrence:e,testId:t,children:o})=>(u(),tt("div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-occurrence":e,"data-testid":t,children:o},e));import{useCallback as vo,useLayoutEffect as ot,useReducer as Co,useRef as rt}from"react";var xo=e=>e+1,Te=e=>{let t=rt(e),o=rt(null),[,r]=Co(xo,0),n=vo((a=>()=>{a.contains(document.activeElement)&&(o.current=a,r())}),[]);return ot(()=>{t.current=e}),ot(()=>{let a=o.current;if(a===null)return;o.current=null;let s=[null,document.body].includes(document.activeElement);a.isConnected||!s||t.current()?.focus()}),n};import{jsx as j,jsxs as Mo}from"react/jsx-runtime";var he="[data-cui-row-focus]",Eo=e=>{let t=e.ref.current;if(t===null)throw new Error("LoadMore: rows.ref is not attached to the element holding the rows");let o=[...t.querySelectorAll(he)];if(o.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${o.length} ${he} elements for ${e.count} rows`);return o},No=(e,t)=>{let o=-1;return e.forEach((r,n)=>{t.has(r)&&(o=n)}),e[o+1]},wo=({onLoad:e,busy:t,done:o,failure:r,limit:n,rows:a,testId:s})=>{let{formatLocale:d,labels:i}=E(),c=Q(null),p=Q(null),l=Q(null),y=Q(!1),m=()=>{let b=a.ref.current;c.current={shown:new Set(b===null?[]:b.querySelectorAll(he)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};Po(()=>{let b=y.current;y.current=!1;let R=c.current;if(R===null)return;let g=Eo(a);if(t){R.busySeen=!0,R.shown=new Set(g);return}let h=No(g,R.shown),T=r!==null&&r.occurrence!==R.failureOccurrence;if(!(R.busySeen||h!==void 0||T||o)||(c.current=null,T||h===void 0))return;let S=[null,document.body].includes(document.activeElement);(l.current!==null&&document.activeElement===l.current||b&&S)&&h.focus()});let f=Te(()=>o?p.current:l.current),C=at((b=>{l.current=b;let R=f(b);return()=>{l.current=null,y.current=b===document.activeElement,R()}}),[f]),w=at((b=>{p.current=b;let R=f(b);return()=>{p.current=null,R()}}),[f]);return o?j("div",{className:"cui-load-more","data-testid":s,children:j(x,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:w,testId:`${s}-end`,children:i.endOfRecords})}):Mo("div",{className:"cui-load-more","data-testid":s,children:[j(L,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:m,ref:C,testId:`${s}-button`,children:i.loadMore(z(n,d))}),r===null?null:j(V,{occurrence:r.occurrence,testId:`${s}-failure`,children:i.loadFailed(r.reason)})]})};import{jsx as ve,jsxs as nt}from"react/jsx-runtime";var Lo=({master:e,detail:t,masterMinPx:o,detailMinPx:r,testId:n})=>{u();let a=ke({masterMinPx:o,detailMinPx:r,gapPx:W.space["space-6"]});return nt("div",{className:"cui-container","data-testid":n,children:[ve(H,{ruleKey:a.key,css:a.css}),nt("div",{className:"cui-master-detail","data-cui-master-detail":a.key,children:[ve("div",{className:"cui-master-detail-pane","data-testid":`${n}-master`,children:e}),ve("div",{className:"cui-master-detail-pane","data-testid":`${n}-detail`,children:t})]})]})};import{jsx as st}from"react/jsx-runtime";var Ce=({value:e,unit:t,testId:o})=>{let{formatLocale:r,labels:n}=E();if(e===null)return st("span",{className:"cui-measured","data-measured":"false","data-testid":o,children:n.unmeasured});let a=z(e,r);return st("span",{className:"cui-measured","data-measured":"true","data-testid":o,children:t===void 0?a:`${a} ${t}`})};import{jsx as ee,jsxs as ko}from"react/jsx-runtime";var So=({label:e,value:t,min:o,max:r,valueText:n,testId:a})=>{if(u(),!(Number.isFinite(o)&&Number.isFinite(r)&&o<r))throw new RangeError(`Meter needs a finite range with min below max: min ${o}, max ${r}`);if(!(Number.isFinite(t)&&t>=o&&t<=r))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${o}, max ${r}`);return ko("span",{className:"cui-meter","data-testid":a,children:[ee("span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":t,"aria-valuetext":n,"data-cui-surface":"sunken","data-testid":`${a}-bar`,children:ee("span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-o)/(r-o)*100}%`},"data-testid":`${a}-fill`})}),ee("span",{"aria-hidden":"true",children:ee(x,{fg:"fg",type:"body",testId:`${a}-value`,children:n})})]})};import{jsx as it,jsxs as Ao}from"react/jsx-runtime";var Io=({failure:e,onReload:t,forbiddenMessage:o,failureMessage:r,rescueRef:n,testId:a})=>{let{labels:s}=E();return Ao("div",{className:"cui-resource-failed","data-testid":a,children:[it(V,{occurrence:e.occurrence,testId:`${a}-alert`,children:s.failureSentence(e,o,r===void 0?s.loadFailed:r)}),e.status===403?null:it(L,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:n,testId:`${a}-reload`,children:s.reload})]})};import{jsx as xe,jsxs as $o}from"react/jsx-runtime";var Do=({label:e,options:t,value:o,onValueChange:r,testId:n})=>{u();let a=new Set(t.map(s=>s.value));if(t.length<2||a.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(s=>s.value).join(", ")}`);if(!a.has(o))throw new RangeError(`The pressed value "${o}" is not one of the options: ${[...a].join(", ")}`);return $o("fieldset",{className:"cui-segmented-group","data-testid":n,children:[xe("legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),xe("div",{className:"cui-segmented",children:t.map(s=>{let d=s.value===o;return xe("button",{className:"cui-segment",type:"button","aria-pressed":d,"data-cui-fg":d?"on-solid":"fg","data-cui-surface":d?"info-solid":void 0,"data-cui-type":"body","data-testid":`${n}-${s.value}`,onClick:()=>{d||r(s.value)},children:s.label},s.value)})})]})};import{jsx as F}from"react/jsx-runtime";var lt=({selected:e,controls:t,onSelect:o,testId:r,dataAttributes:n,ref:a,children:s})=>(u(),F("button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:o,ref:a,...N(n),children:s})),Ho=({label:e,items:t,itemKey:o,selectedKey:r,onSelect:n,detailId:a,renderRow:s,rowTestId:d,rowData:i,empty:c,testId:p,ref:l})=>(u(),F("div",{className:"cui-selectable","data-testid":p,ref:l,children:t.length===0?F(x,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:c}):F("ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(y=>{let m=o(y);return F("li",{children:F(lt,{selected:m===r,controls:a,onSelect:()=>n(y),testId:d,dataAttributes:i?.(y),children:s(y)})},m)})})}));import{useId as Fo}from"react";import{jsx as te,jsxs as dt}from"react/jsx-runtime";var Uo=({label:e,value:t,min:o,max:r,step:n,valueText:a,onValueChange:s,testId:d})=>{u();let i=Fo();if(!([t,o,r,n].every(Number.isFinite)&&o<r&&n>0&&o<=t&&t<=r))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${o}, max ${r}, step ${n}`);let c=a(t);return dt("div",{className:"cui-field","data-testid":`${d}-field`,children:[te("label",{className:"cui-field-label",htmlFor:i,"data-cui-type":"body",children:e}),dt("div",{className:"cui-slider",children:[te("input",{className:"cui-slider-input",id:i,type:"range",min:o,max:r,step:n,value:t,"aria-valuetext":c,"data-testid":d,onChange:p=>s(p.currentTarget.valueAsNumber)}),te("span",{className:"cui-slider-value","aria-hidden":"true",children:te(x,{fg:"fg",type:"body",testId:`${d}-value`,children:c})})]})]})};import{jsx as ct}from"react/jsx-runtime";var Oo=({gap:e,testId:t,children:o})=>(u(),ct("div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:o})),Bo=({gap:e,testId:t,children:o})=>(u(),ct("div",{className:"cui-cluster","data-cui-gap":e,"data-testid":t,children:o}));import{jsx as Pe,jsxs as pt}from"react/jsx-runtime";var ut={done:0,current:1,pending:2},Ko={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},qo=({label:e,steps:t,testId:o})=>{let{labels:r}=E();if(t.length===0||new Set(t.map(a=>a.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(a=>a.id).join(", ")}`);if(t.filter(a=>a.state==="current").length>1||t.some((a,s)=>s>0&&ut[a.state]<ut[t[s-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(a=>a.state).join(", ")}`);let n={done:r.stepDone,current:null,pending:r.stepPending};return Pe("ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":o,children:t.map((a,s)=>{let d=Ko[a.state],i=n[a.state];return pt("li",{className:"cui-step","aria-current":a.state==="current"?"step":void 0,"data-cui-step":a.state,"data-testid":`${o}-${a.id}`,children:[Pe("span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":d.fg,"data-cui-surface":d.surface,"data-cui-type":"caption",children:a.state==="done"?"\u2713":s+1}),pt("span",{className:"cui-step-label","data-cui-fg":"fg",children:[a.label,i===null?null:Pe("span",{className:"cui-visually-hidden",children:` (${i})`})]})]},a.id)})})};import{jsx as Ee,jsxs as Go}from"react/jsx-runtime";var _o=({label:e,checked:t,onCheckedChange:o,testId:r})=>(u(),Go("button",{className:"cui-switch",type:"button",role:"switch","aria-checked":t,"data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:()=>o(!t),children:[Ee("span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":t?"info-solid":"sunken","data-testid":`${r}-track`,children:Ee("span",{className:"cui-switch-thumb","data-cui-surface":t?"surface":"neutral-solid","data-testid":`${r}-thumb`})}),Ee("span",{children:e})]}));import{jsx as oe}from"react/jsx-runtime";var Vo=({label:e,items:t,currentId:o,onNavigate:r,testId:n})=>{if(u(),t.length===0)throw new RangeError("Tabs needs at least one tab");let a=new Set(t.map(s=>s.id));if(a.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(s=>s.id).join(", ")}`);if(!a.has(o))throw new RangeError(`The current tab "${o}" is not one of the tabs: ${[...a].join(", ")}`);return oe("nav",{className:"cui-tabs","aria-label":e,"data-testid":n,children:oe("ul",{className:"cui-tabs-list",role:"list",children:t.map(s=>{let d=s.id===o;return oe("li",{className:"cui-tabs-item",children:oe("a",{className:"cui-tab",href:s.href,"aria-current":d?"page":void 0,"data-cui-fg":d?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${n}-${s.id}`,onClick:i=>J(i,s.href,r),children:s.label})},s.id)})})})};import{Children as zo,Fragment as Wo,isValidElement as Jo}from"react";import{jsx as U,jsxs as mt}from"react/jsx-runtime";var Zo={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},Yo=({label:e,sublabel:t,value:o,tone:r,testId:n,dataAttributes:a})=>{if(u(),o===null&&r!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${r}`);return mt("div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":n,...N(a),children:[U("p",{className:"cui-tile-label","data-cui-type":"caption",children:e}),U("p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption",children:t}),U("p",{className:"cui-tile-value","data-cui-fg":Zo[r],"data-cui-type":"heading",children:U(Ce,{value:o,testId:`${n}-value`})})]})},yt=e=>zo.toArray(e).flatMap(t=>{if(!Jo(t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===Wo?yt(t.props.children):[t]}),Xo=({count:e,minInlinePx:t,testId:o,children:r})=>{u();let n=Ae(e,t,W.space["space-2"]),a=yt(r).length;if(a!==e)throw new RangeError(`TileGrid has ${a} tiles but count is ${e}`);return mt("div",{className:"cui-container","data-testid":o,children:[U(H,{ruleKey:n.key,css:n.css}),U("div",{className:"cui-tile-grid","data-cui-tile-grid":n.key,"data-cui-gap":"space-2",children:r})]})};import{useLayoutEffect as Qo,useRef as ft}from"react";import{jsx as er}from"react/jsx-runtime";var re=e=>[...e.querySelectorAll("button")],jo=({label:e,testId:t,children:o})=>{u();let r=ft(null),n=ft(null);Qo(()=>{let i=re(r.current),c=n.current!==null&&i.includes(n.current)?n.current:i[0]??null;n.current=c;for(let p of i)p.tabIndex=p===c?0:-1});let a=i=>{for(let c of re(r.current))c.tabIndex=c===i?0:-1;n.current=i};return er("div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:r,onFocus:i=>{let c=re(i.currentTarget).find(p=>p.contains(i.target));c!==void 0&&a(c)},onKeyDown:i=>{let c=re(i.currentTarget),p=c.indexOf(i.target);if(p===-1)return;let l=getComputedStyle(i.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",y=l==="ArrowRight"?"ArrowLeft":"ArrowRight",f={[l]:(p+1)%c.length,[y]:(p-1+c.length)%c.length,Home:0,End:c.length-1}[i.key];if(f===void 0)return;i.preventDefault();let C=c[f];a(C),C.focus()},children:o})};import{useCallback as O,useEffect as rr,useLayoutEffect as bt,useRef as Me}from"react";import{useCallback as ae,useEffect as tr,useLayoutEffect as or,useRef as Ne,useState as we}from"react";var gt=e=>e===null?se:ie,ne=(e,t,o,r,n)=>{let[a,s]=we(()=>({key:e,state:gt(e)})),[d,i]=we(0),[c,p]=we(0),l=Ne(t),y=Ne(null),m=Ne(d);or(()=>{l.current=t}),tr(()=>{if(e===null){s({key:null,state:se});return}let g=new AbortController;y.current=e;let h=d===m.current?"revision":"reload";return m.current=d,s(T=>Object.is(T.key,e)?{key:e,state:r(T.state,h)}:{key:e,state:ie}),l.current(g.signal).then(T=>{g.signal.aborted||(y.current=null,s(S=>({key:e,state:n(S.state,T)})))},T=>{g.signal.aborted||s(()=>{throw T})}),()=>{g.abort(),y.current=null}},[e,o,d,c]);let f=ae(()=>i(g=>g+1),[]),C=ae(()=>p(g=>g+1),[]),w=ae((g,h)=>{s(T=>Object.is(T.key,g)?{key:g,state:h(T.state)}:T)},[]),b=ae((g,h)=>{w(g,h),Object.is(y.current,g)&&C()},[w,C]);return{state:Object.is(a.key,e)?a.state:gt(e),reload:f,refresh:C,update:w,write:b}};var ar=(e,t,o)=>{let r=Me(t);bt(()=>{r.current=t});let n=O(b=>r.current.first(b),[]),{state:a,reload:s,refresh:d,update:i,write:c}=ne(e,n,o,De,$e),p=Me({key:e,state:a});bt(()=>{p.current={key:e,state:a}});let l=Me(null),y=O(()=>{l.current?.controller.abort(),l.current=null},[]);rr(()=>y,[e,o,y]);let m=O(()=>{y(),s()},[y,s]),f=O(()=>{y(),d()},[y,d]),C=O(()=>{let{key:b,state:R}=p.current;if(b===null||R.kind!=="ready"||R.refreshing||R.value.next===null||R.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let g=R.value.next,h={key:b,controller:new AbortController,maps:[]};l.current=h,i(b,He),r.current.next(g,h.controller.signal).then(T=>{l.current===h&&(l.current=null,i(b,S=>h.maps.reduce((Rt,Tt)=>de(Rt,Tt),Fe(S,g,T))))},T=>{l.current===h&&i(b,()=>{throw T})})},[i]),w=O((b,R)=>{let g=l.current;g!==null&&Object.is(g.key,b)&&g.maps.push(R),c(b,h=>de(h,R))},[c]);return{state:a,reload:m,refresh:f,loadMore:C,updateList:w}};import{useCallback as nr}from"react";var sr=(e,t,o)=>{let{state:r,reload:n,refresh:a,write:s}=ne(e,t,o,Le,le),d=nr((i,c)=>s(i,p=>le(p,{ok:!0,value:c})),[s]);return{state:r,reload:n,refresh:a,put:d}};import{jsx as lr}from"react/jsx-runtime";var ir=({testId:e,children:t})=>(u(),lr("span",{className:"cui-visually-hidden","data-testid":e,children:t}));export{ue as ANNOUNCE_SETTLE_MS,V as AlertMessage,It as Breadcrumb,L as Button,gr as CONSOLE_UI_LABEL_CATALOGS,xr as CONTRAST_MINIMUM,Pr as CONTRAST_PAIRS,ye as Card,Ut as CardSection,Bo as Cluster,Bt as CodeBlock,_t as ComparisonGrid,Lt as ConsoleUiRoot,Vt as DataTable,Wt as DescriptionList,eo as Dialog,oo as Disclosure,ro as Field,ht as HTTP_FORBIDDEN,po as Heading,To as JobCard,Er as LATTICE_PX,Ht as Link,wo as LoadMore,Lo as MasterDetail,Ce as Measured,So as Meter,Yo as MetricTile,ho as Notice,no as PasswordInput,be as Pill,Re as ProgressBar,Mr as ROW_WITH_CONTROL_PX,lo as RadioGroup,Io as ResourceFailed,lt as RowButton,Do as SegmentedControl,io as Select,Ho as SelectableList,Uo as Slider,Oo as Stack,qo as Stepper,_o as Switch,wr as TARGET_PX,W as TOKENS,Vo as Tabs,x as Text,so as TextArea,ao as TextInput,Xo as TileGrid,jo as Toolbar,ir as VisuallyHidden,dr as ZonedTimeError,He as beginPage,De as beginPagedReload,Le as beginReload,hr as ceil8,Nr as ceilToLattice,Cr as contrastRatio,Lr as cssVar,mr as flatMapOutcome,z as formatCount,pr as formatInstant,vr as hexToSrgb,le as keepLastGood,yr as mapOutcome,de as mapPagedList,br as masterDetailPlan,Tr as monoTextWidthEm,fr as reasonAside,Se as resolveConsoleUiLabels,$e as settleFirstPage,Fe as settlePage,Ie as tableMinInlinePx,Rr as textWidthEm,Ae as tileGridPlan,cr as toOffsetIso,ur as toWallTime,St as useAnnounce,E as useConsoleUi,Qt as useEscapeToClose,Te as useFocusRescue,ar as usePagedResource,sr as useResource};
@@ -840,9 +840,12 @@
840
840
  border-radius: var(--cui-radius-pill);
841
841
  }
842
842
 
843
- /* 整形済みの文は pre のまま折り返さず、枠が横に送る (高さは上下の space-2 と本文の行の倍数なので格子に乗る) */
843
+ /* 整形済みの文は pre のまま折り返さず、枠が横に送る (高さは上下の space-2 と本文の行の倍数なので格子に乗る)。
844
+ 枠は焦点を受ける的なので、1 行の文でも的の大きさより低くしない (2 × 8 + 20 = 36 px の枠は 44 px に満たない) */
844
845
  .cui-code-frame {
846
+ box-sizing: border-box;
845
847
  overflow-x: auto;
848
+ min-block-size: var(--cui-size-target);
846
849
  padding: var(--cui-space-2);
847
850
  border-radius: var(--cui-radius-item);
848
851
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiquants/console-ui",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
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"