@pstdio/ui 0.17.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/dist/{MermaidComponent-BCMQqPqu.js → MermaidComponent-BPiVFNYK.js} +2 -2
  2. package/dist/{MermaidComponent-BCMQqPqu.js.map → MermaidComponent-BPiVFNYK.js.map} +1 -1
  3. package/dist/chat-ui.js +941 -899
  4. package/dist/chat-ui.js.map +1 -1
  5. package/dist/components/chat-ui/components/chat-message-list-items.d.ts +17 -0
  6. package/dist/components/chat-ui/components/message-types.d.ts +1 -0
  7. package/dist/components/chat-ui/components/timeline.d.ts +2 -0
  8. package/dist/components/chat-ui/tool-rendering/default-renderers.d.ts +1 -0
  9. package/dist/components/chat-ui/tool-rendering/shared.d.ts +3 -2
  10. package/dist/components/chat-ui/tool-rendering/standard-renderers.d.ts +1 -0
  11. package/dist/components/data-table/data-table-column-menu.d.ts +4 -1
  12. package/dist/components/data-table/data-table-header.d.ts +0 -8
  13. package/dist/components/data-table/data-table-skeleton.d.ts +13 -0
  14. package/dist/components/data-table/editable-cells-story.d.ts +9 -0
  15. package/dist/components/data-table/index.d.ts +2 -0
  16. package/dist/components/diff-viewer/code-editor.d.ts +2 -0
  17. package/dist/components/diff-viewer/index.d.ts +1 -1
  18. package/dist/components/diff-viewer/monaco-browser.d.ts +1 -0
  19. package/dist/components/overlays/dialog-accept-shortcut.d.ts +12 -0
  20. package/dist/components/overlays/index.d.ts +1 -0
  21. package/dist/components/overlays/searchable-menu-input.d.ts +9 -0
  22. package/dist/components/param-editor/index.d.ts +7 -2
  23. package/dist/components/param-editor/inputs/action-input.d.ts +1 -0
  24. package/dist/components/param-editor/inputs/boolean-input.d.ts +13 -0
  25. package/dist/components/param-editor/inputs/color-input.d.ts +1 -0
  26. package/dist/components/param-editor/inputs/date-input.d.ts +1 -0
  27. package/dist/components/param-editor/inputs/file-upload-input.d.ts +15 -0
  28. package/dist/components/param-editor/inputs/file-upload-value.d.ts +7 -0
  29. package/dist/components/param-editor/inputs/horizontal-text-input.d.ts +1 -0
  30. package/dist/components/param-editor/inputs/markdown-input.d.ts +13 -0
  31. package/dist/components/param-editor/inputs/number-input.d.ts +1 -0
  32. package/dist/components/param-editor/inputs/range-input.d.ts +1 -0
  33. package/dist/components/param-editor/inputs/resource-input.d.ts +2 -0
  34. package/dist/components/param-editor/inputs/segmented-input.d.ts +1 -0
  35. package/dist/components/param-editor/inputs/selection-input.d.ts +6 -0
  36. package/dist/components/param-editor/inputs/selection-menu.d.ts +10 -0
  37. package/dist/components/param-editor/inputs/text-input.d.ts +1 -0
  38. package/dist/components/param-editor/param-editor-advanced-field.d.ts +14 -0
  39. package/dist/components/param-editor/param-editor-control-fixtures.d.ts +24 -0
  40. package/dist/components/param-editor/param-editor-field.d.ts +2 -0
  41. package/dist/components/param-editor/param-editor-horizontal.d.ts +2 -2
  42. package/dist/components/param-editor/param-editor-label.d.ts +1 -0
  43. package/dist/components/param-editor/param-editor-presentation.d.ts +3 -0
  44. package/dist/components/param-editor/param-editor-row.d.ts +17 -0
  45. package/dist/components/param-editor/param-editor.types.d.ts +43 -13
  46. package/dist/components/param-editor/resolve-param-value.d.ts +2 -0
  47. package/dist/components/primitives/chip.d.ts +4 -0
  48. package/dist/components/primitives/glyph-icon.d.ts +16 -0
  49. package/dist/components/primitives/icon-color-picker.d.ts +3 -13
  50. package/dist/components/primitives/icon-options.d.ts +301 -0
  51. package/dist/components/primitives/index.d.ts +12 -3
  52. package/dist/components/primitives/resource-badge.d.ts +12 -10
  53. package/dist/components/primitives/segmented-control.d.ts +20 -0
  54. package/dist/components/primitives/tag-swatch.d.ts +10 -0
  55. package/dist/components/rich-text/index.d.ts +1 -0
  56. package/dist/components/rich-text/lazy-markdown-editor.d.ts +2 -0
  57. package/dist/components/rich-text/utils/inferResourceType.d.ts +1 -1
  58. package/dist/components/tag-editor/index.d.ts +4 -0
  59. package/dist/components/tag-editor/tag-editor-heading.d.ts +11 -0
  60. package/dist/components/tag-editor/tag-editor-row.d.ts +1 -1
  61. package/dist/components/tag-editor/tag-editor-save-bar.d.ts +13 -0
  62. package/dist/components/tag-editor/tag-editor.types.d.ts +11 -11
  63. package/dist/components/tag-editor/tag-settings-panel.d.ts +3 -1
  64. package/dist/data-table.js +1018 -926
  65. package/dist/data-table.js.map +1 -1
  66. package/dist/dialog-accept-shortcut-DAEBsoWW.js +7 -0
  67. package/dist/dialog-accept-shortcut-DAEBsoWW.js.map +1 -0
  68. package/dist/diff.js +370 -366
  69. package/dist/diff.js.map +1 -1
  70. package/dist/font/css/prompt-studio-icons.css +720 -0
  71. package/dist/font/prompt-studio-icons.eot +0 -0
  72. package/dist/font/prompt-studio-icons.svg +1 -0
  73. package/dist/font/prompt-studio-icons.ttf +0 -0
  74. package/dist/font/prompt-studio-icons.woff +0 -0
  75. package/dist/font/prompt-studio-icons.woff2 +0 -0
  76. package/dist/index.d.ts +2 -2
  77. package/dist/index.js +1958 -1744
  78. package/dist/index.js.map +1 -1
  79. package/dist/{kanban-renderer-toolbar-B9ro-9z1.js → kanban-renderer-toolbar-Bcj_N1qr.js} +66 -66
  80. package/dist/kanban-renderer-toolbar-Bcj_N1qr.js.map +1 -0
  81. package/dist/kanban-renderer.js +834 -817
  82. package/dist/kanban-renderer.js.map +1 -1
  83. package/dist/lazy-markdown-editor-DwhqQ-NN.js +26 -0
  84. package/dist/lazy-markdown-editor-DwhqQ-NN.js.map +1 -0
  85. package/dist/list-row-BtoVJpFs.js +821 -0
  86. package/dist/list-row-BtoVJpFs.js.map +1 -0
  87. package/dist/markdown-DDd2ESoH.js +743 -0
  88. package/dist/markdown-DDd2ESoH.js.map +1 -0
  89. package/dist/markdown-editor-CYVkzt8t.js +741 -0
  90. package/dist/markdown-editor-CYVkzt8t.js.map +1 -0
  91. package/dist/monaco-browser-CO0NxK_Z.js +19 -0
  92. package/dist/monaco-browser-CO0NxK_Z.js.map +1 -0
  93. package/dist/param-editor-XRjSu6MT.js +161 -0
  94. package/dist/param-editor-XRjSu6MT.js.map +1 -0
  95. package/dist/param-editor-field-B9lEPq8c.js +3028 -0
  96. package/dist/param-editor-field-B9lEPq8c.js.map +1 -0
  97. package/dist/resource-badge-CuItchgL.js +98 -0
  98. package/dist/resource-badge-CuItchgL.js.map +1 -0
  99. package/dist/rich-message--eRzjWYK.js +730 -0
  100. package/dist/rich-message--eRzjWYK.js.map +1 -0
  101. package/dist/rich-text.js +114 -827
  102. package/dist/rich-text.js.map +1 -1
  103. package/dist/style.css +1 -1
  104. package/dist/theme/primitives/fonts.d.ts +3 -0
  105. package/dist/theme/primitives/sizes.d.ts +59 -0
  106. package/dist/theme/recipes/badge.d.ts +8 -0
  107. package/dist/theme/recipes/color-picker.d.ts +18 -1
  108. package/dist/theme/recipes/segmented-control.d.ts +22 -0
  109. package/dist/theme/recipes/switch.d.ts +18 -0
  110. package/dist/theme/recipes/tabs.d.ts +11 -0
  111. package/dist/{theme-CNhnbvcE.js → theme-7PDdD9OD.js} +403 -195
  112. package/dist/theme-7PDdD9OD.js.map +1 -0
  113. package/dist/theme.js +1 -1
  114. package/dist/{tree-list-CZHLAURU.js → tree-list-B2L0cTj2.js} +2 -2
  115. package/dist/{tree-list-CZHLAURU.js.map → tree-list-B2L0cTj2.js.map} +1 -1
  116. package/package.json +3 -2
  117. package/dist/components/param-editor/inputs/file-accept.d.ts +0 -22
  118. package/dist/components/param-editor/inputs/file-drop-input.d.ts +0 -14
  119. package/dist/kanban-renderer-toolbar-B9ro-9z1.js.map +0 -1
  120. package/dist/list-row-YRUxEcy3.js +0 -808
  121. package/dist/list-row-YRUxEcy3.js.map +0 -1
  122. package/dist/param-editor-CYZJbmKu.js +0 -933
  123. package/dist/param-editor-CYZJbmKu.js.map +0 -1
  124. package/dist/param-editor-read-only-field-DgtLqcFa.js +0 -925
  125. package/dist/param-editor-read-only-field-DgtLqcFa.js.map +0 -1
  126. package/dist/prism-BXb57lxL.js +0 -125
  127. package/dist/prism-BXb57lxL.js.map +0 -1
  128. package/dist/resource-badge-qCWHP-wQ.js +0 -99
  129. package/dist/resource-badge-qCWHP-wQ.js.map +0 -1
  130. package/dist/rich-message-DBf_5YlW.js +0 -1450
  131. package/dist/rich-message-DBf_5YlW.js.map +0 -1
  132. package/dist/theme-CNhnbvcE.js.map +0 -1
@@ -0,0 +1,821 @@
1
+ import { jsx as r, jsxs as P, Fragment as et } from "react/jsx-runtime";
2
+ import { c as O } from "react/compiler-runtime";
3
+ import { Menu as C, Portal as Ne, HStack as he, Stack as tt, Text as je, Box as z, Icon as Pe, InputGroup as st, Input as at, IconButton as qe, chakra as ze } from "@chakra-ui/react";
4
+ import * as ct from "react";
5
+ import { Fragment as Ke, useState as Ve, useRef as Ue, useEffect as Ye, forwardRef as dt } from "react";
6
+ import { Search as ut, ChevronDown as nt, ChevronRight as ht } from "lucide-react";
7
+ import { T as Qe, S as ft } from "./scroll-area-BMbg1WcD.js";
8
+ const ot = (n) => {
9
+ const e = O(6), {
10
+ actions: t,
11
+ contentBackground: o,
12
+ contentMinWidth: i
13
+ } = n;
14
+ let s;
15
+ e[0] !== t ? (s = t.map(mt), e[0] = t, e[1] = s) : s = e[1];
16
+ let l;
17
+ return e[2] !== o || e[3] !== i || e[4] !== s ? (l = /* @__PURE__ */ r(Ne, { children: /* @__PURE__ */ r(C.Positioner, { children: /* @__PURE__ */ r(C.Content, { minW: i, bg: o, children: s }) }) }), e[2] = o, e[3] = i, e[4] = s, e[5] = l) : l = e[5], l;
18
+ }, on = (n) => {
19
+ const e = O(13), {
20
+ actions: t,
21
+ children: o,
22
+ contentMinWidth: i,
23
+ contentBackground: s,
24
+ positioning: l,
25
+ closeOnSelect: a
26
+ } = n, d = i === void 0 ? "17.5rem" : i, c = s === void 0 ? "bg" : s;
27
+ let h;
28
+ e[0] !== l ? (h = l === void 0 ? {
29
+ placement: "bottom-start"
30
+ } : l, e[0] = l, e[1] = h) : h = e[1];
31
+ const p = h;
32
+ if (t.length === 0)
33
+ return o;
34
+ let m;
35
+ e[2] !== o ? (m = /* @__PURE__ */ r(C.Trigger, { asChild: !0, children: o }), e[2] = o, e[3] = m) : m = e[3];
36
+ let u;
37
+ e[4] !== t || e[5] !== c || e[6] !== d ? (u = /* @__PURE__ */ r(ot, { actions: t, contentMinWidth: d, contentBackground: c }), e[4] = t, e[5] = c, e[6] = d, e[7] = u) : u = e[7];
38
+ let f;
39
+ return e[8] !== a || e[9] !== p || e[10] !== m || e[11] !== u ? (f = /* @__PURE__ */ P(C.Root, { positioning: p, closeOnSelect: a, children: [
40
+ m,
41
+ u
42
+ ] }), e[8] = a, e[9] = p, e[10] = m, e[11] = u, e[12] = f) : f = e[12], f;
43
+ }, pt = (n) => {
44
+ const e = O(15), {
45
+ actions: t,
46
+ children: o,
47
+ contentMinWidth: i,
48
+ contentBackground: s,
49
+ positioning: l,
50
+ closeOnSelect: a,
51
+ keepMountedWhenEmpty: d
52
+ } = n, c = i === void 0 ? "17.5rem" : i, h = s === void 0 ? "bg" : s;
53
+ let p;
54
+ e[0] !== l ? (p = l === void 0 ? {
55
+ placement: "bottom-start"
56
+ } : l, e[0] = l, e[1] = p) : p = e[1];
57
+ const m = p, u = d === void 0 ? !1 : d;
58
+ if (t.length === 0 && !u) {
59
+ let g;
60
+ return e[2] !== o ? (g = /* @__PURE__ */ r(et, { children: o }), e[2] = o, e[3] = g) : g = e[3], g;
61
+ }
62
+ let f;
63
+ e[4] !== o ? (f = /* @__PURE__ */ r(C.ContextTrigger, { asChild: !0, children: o }), e[4] = o, e[5] = f) : f = e[5];
64
+ let b;
65
+ e[6] !== t || e[7] !== h || e[8] !== c ? (b = t.length > 0 ? /* @__PURE__ */ r(ot, { actions: t, contentMinWidth: c, contentBackground: h }) : null, e[6] = t, e[7] = h, e[8] = c, e[9] = b) : b = e[9];
66
+ let S;
67
+ return e[10] !== a || e[11] !== m || e[12] !== f || e[13] !== b ? (S = /* @__PURE__ */ P(C.Root, { positioning: m, closeOnSelect: a, children: [
68
+ f,
69
+ b
70
+ ] }), e[10] = a, e[11] = m, e[12] = f, e[13] = b, e[14] = S) : S = e[14], S;
71
+ };
72
+ function mt(n) {
73
+ return /* @__PURE__ */ P(Ke, { children: [
74
+ n.separatorBefore ? /* @__PURE__ */ r(C.Separator, {}) : null,
75
+ /* @__PURE__ */ r(C.Item, { value: n.key, disabled: n.isDisabled, asChild: !0, children: /* @__PURE__ */ r(Fe, { asChild: !0, variant: "full-width", label: n.label, icon: n.icon, endContent: n.endContent, disabled: n.isDisabled, onActivate: n.onClick }) })
76
+ ] }, n.key);
77
+ }
78
+ const gt = (n) => {
79
+ const e = O(4), {
80
+ item: t
81
+ } = n;
82
+ if (!t.icon)
83
+ return null;
84
+ let o;
85
+ e[0] !== t.icon ? (o = typeof t.icon == "function" ? /* @__PURE__ */ r(Pe, { as: t.icon, boxSize: "14px" }) : t.icon, e[0] = t.icon, e[1] = o) : o = e[1];
86
+ let i;
87
+ return e[2] !== o ? (i = /* @__PURE__ */ r(z, { color: "fg.muted", flexShrink: 0, display: "inline-flex", children: o }), e[2] = o, e[3] = i) : i = e[3], i;
88
+ }, bt = (n) => {
89
+ const e = O(20), {
90
+ children: t,
91
+ items: o,
92
+ onOpenChange: i,
93
+ onSelect: s,
94
+ open: l,
95
+ placement: a
96
+ } = n, d = a === void 0 ? "right-start" : a;
97
+ let c;
98
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = {
99
+ mainAxis: 4
100
+ }, e[0] = c) : c = e[0];
101
+ let h;
102
+ e[1] !== d ? (h = {
103
+ placement: d,
104
+ offset: c
105
+ }, e[1] = d, e[2] = h) : h = e[2];
106
+ let p;
107
+ e[3] !== i ? (p = (S) => i(S.open), e[3] = i, e[4] = p) : p = e[4];
108
+ let m;
109
+ e[5] !== t ? (m = /* @__PURE__ */ r(C.Trigger, { asChild: !0, children: t }), e[5] = t, e[6] = m) : m = e[6];
110
+ let u;
111
+ if (e[7] !== o || e[8] !== s) {
112
+ let S;
113
+ e[10] !== s ? (S = (g) => /* @__PURE__ */ P(Ke, { children: [
114
+ g.separatorBefore ? /* @__PURE__ */ r(C.Separator, {}) : null,
115
+ /* @__PURE__ */ r(C.Item, { value: g.id, disabled: g.disabled || g.readOnly, _disabled: g.readOnly ? {
116
+ opacity: 1,
117
+ cursor: "default"
118
+ } : void 0, onClick: () => {
119
+ g.readOnly || s(g);
120
+ }, children: /* @__PURE__ */ P(he, { gap: "2", minW: "0", w: "full", justify: "space-between", alignItems: "center", children: [
121
+ /* @__PURE__ */ P(he, { gap: "2", minW: "0", flex: "1", alignItems: g.description ? "flex-start" : "center", children: [
122
+ /* @__PURE__ */ r(gt, { item: g }),
123
+ /* @__PURE__ */ P(tt, { gap: "0", minW: "0", children: [
124
+ /* @__PURE__ */ r(je, { textStyle: "label/S/regular", truncate: !0, children: g.label }),
125
+ g.description ? /* @__PURE__ */ r(je, { textStyle: "label/XS", color: "fg.menu-item.secondary", truncate: !0, children: g.description }) : null
126
+ ] })
127
+ ] }),
128
+ g.endContent ? /* @__PURE__ */ r(z, { flexShrink: 0, children: g.endContent }) : null
129
+ ] }) })
130
+ ] }, g.id), e[10] = s, e[11] = S) : S = e[11], u = o.map(S), e[7] = o, e[8] = s, e[9] = u;
131
+ } else
132
+ u = e[9];
133
+ let f;
134
+ e[12] !== u ? (f = /* @__PURE__ */ r(Ne, { children: /* @__PURE__ */ r(C.Positioner, { children: /* @__PURE__ */ r(C.Content, { minW: "200px", bg: "bg", children: u }) }) }), e[12] = u, e[13] = f) : f = e[13];
135
+ let b;
136
+ return e[14] !== l || e[15] !== h || e[16] !== p || e[17] !== m || e[18] !== f ? (b = /* @__PURE__ */ P(C.Root, { open: l, positioning: h, onOpenChange: p, children: [
137
+ m,
138
+ f
139
+ ] }), e[14] = l, e[15] = h, e[16] = p, e[17] = m, e[18] = f, e[19] = b) : b = e[19], b;
140
+ }, vt = (n) => n.map((e) => ({
141
+ key: e.id,
142
+ label: e.label,
143
+ icon: typeof e.icon == "function" ? /* @__PURE__ */ r(Pe, { as: e.icon, boxSize: "16px" }) : e.icon,
144
+ endContent: e.endContent,
145
+ isDisabled: e.disabled,
146
+ separatorBefore: e.separatorBefore,
147
+ onClick: () => e.onAction?.()
148
+ })), xt = (n) => {
149
+ const e = O(15), {
150
+ children: t,
151
+ item: o,
152
+ menuOpen: i,
153
+ onMenuOpenChange: s,
154
+ onMenuSelect: l
155
+ } = n;
156
+ if (o.menuItems && o.menuItems.length > 0) {
157
+ let p;
158
+ return e[0] !== t || e[1] !== o.menuItems || e[2] !== o.menuPlacement || e[3] !== i || e[4] !== s || e[5] !== l ? (p = /* @__PURE__ */ r(bt, { items: o.menuItems, open: i, placement: o.menuPlacement, onOpenChange: s, onSelect: l, children: t }), e[0] = t, e[1] = o.menuItems, e[2] = o.menuPlacement, e[3] = i, e[4] = s, e[5] = l, e[6] = p) : p = e[6], p;
159
+ }
160
+ let a;
161
+ e[7] !== t || e[8] !== o.tooltip ? (a = o.tooltip ? /* @__PURE__ */ r(Qe, { content: o.tooltip, children: t }) : t, e[7] = t, e[8] = o.tooltip, e[9] = a) : a = e[9];
162
+ const d = a;
163
+ if (!o.contextMenuItems || o.contextMenuItems.length === 0)
164
+ return d;
165
+ let c;
166
+ e[10] !== o.contextMenuItems ? (c = vt(o.contextMenuItems), e[10] = o.contextMenuItems, e[11] = c) : c = e[11];
167
+ let h;
168
+ return e[12] !== d || e[13] !== c ? (h = /* @__PURE__ */ r(pt, { actions: c, children: d }), e[12] = d, e[13] = c, e[14] = h) : h = e[14], h;
169
+ }, St = {
170
+ main: {
171
+ h: "2.5rem",
172
+ px: "xs"
173
+ },
174
+ narrow: {
175
+ h: "2rem",
176
+ px: "xs"
177
+ },
178
+ input: {
179
+ h: "3rem",
180
+ px: "0"
181
+ }
182
+ }, lt = ct.forwardRef(function(e, t) {
183
+ const o = O(9);
184
+ let i, s, l;
185
+ o[0] !== e ? ({
186
+ variant: l,
187
+ children: i,
188
+ ...s
189
+ } = e, o[0] = e, o[1] = i, o[2] = s, o[3] = l) : (i = o[1], s = o[2], l = o[3]);
190
+ const d = St[l === void 0 ? "main" : l];
191
+ let c;
192
+ return o[4] !== i || o[5] !== t || o[6] !== s || o[7] !== d ? (c = /* @__PURE__ */ r(he, { ref: t, as: "header", alignItems: "center", borderWidth: "0", ...d, ...s, children: i }), o[4] = i, o[5] = t, o[6] = s, o[7] = d, o[8] = c) : c = o[8], c;
193
+ }), Ct = {
194
+ bg: "transparent",
195
+ border: "0",
196
+ borderColor: "transparent",
197
+ borderRadius: "0",
198
+ boxShadow: "none",
199
+ transition: "none",
200
+ _hover: {
201
+ bg: "transparent",
202
+ borderColor: "transparent"
203
+ },
204
+ _active: {
205
+ bg: "transparent",
206
+ borderColor: "transparent"
207
+ },
208
+ _focus: {
209
+ borderColor: "transparent",
210
+ outline: "none",
211
+ boxShadow: "none"
212
+ },
213
+ _focusVisible: {
214
+ borderColor: "transparent",
215
+ outline: "none",
216
+ boxShadow: "none"
217
+ }
218
+ }, wt = (n) => {
219
+ const e = O(8), {
220
+ inputRef: t,
221
+ value: o,
222
+ placeholder: i,
223
+ onValueChange: s
224
+ } = n;
225
+ let l;
226
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ r(ut, { size: 14 }), e[0] = l) : l = e[0];
227
+ let a;
228
+ e[1] !== s ? (a = (c) => s(c.target.value), e[1] = s, e[2] = a) : a = e[2];
229
+ let d;
230
+ return e[3] !== t || e[4] !== i || e[5] !== a || e[6] !== o ? (d = /* @__PURE__ */ r(lt, { variant: "input", borderBottomWidth: "1px", borderColor: "border.subtle", flexShrink: 0, children: /* @__PURE__ */ r(st, { startElement: l, width: "full", children: /* @__PURE__ */ r(at, { ref: t, mx: "xs", value: o, placeholder: i, "aria-label": i, autoComplete: "off", ...Ct, onChange: a, onKeyDown: It }) }) }), e[3] = t, e[4] = i, e[5] = a, e[6] = o, e[7] = d) : d = e[7], d;
231
+ };
232
+ function It(n) {
233
+ return n.stopPropagation();
234
+ }
235
+ const yt = (n, e) => {
236
+ const t = e.trim().toLowerCase();
237
+ return t ? n.filter((o) => [o.label, o.searchText].filter(Boolean).join(" ").toLowerCase().includes(t)) : n;
238
+ }, Mt = (n, e) => !n || !e ? !1 : n !== e, Pt = (n, e, t) => !n || !e ? t : {
239
+ items: e.items,
240
+ filterItems: e.filterItems ?? t.filterItems,
241
+ showSearch: e.showSearch ?? t.showSearch,
242
+ searchPlaceholder: e.searchPlaceholder ?? t.searchPlaceholder,
243
+ emptyState: e.emptyState ?? t.emptyState,
244
+ contentTestId: e.contentTestId ?? t.contentTestId,
245
+ closeOnSelect: !1,
246
+ listId: "parent"
247
+ }, Rt = (n) => {
248
+ const e = O(47), {
249
+ trigger: t,
250
+ items: o,
251
+ searchPlaceholder: i,
252
+ emptyState: s,
253
+ filterItems: l,
254
+ listId: a,
255
+ header: d,
256
+ width: c,
257
+ maxListHeight: h,
258
+ showSearch: p,
259
+ closeOnSelect: m,
260
+ lazyMount: u,
261
+ open: f,
262
+ positioning: b,
263
+ onOpenChange: S,
264
+ onFocusOutside: g,
265
+ contentTestId: Y,
266
+ portalled: L,
267
+ parentList: v
268
+ } = n, k = l === void 0 ? yt : l, $ = c === void 0 ? "260px" : c, H = h === void 0 ? "18rem" : h, V = p === void 0 ? !0 : p, j = m === void 0 ? !0 : m, F = u === void 0 ? !1 : u, Be = L === void 0 ? !0 : L, Z = !!v, [Te, We] = Ve(!1), [Re, ke] = Ve(""), [Ge, fe] = Ve("child"), D = Ue(null), q = f ?? Te, ne = Z && Ge === "parent", I = Pt(ne, v, {
269
+ items: o,
270
+ filterItems: k,
271
+ showSearch: V,
272
+ searchPlaceholder: i,
273
+ emptyState: s,
274
+ contentTestId: Y,
275
+ closeOnSelect: j,
276
+ listId: Z ? "child" : a ?? ""
277
+ }), xe = I.filterItems(I.items, Re), J = Ue(I.listId);
278
+ Ye(() => {
279
+ if (!q) {
280
+ J.current = I.listId;
281
+ return;
282
+ }
283
+ Mt(J.current, I.listId) && ke(""), J.current = I.listId;
284
+ }, [q, I.listId]);
285
+ let oe;
286
+ e[0] !== I.showSearch || e[1] !== q ? (oe = [q, I.showSearch], e[0] = I.showSearch, e[1] = q, e[2] = oe) : oe = e[2], Ye(() => {
287
+ if (!q || !I.showSearch)
288
+ return;
289
+ const w = setTimeout(() => D.current?.focus(), 0);
290
+ return () => clearTimeout(w);
291
+ }, oe);
292
+ let pe;
293
+ e[3] !== Z || e[4] !== S || e[5] !== f ? (pe = (w) => {
294
+ f === void 0 && We(w.open), ke(""), w.open && Z && fe("child"), S?.(w);
295
+ }, e[3] = Z, e[4] = S, e[5] = f, e[6] = pe) : pe = e[6];
296
+ const Oe = pe;
297
+ let Se;
298
+ e[7] !== ne || e[8] !== v ? (Se = (w) => {
299
+ if (!ne || !v)
300
+ return;
301
+ const ve = v.items.find((G) => G.id === w.value);
302
+ ve && (v.onSelect?.(ve), fe("child"));
303
+ }, e[7] = ne, e[8] = v, e[9] = Se) : Se = e[9];
304
+ const Ce = Se, $e = kt;
305
+ let le;
306
+ e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (le = (w) => ({
307
+ id: w.id,
308
+ label: w.label,
309
+ description: w.secondaryLabel,
310
+ icon: $e(w.icon),
311
+ disabled: w.isDisabled,
312
+ tooltip: w.tooltipLabel
313
+ }), e[10] = le) : le = e[10];
314
+ const re = le;
315
+ let ee;
316
+ e[11] !== v ? (ee = v ? /* @__PURE__ */ r(lt, { as: "div", role: "menuitem", "aria-label": v.ariaLabel, "aria-disabled": v.disabled || void 0, tabIndex: v.disabled ? -1 : 0, variant: "narrow", px: "0", borderBottomWidth: "1px", borderColor: "border.subtle", flexShrink: 0, onPointerDownCapture: Ot, onClickCapture: (w) => {
317
+ w.stopPropagation(), !v.disabled && fe(Dt);
318
+ }, children: /* @__PURE__ */ r(Fe, { asChild: !0, role: "presentation", variant: "full-width", id: "__parent-toggle", label: v.selectedLabel, icon: $e(v.selectedIcon), disabled: v.disabled, endContent: v.disabled ? void 0 : /* @__PURE__ */ r(Pe, { as: nt, boxSize: "14px" }) }) }) : null, e[11] = v, e[12] = ee) : ee = e[12];
319
+ const we = v ? ee : d, De = !!we && !I.showSearch, me = I.showSearch ? /* @__PURE__ */ r(wt, { inputRef: D, value: Re, placeholder: I.searchPlaceholder, onValueChange: ke }) : null, T = C, ie = C, M = "bg", Ie = "0", W = "0";
320
+ let se;
321
+ e[13] !== De ? (se = De ? /* @__PURE__ */ r(C.Separator, { margin: "0" }) : null, e[13] = De, e[14] = se) : se = e[14];
322
+ const B = ft;
323
+ let ae;
324
+ e[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ae = {
325
+ overscrollBehavior: "contain"
326
+ }, e[15] = ae) : ae = e[15];
327
+ const U = "0", y = "0", ce = xe.length > 0 ? xe.map((w) => /* @__PURE__ */ r(C.Item, { value: w.id, disabled: w.isDisabled, onClick: w.onSelect, asChild: !0, children: /* @__PURE__ */ r(z, { bg: "transparent", h: "auto", p: "0", _hover: {
328
+ bg: "transparent"
329
+ }, _focus: {
330
+ bg: "transparent"
331
+ }, _active: {
332
+ bg: "transparent"
333
+ }, children: /* @__PURE__ */ r(Fe, { asChild: !0, ...re(w), role: "presentation", variant: w.variant ?? "full-width", isSelected: w.isSelected }) }) }, w.id)) : I.emptyState;
334
+ let A;
335
+ e[16] !== B || e[17] !== I.contentTestId || e[18] !== H || e[19] !== ae || e[20] !== ce ? (A = /* @__PURE__ */ r(B, { maxH: H, "data-testid": I.contentTestId, viewportProps: ae, p: U, gap: y, children: ce }), e[16] = B, e[17] = I.contentTestId, e[18] = H, e[19] = ae, e[20] = ce, e[21] = A) : A = e[21];
336
+ let N;
337
+ e[22] !== we || e[23] !== me || e[24] !== ie.Content || e[25] !== se || e[26] !== A || e[27] !== $ ? (N = /* @__PURE__ */ P(ie.Content, { w: $, bg: M, gap: Ie, p: W, children: [
338
+ we,
339
+ me,
340
+ se,
341
+ A
342
+ ] }), e[22] = we, e[23] = me, e[24] = ie.Content, e[25] = se, e[26] = A, e[27] = $, e[28] = N) : N = e[28];
343
+ let K;
344
+ e[29] !== T.Positioner || e[30] !== N ? (K = /* @__PURE__ */ r(T.Positioner, { children: N }), e[29] = T.Positioner, e[30] = N, e[31] = K) : K = e[31];
345
+ const de = K, ge = Z ? Ce : void 0;
346
+ let Q;
347
+ e[32] !== t ? (Q = /* @__PURE__ */ r(C.Trigger, { asChild: !0, children: t }), e[32] = t, e[33] = Q) : Q = e[33];
348
+ const be = !Be;
349
+ let te;
350
+ e[34] !== de || e[35] !== be ? (te = /* @__PURE__ */ r(Ne, { disabled: be, children: de }), e[34] = de, e[35] = be, e[36] = te) : te = e[36];
351
+ let ye;
352
+ return e[37] !== I.closeOnSelect || e[38] !== Oe || e[39] !== F || e[40] !== g || e[41] !== f || e[42] !== b || e[43] !== ge || e[44] !== Q || e[45] !== te ? (ye = /* @__PURE__ */ P(C.Root, { lazyMount: F, closeOnSelect: I.closeOnSelect, open: f, positioning: b, onOpenChange: Oe, onFocusOutside: g, onSelect: ge, children: [
353
+ Q,
354
+ te
355
+ ] }), e[37] = I.closeOnSelect, e[38] = Oe, e[39] = F, e[40] = g, e[41] = f, e[42] = b, e[43] = ge, e[44] = Q, e[45] = te, e[46] = ye) : ye = e[46], ye;
356
+ };
357
+ function kt(n) {
358
+ return n ? /* @__PURE__ */ r(Pe, { as: n, boxSize: "14px" }) : void 0;
359
+ }
360
+ function Ot(n) {
361
+ return n.stopPropagation();
362
+ }
363
+ function Dt(n) {
364
+ return n === "child" ? "parent" : "child";
365
+ }
366
+ const Bt = (n) => {
367
+ const e = O(14), {
368
+ action: t
369
+ } = n;
370
+ let o;
371
+ e[0] !== t.menuItems ? (o = t.menuItems ?? [], e[0] = t.menuItems, e[1] = o) : o = e[1];
372
+ let i;
373
+ e[2] !== o ? (i = o.map(Tt), e[2] = o, e[3] = i) : i = e[3];
374
+ const s = i;
375
+ let l;
376
+ e[4] !== t.icon || e[5] !== t.label ? (l = /* @__PURE__ */ r(qe, { variant: "ghost", size: "2xs", "aria-label": t.label, children: t.icon }), e[4] = t.icon, e[5] = t.label, e[6] = l) : l = e[6];
377
+ const a = t.searchPlaceholder ?? "Search...", d = t.emptyMenuLabel ?? "No results found";
378
+ let c;
379
+ e[7] !== d ? (c = /* @__PURE__ */ r(C.Item, { value: "empty", asChild: !0, children: /* @__PURE__ */ r(Fe, { asChild: !0, variant: "full-width", label: d, disabled: !0 }) }), e[7] = d, e[8] = c) : c = e[8];
380
+ let h;
381
+ return e[9] !== s || e[10] !== l || e[11] !== a || e[12] !== c ? (h = /* @__PURE__ */ r(Rt, { trigger: l, items: s, searchPlaceholder: a, emptyState: c, onFocusOutside: Wt }), e[9] = s, e[10] = l, e[11] = a, e[12] = c, e[13] = h) : h = e[13], h;
382
+ };
383
+ function Tt(n) {
384
+ return {
385
+ id: n.id,
386
+ label: n.label,
387
+ searchText: [n.label, n.description].filter(Boolean).join(" "),
388
+ tooltipLabel: n.description,
389
+ variant: "full-width",
390
+ onSelect: () => n.onAction?.()
391
+ };
392
+ }
393
+ function Wt(n) {
394
+ return n.preventDefault();
395
+ }
396
+ const Ze = (n, e) => n.tooltip ? /* @__PURE__ */ r(Qe, { content: n.tooltip, openDelay: 300, children: e }, n.id) : /* @__PURE__ */ r(Ke, { children: e }, n.id), Lt = (n) => {
397
+ const e = O(11), {
398
+ actions: t,
399
+ alwaysVisible: o,
400
+ context: i
401
+ } = n, s = o === void 0 ? !1 : o;
402
+ if (t.length === 0)
403
+ return null;
404
+ const l = s ? "1" : "0", a = s ? "auto" : "none";
405
+ let d, c;
406
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = {
407
+ opacity: "1",
408
+ pointerEvents: "auto"
409
+ }, c = {
410
+ opacity: "1",
411
+ pointerEvents: "auto"
412
+ }, e[0] = d, e[1] = c) : (d = e[0], c = e[1]);
413
+ let h;
414
+ if (e[2] !== t || e[3] !== i) {
415
+ let m;
416
+ e[5] !== i ? (m = (u) => u.menuItems && u.menuItems.length >= 8 ? /* @__PURE__ */ r(Bt, { action: u }, u.id) : u.menuItems && u.menuItems.length > 0 ? Ze(u, /* @__PURE__ */ P(C.Root, { children: [
417
+ /* @__PURE__ */ r(C.Trigger, { asChild: !0, children: /* @__PURE__ */ r(qe, { variant: "ghost", size: "2xs", "aria-label": u.label, children: u.icon }) }),
418
+ /* @__PURE__ */ r(Ne, { children: /* @__PURE__ */ r(C.Positioner, { children: /* @__PURE__ */ r(C.Content, { minW: "160px", bg: "bg", children: u.menuItems.map(Ht) }) }) })
419
+ ] })) : Ze(u, /* @__PURE__ */ r(qe, { variant: "ghost", size: "2xs", "aria-label": u.label, onClick: (f) => {
420
+ f.stopPropagation(), u.onAction?.(i);
421
+ }, children: u.icon })), e[5] = i, e[6] = m) : m = e[6], h = t.map(m), e[2] = t, e[3] = i, e[4] = h;
422
+ } else
423
+ h = e[4];
424
+ let p;
425
+ return e[7] !== l || e[8] !== a || e[9] !== h ? (p = /* @__PURE__ */ r(he, { gap: "0", opacity: l, pointerEvents: a, _groupHover: d, _groupFocusWithin: c, transition: "opacity 120ms ease", onClick: $t, children: h }), e[7] = l, e[8] = a, e[9] = h, e[10] = p) : p = e[10], p;
426
+ };
427
+ function $t(n) {
428
+ return n.stopPropagation();
429
+ }
430
+ function Ht(n) {
431
+ return /* @__PURE__ */ P(Ke, { children: [
432
+ n.separatorBefore ? /* @__PURE__ */ r(C.Separator, {}) : null,
433
+ /* @__PURE__ */ r(Qe, { content: n.description, disabled: !n.description, openDelay: 300, children: /* @__PURE__ */ r(C.Item, { value: n.id, disabled: n.disabled || n.readOnly, onClick: () => {
434
+ n.readOnly || n.onAction?.();
435
+ }, children: /* @__PURE__ */ P(he, { gap: "2", minW: "0", w: "full", justify: "space-between", children: [
436
+ /* @__PURE__ */ P(he, { gap: "2", minW: "0", children: [
437
+ n.icon ? /* @__PURE__ */ r(z, { children: n.icon }) : null,
438
+ /* @__PURE__ */ r(z, { minW: "0", children: n.label })
439
+ ] }),
440
+ n.endContent ? /* @__PURE__ */ r(z, { flexShrink: 0, children: n.endContent }) : null
441
+ ] }) }) })
442
+ ] }, n.id);
443
+ }
444
+ const At = (n, e = !0) => {
445
+ const t = n.contextMenuItems ?? [];
446
+ if (t.length === 0 || !e) return n.actions ?? [];
447
+ const o = n.actions?.flatMap((l) => l.menuItems?.length ? l.menuItems : [{
448
+ id: l.id,
449
+ label: l.label,
450
+ icon: l.icon,
451
+ onAction: () => l.onAction?.({
452
+ nodeId: n.id
453
+ })
454
+ }]) ?? [], i = new Set(o.map((l) => l.id)), s = t.filter((l) => !i.has(l.id)).map((l, a) => ({
455
+ ...l,
456
+ separatorBefore: l.separatorBefore || a === 0 && o.length > 0
457
+ }));
458
+ return [{
459
+ id: "resource-actions",
460
+ label: "Resource actions",
461
+ icon: /* @__PURE__ */ r(Pe, { as: nt, boxSize: "14px" }),
462
+ menuItems: [...o, ...s]
463
+ }];
464
+ }, Et = (n) => n.isEmptyStateVariant ? "fg.menu-item.secondary" : n.isDisabled ? "fg.muted" : n.tone === "danger" ? "red.500" : "fg", _t = (n) => {
465
+ const e = O(7), {
466
+ label: t,
467
+ textStyle: o,
468
+ color: i
469
+ } = n;
470
+ if (typeof t == "string") {
471
+ let l;
472
+ return e[0] !== i || e[1] !== t || e[2] !== o ? (l = /* @__PURE__ */ r(je, { textStyle: o, color: i, truncate: !0, children: t }), e[0] = i, e[1] = t, e[2] = o, e[3] = l) : l = e[3], l;
473
+ }
474
+ let s;
475
+ return e[4] !== i || e[5] !== t ? (s = /* @__PURE__ */ r(z, { minW: "0", maxW: "full", overflow: "hidden", color: i, children: t }), e[4] = i, e[5] = t, e[6] = s) : s = e[6], s;
476
+ }, zt = (n) => {
477
+ const e = O(8), {
478
+ description: t,
479
+ textStyle: o,
480
+ color: i,
481
+ marginLeft: s
482
+ } = n;
483
+ if (!t)
484
+ return null;
485
+ if (typeof t == "string") {
486
+ let a;
487
+ return e[0] !== i || e[1] !== t || e[2] !== s || e[3] !== o ? (a = /* @__PURE__ */ r(je, { ml: s, textStyle: o, color: i, truncate: !0, children: t }), e[0] = i, e[1] = t, e[2] = s, e[3] = o, e[4] = a) : a = e[4], a;
488
+ }
489
+ let l;
490
+ return e[5] !== t || e[6] !== s ? (l = /* @__PURE__ */ r(z, { ml: s, minW: "0", maxW: "full", overflow: "hidden", children: t }), e[5] = t, e[6] = s, e[7] = l) : l = e[7], l;
491
+ }, Vt = (n) => {
492
+ const e = O(33), {
493
+ item: t,
494
+ isExpanded: o,
495
+ showChevron: i,
496
+ isDisabled: s,
497
+ variant: l,
498
+ tone: a
499
+ } = n, d = l === "empty-state", c = l === "compact" || l === "collection" || l === "full-width" || l === "tree" || d, h = c ? "label/S/regular" : "label/M/regular", p = c ? "label/XS" : "label/S/regular", m = c ? "0" : "2px", u = l === "tree" || l === "collection" ? "16px" : "14px", f = l === "collection" ? "compact" : l === "tree" ? "1" : "2";
500
+ let b;
501
+ e[0] !== s || e[1] !== d || e[2] !== a ? (b = Et({
502
+ isEmptyStateVariant: d,
503
+ isDisabled: s,
504
+ tone: a
505
+ }), e[0] = s, e[1] = d, e[2] = a, e[3] = b) : b = e[3];
506
+ const S = b, g = t.iconColor ?? (a === "danger" ? "red.500" : "fg.muted"), Y = a === "danger" ? "red.400" : "fg.menu-item.secondary";
507
+ let L;
508
+ e[4] !== o || e[5] !== i ? (L = i ? /* @__PURE__ */ r(z, { color: "fg.muted", flexShrink: 0, display: "flex", alignItems: "center", children: /* @__PURE__ */ r(Pe, { as: ht, boxSize: "12px", transform: o ? "rotate(90deg)" : "rotate(0deg)", transition: "transform 120ms ease" }) }) : null, e[4] = o, e[5] = i, e[6] = L) : L = e[6];
509
+ let v;
510
+ e[7] !== g || e[8] !== u || e[9] !== t.icon ? (v = t.icon ? /* @__PURE__ */ r(z, { color: g, flexShrink: 0, display: "inline-flex", alignItems: "center", justifyContent: "center", boxSize: u, fontSize: u, lineHeight: "1", css: {
511
+ "& > svg": {
512
+ width: u,
513
+ height: u
514
+ }
515
+ }, children: t.icon }) : null, e[7] = g, e[8] = u, e[9] = t.icon, e[10] = v) : v = e[10];
516
+ let k;
517
+ e[11] !== t.indicator ? (k = t.indicator ? /* @__PURE__ */ r(Qe, { content: t.indicator.tooltip, disabled: !t.indicator.tooltip, openDelay: 300, children: /* @__PURE__ */ r(z, { color: t.indicator.color ?? "fg.muted", flexShrink: 0, children: t.indicator.icon }) }) : null, e[11] = t.indicator, e[12] = k) : k = e[12];
518
+ let $;
519
+ e[13] !== t.label || e[14] !== S || e[15] !== h ? ($ = /* @__PURE__ */ r(_t, { label: t.label, textStyle: h, color: S }), e[13] = t.label, e[14] = S, e[15] = h, e[16] = $) : $ = e[16];
520
+ let H;
521
+ e[17] !== f || e[18] !== v || e[19] !== k || e[20] !== $ ? (H = /* @__PURE__ */ P(he, { gap: f, minW: "0", alignItems: "center", children: [
522
+ v,
523
+ k,
524
+ $
525
+ ] }), e[17] = f, e[18] = v, e[19] = k, e[20] = $, e[21] = H) : H = e[21];
526
+ let V;
527
+ e[22] !== Y || e[23] !== m || e[24] !== p || e[25] !== t.description ? (V = /* @__PURE__ */ r(zt, { description: t.description, textStyle: p, color: Y, marginLeft: m }), e[22] = Y, e[23] = m, e[24] = p, e[25] = t.description, e[26] = V) : V = e[26];
528
+ let j;
529
+ e[27] !== H || e[28] !== V ? (j = /* @__PURE__ */ P(tt, { gap: "0", minW: "0", flex: "1", children: [
530
+ H,
531
+ V
532
+ ] }), e[27] = H, e[28] = V, e[29] = j) : j = e[29];
533
+ let F;
534
+ return e[30] !== L || e[31] !== j ? (F = /* @__PURE__ */ P(he, { gap: "2", minW: "0", flex: "1", overflow: "hidden", alignItems: "center", children: [
535
+ L,
536
+ j
537
+ ] }), e[30] = L, e[31] = j, e[32] = F) : F = e[32], F;
538
+ }, jt = (n) => {
539
+ const e = O(21), {
540
+ item: t,
541
+ isDisabled: o,
542
+ isExpanded: i,
543
+ showChevron: s,
544
+ tone: l,
545
+ variant: a,
546
+ showContextMenuTrigger: d
547
+ } = n, c = l === void 0 ? "default" : l, h = a === void 0 ? "default" : a;
548
+ let p;
549
+ e[0] !== t || e[1] !== d ? (p = At(t, d), e[0] = t, e[1] = d, e[2] = p) : p = e[2];
550
+ const m = p;
551
+ let u;
552
+ e[3] !== o || e[4] !== i || e[5] !== t || e[6] !== s || e[7] !== c || e[8] !== h ? (u = /* @__PURE__ */ r(Vt, { item: t, isExpanded: i, showChevron: s, isDisabled: o, tone: c, variant: h }), e[3] = o, e[4] = i, e[5] = t, e[6] = s, e[7] = c, e[8] = h, e[9] = u) : u = e[9];
553
+ let f;
554
+ e[10] !== t.endContent ? (f = t.endContent ? /* @__PURE__ */ r(z, { flexShrink: 0, color: "fg.muted", display: "flex", alignItems: "center", children: t.endContent }) : null, e[10] = t.endContent, e[11] = f) : f = e[11];
555
+ let b;
556
+ e[12] !== m || e[13] !== t.contextMenuItems?.length || e[14] !== t.id || e[15] !== d ? (b = m.length > 0 ? /* @__PURE__ */ r(Lt, { actions: m, context: {
557
+ nodeId: t.id
558
+ }, alwaysVisible: d && (t.contextMenuItems?.length ?? 0) > 0 }) : null, e[12] = m, e[13] = t.contextMenuItems?.length, e[14] = t.id, e[15] = d, e[16] = b) : b = e[16];
559
+ let S;
560
+ return e[17] !== u || e[18] !== f || e[19] !== b ? (S = /* @__PURE__ */ P(et, { children: [
561
+ u,
562
+ f,
563
+ b
564
+ ] }), e[17] = u, e[18] = f, e[19] = b, e[20] = S) : S = e[20], S;
565
+ }, Ft = (n) => {
566
+ if (!(n <= 0))
567
+ return `calc(var(--chakra-spacing-1) + ${n} * 12px)`;
568
+ }, Nt = (n) => n === "compact" || n === "full-width" || n === "empty-state", Kt = (n, e) => n === "collection" && !e ? {
569
+ rowHeight: "collection-row",
570
+ minHeight: void 0
571
+ } : Nt(n) && !e ? {
572
+ rowHeight: "1.75rem",
573
+ minHeight: void 0
574
+ } : {
575
+ rowHeight: "auto",
576
+ minHeight: n === "default" ? "2.25rem" : "1.75rem"
577
+ }, Qt = (n) => ({
578
+ bg: n.isSelected ? n.selectedBg : "transparent",
579
+ _hover: n.variant === "empty-state" ? {
580
+ bg: "transparent"
581
+ } : n.isSelected ? {
582
+ bg: n.selectedBg
583
+ } : n.tone === "danger" ? {
584
+ outline: "1px solid",
585
+ outlineColor: "red.500",
586
+ outlineOffset: "-1px"
587
+ } : {
588
+ bg: n.hoverBg
589
+ },
590
+ _active: n.variant === "empty-state" ? {
591
+ bg: "transparent"
592
+ } : {
593
+ bg: n.selectedBg
594
+ }
595
+ }), Gt = (n) => ({
596
+ ...n.rootProps,
597
+ role: n.rowRole,
598
+ "aria-selected": n.rootProps["aria-selected"] ?? (n.rowRole === "option" ? n.isSelected : void 0),
599
+ "aria-expanded": n.showChevron ? n.isExpanded : void 0,
600
+ className: n.className ? `group ${n.className}` : "group",
601
+ width: "full",
602
+ minWidth: "0",
603
+ maxWidth: "full",
604
+ height: n.rowHeight,
605
+ minHeight: n.minHeight,
606
+ display: "flex",
607
+ alignItems: "center",
608
+ justifyContent: "space-between",
609
+ gap: "xs",
610
+ px: "sm",
611
+ py: n.verticalPadding,
612
+ pl: n.paddingLeft,
613
+ borderRadius: n.variant === "full-width" || n.variant === "collection" ? "0" : "xs",
614
+ ...Qt({
615
+ ...n
616
+ }),
617
+ cursor: n.variant === "empty-state" ? "default" : n.isDisabled ? "not-allowed" : "pointer",
618
+ overflow: "hidden",
619
+ textAlign: "left",
620
+ color: "inherit",
621
+ textDecoration: "none"
622
+ }), Fe = dt((n, e) => {
623
+ const t = O(108), {
624
+ id: o,
625
+ label: i,
626
+ description: s,
627
+ icon: l,
628
+ iconColor: a,
629
+ indicator: d,
630
+ endContent: c,
631
+ tooltip: h,
632
+ disabled: p,
633
+ isContainer: m,
634
+ isNavigable: u,
635
+ href: f,
636
+ navigationIntent: b,
637
+ menuItems: S,
638
+ menuPlacement: g,
639
+ contextMenuItems: Y,
640
+ actions: L,
641
+ children: v,
642
+ onActivate: k,
643
+ depth: $,
644
+ isSelected: H,
645
+ isExpanded: V,
646
+ showExpandToggle: j,
647
+ showContextMenuTrigger: F,
648
+ variant: Be,
649
+ tone: Z,
650
+ selectedBg: Te,
651
+ hoverBg: We,
652
+ asChild: Re,
653
+ className: ke,
654
+ role: Ge,
655
+ onToggleExpand: fe,
656
+ onPointerMove: D,
657
+ draggable: q,
658
+ onDragStart: ne,
659
+ onDragOver: Le,
660
+ onDragEnd: I,
661
+ onDrop: xe,
662
+ onClick: J,
663
+ onKeyDown: oe,
664
+ ...pe
665
+ } = n, Oe = $ === void 0 ? 0 : $, Se = H === void 0 ? !1 : H, Ce = V === void 0 ? !1 : V, $e = j === void 0 ? !1 : j, le = F === void 0 ? !0 : F, re = Be === void 0 ? "default" : Be, ee = Z === void 0 ? "default" : Z, Je = Te === void 0 ? "bg.active" : Te, we = We === void 0 ? "bg.hover" : We, De = Re === void 0 ? !1 : Re, [me, T] = Ve(!1);
666
+ let ie;
667
+ t[0] !== L || t[1] !== v || t[2] !== Y || t[3] !== s || t[4] !== p || t[5] !== c || t[6] !== f || t[7] !== l || t[8] !== a || t[9] !== o || t[10] !== d || t[11] !== m || t[12] !== u || t[13] !== i || t[14] !== S || t[15] !== g || t[16] !== b || t[17] !== k || t[18] !== h ? (ie = {
668
+ id: o,
669
+ label: i,
670
+ description: s,
671
+ icon: l,
672
+ iconColor: a,
673
+ indicator: d,
674
+ endContent: c,
675
+ tooltip: h,
676
+ disabled: p,
677
+ isContainer: m,
678
+ isNavigable: u,
679
+ href: f,
680
+ navigationIntent: b,
681
+ menuItems: S,
682
+ menuPlacement: g,
683
+ contextMenuItems: Y,
684
+ actions: L,
685
+ children: v,
686
+ onActivate: k
687
+ }, t[0] = L, t[1] = v, t[2] = Y, t[3] = s, t[4] = p, t[5] = c, t[6] = f, t[7] = l, t[8] = a, t[9] = o, t[10] = d, t[11] = m, t[12] = u, t[13] = i, t[14] = S, t[15] = g, t[16] = b, t[17] = k, t[18] = h, t[19] = ie) : ie = t[19];
688
+ const M = ie;
689
+ let Ie;
690
+ t[20] !== q || t[21] !== I || t[22] !== Le || t[23] !== ne || t[24] !== xe ? (Ie = {
691
+ draggable: q,
692
+ onDragStart: ne,
693
+ onDragOver: Le,
694
+ onDragEnd: I,
695
+ onDrop: xe
696
+ }, t[20] = q, t[21] = I, t[22] = Le, t[23] = ne, t[24] = xe, t[25] = Ie) : Ie = t[25];
697
+ const W = Ie, se = (M.children?.length ?? 0) > 0 || M.isContainer === !0, B = (M.menuItems?.length ?? 0) > 0, ae = (M.actions?.length ?? 0) > 0 || (M.contextMenuItems?.length ?? 0) > 0, U = $e && se, y = M.disabled === !0;
698
+ let ce;
699
+ t[26] !== B || t[27] !== y || t[28] !== M || t[29] !== k || t[30] !== fe || t[31] !== U ? (ce = () => {
700
+ if (!y && !B) {
701
+ if (U) {
702
+ fe?.();
703
+ return;
704
+ }
705
+ if (k) {
706
+ k();
707
+ return;
708
+ }
709
+ M.onActivate?.();
710
+ }
711
+ }, t[26] = B, t[27] = y, t[28] = M, t[29] = k, t[30] = fe, t[31] = U, t[32] = ce) : ce = t[32];
712
+ const A = ce;
713
+ let N;
714
+ t[33] !== A || t[34] !== y || t[35] !== J ? (N = (x) => {
715
+ if (J?.(x), !x.defaultPrevented) {
716
+ if (y) {
717
+ x.preventDefault();
718
+ return;
719
+ }
720
+ A();
721
+ }
722
+ }, t[33] = A, t[34] = y, t[35] = J, t[36] = N) : N = t[36];
723
+ const K = N;
724
+ let de;
725
+ t[37] !== y || t[38] !== J || t[39] !== T ? (de = (x) => {
726
+ if (J?.(x), !x.defaultPrevented) {
727
+ if (y) {
728
+ x.preventDefault();
729
+ return;
730
+ }
731
+ T(Xt);
732
+ }
733
+ }, t[37] = y, t[38] = J, t[39] = T, t[40] = de) : de = t[40];
734
+ const ge = de;
735
+ let Q;
736
+ t[41] !== A || t[42] !== B || t[43] !== y || t[44] !== oe || t[45] !== T ? (Q = (x) => {
737
+ if (oe?.(x), !x.defaultPrevented && !(x.key !== "Enter" && x.key !== " ") && (x.preventDefault(), !y)) {
738
+ if (B) {
739
+ T(qt);
740
+ return;
741
+ }
742
+ A();
743
+ }
744
+ }, t[41] = A, t[42] = B, t[43] = y, t[44] = oe, t[45] = T, t[46] = Q) : Q = t[46];
745
+ const be = Q, te = M.description !== void 0, ye = Ft(Oe), w = re === "default" || te ? "xs" : "2xs";
746
+ let ve;
747
+ t[47] !== K || t[48] !== ge || t[49] !== B ? (ve = B ? {
748
+ onClick: ge
749
+ } : {
750
+ onClick: K
751
+ }, t[47] = K, t[48] = ge, t[49] = B, t[50] = ve) : ve = t[50];
752
+ const G = ve, {
753
+ rowHeight: rt,
754
+ minHeight: it
755
+ } = Kt(re, te), ue = Gt({
756
+ rootProps: pe,
757
+ rowRole: Ge ?? (B ? "button" : "option"),
758
+ className: ke,
759
+ isSelected: Se,
760
+ isExpanded: Ce,
761
+ showChevron: U,
762
+ rowHeight: rt,
763
+ minHeight: it,
764
+ verticalPadding: w,
765
+ paddingLeft: ye,
766
+ selectedBg: Je,
767
+ hoverBg: we,
768
+ tone: ee,
769
+ isDisabled: y,
770
+ variant: re
771
+ });
772
+ let He;
773
+ t[51] !== y || t[52] !== Ce || t[53] !== M || t[54] !== U || t[55] !== le || t[56] !== ee || t[57] !== re ? (He = /* @__PURE__ */ r(jt, { item: M, isExpanded: Ce, showChevron: U, isDisabled: y, tone: ee, variant: re, showContextMenuTrigger: le }), t[51] = y, t[52] = Ce, t[53] = M, t[54] = U, t[55] = le, t[56] = ee, t[57] = re, t[58] = He) : He = t[58];
774
+ const E = He;
775
+ let Ae;
776
+ t[59] !== M || t[60] !== me || t[61] !== T ? (Ae = (x) => /* @__PURE__ */ r(xt, { item: M, menuOpen: me, onMenuOpenChange: T, onMenuSelect: (R) => {
777
+ T(!1), R.onAction?.();
778
+ }, children: x }), t[59] = M, t[60] = me, t[61] = T, t[62] = Ae) : Ae = t[62];
779
+ const _ = Ae;
780
+ if (De) {
781
+ let x;
782
+ t[63] !== G || t[64] !== E || t[65] !== W || t[66] !== D || t[67] !== e || t[68] !== ue ? (x = /* @__PURE__ */ r(ze.div, { ref: e, ...ue, ...W, ...G, onPointerMove: D, children: E }), t[63] = G, t[64] = E, t[65] = W, t[66] = D, t[67] = e, t[68] = ue, t[69] = x) : x = t[69];
783
+ let R;
784
+ return t[70] !== x || t[71] !== _ ? (R = _(x), t[70] = x, t[71] = _, t[72] = R) : R = t[72], R;
785
+ }
786
+ if (M.href && !U && !y && !B) {
787
+ const x = ue;
788
+ let R;
789
+ t[73] !== E || t[74] !== W || t[75] !== K || t[76] !== M.href || t[77] !== D || t[78] !== e || t[79] !== x ? (R = /* @__PURE__ */ r(ze.a, { ref: e, href: M.href, ...x, ...W, onClick: K, onPointerMove: D, children: E }), t[73] = E, t[74] = W, t[75] = K, t[76] = M.href, t[77] = D, t[78] = e, t[79] = x, t[80] = R) : R = t[80];
790
+ let X;
791
+ return t[81] !== R || t[82] !== _ ? (X = _(R), t[81] = R, t[82] = _, t[83] = X) : X = t[83], X;
792
+ }
793
+ if (ae) {
794
+ const x = y || void 0, R = pe.tabIndex ?? 0;
795
+ let X;
796
+ t[84] !== G || t[85] !== E || t[86] !== W || t[87] !== be || t[88] !== D || t[89] !== e || t[90] !== ue || t[91] !== x || t[92] !== R ? (X = /* @__PURE__ */ r(ze.div, { ref: e, "aria-disabled": x, ...ue, ...W, ...G, tabIndex: R, onKeyDown: be, onPointerMove: D, children: E }), t[84] = G, t[85] = E, t[86] = W, t[87] = be, t[88] = D, t[89] = e, t[90] = ue, t[91] = x, t[92] = R, t[93] = X) : X = t[93];
797
+ let _e;
798
+ return t[94] !== X || t[95] !== _ ? (_e = _(X), t[94] = X, t[95] = _, t[96] = _e) : _e = t[96], _e;
799
+ }
800
+ const Xe = ue;
801
+ let Me;
802
+ t[97] !== G || t[98] !== E || t[99] !== W || t[100] !== y || t[101] !== D || t[102] !== e || t[103] !== Xe ? (Me = /* @__PURE__ */ r(ze.button, { ref: e, type: "button", disabled: y, ...Xe, ...W, ...G, onPointerMove: D, children: E }), t[97] = G, t[98] = E, t[99] = W, t[100] = y, t[101] = D, t[102] = e, t[103] = Xe, t[104] = Me) : Me = t[104];
803
+ let Ee;
804
+ return t[105] !== Me || t[106] !== _ ? (Ee = _(Me), t[105] = Me, t[106] = _, t[107] = Ee) : Ee = t[107], Ee;
805
+ });
806
+ function Xt(n) {
807
+ return !n;
808
+ }
809
+ function qt(n) {
810
+ return !n;
811
+ }
812
+ export {
813
+ lt as H,
814
+ Fe as L,
815
+ pt as R,
816
+ Bt as S,
817
+ wt as a,
818
+ Rt as b,
819
+ on as c
820
+ };
821
+ //# sourceMappingURL=list-row-BtoVJpFs.js.map