@bfrs/agentic-components 0.8.3 → 0.8.5

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.
@@ -1,50 +1,48 @@
1
- import { jsxs as c, jsx as t, Fragment as Ie } from "react/jsx-runtime";
2
- import { Root as De, Portal as Ve, Overlay as It, Content as Dt, Title as Vt, Description as Wt } from "../../../node_modules/@radix-ui/react-dialog/dist/index.js";
3
- import { Root as Bt, Trigger as Ot, Portal as Ht, Content as Lt } from "../../../node_modules/@radix-ui/react-popover/dist/index.js";
4
- import { BookmarkSimple as Et } from "../../../node_modules/@phosphor-icons/react/dist/csr/BookmarkSimple.es.js";
5
- import { CaretDown as Pt } from "../../../node_modules/@phosphor-icons/react/dist/csr/CaretDown.es.js";
6
- import { DotsThreeVertical as We } from "../../../node_modules/@phosphor-icons/react/dist/csr/DotsThreeVertical.es.js";
7
- import { Info as Ft } from "../../../node_modules/@phosphor-icons/react/dist/csr/Info.es.js";
8
- import { PencilSimple as jt } from "../../../node_modules/@phosphor-icons/react/dist/csr/PencilSimple.es.js";
9
- import { Star as M } from "../../../node_modules/@phosphor-icons/react/dist/csr/Star.es.js";
10
- import { Trash as Nt } from "../../../node_modules/@phosphor-icons/react/dist/csr/Trash.es.js";
11
- import { useRef as A, useMemo as le, useState as p, useId as $t, useEffect as $, useCallback as K } from "react";
1
+ import { jsxs as c, jsx as t, Fragment as We } from "react/jsx-runtime";
2
+ import { Root as Pe, Portal as Be, Overlay as Wt, Content as Pt, Title as Bt, Description as Lt } from "../../../node_modules/@radix-ui/react-dialog/dist/index.js";
3
+ import { Root as Ot, Trigger as Ht, Portal as Et, Content as Ft } from "../../../node_modules/@radix-ui/react-popover/dist/index.js";
4
+ import { BookmarkSimple as jt } from "../../../node_modules/@phosphor-icons/react/dist/csr/BookmarkSimple.es.js";
5
+ import { CaretDown as Nt } from "../../../node_modules/@phosphor-icons/react/dist/csr/CaretDown.es.js";
6
+ import { DotsThreeVertical as Le } from "../../../node_modules/@phosphor-icons/react/dist/csr/DotsThreeVertical.es.js";
7
+ import { Info as Kt } from "../../../node_modules/@phosphor-icons/react/dist/csr/Info.es.js";
8
+ import { PencilSimple as Mt } from "../../../node_modules/@phosphor-icons/react/dist/csr/PencilSimple.es.js";
9
+ import { Star as q } from "../../../node_modules/@phosphor-icons/react/dist/csr/Star.es.js";
10
+ import { Trash as $t } from "../../../node_modules/@phosphor-icons/react/dist/csr/Trash.es.js";
11
+ import { useRef as y, useMemo as se, useState as m, useId as qt, useEffect as M, useCallback as $ } from "react";
12
12
  import i from "@emotion/styled";
13
- import { IconButton as Be, Button as q } from "../../primitives/Button/Button.js";
14
- import { twRing as ue, twTransform as Me, kfContentIn as Kt, kfOverlayIn as Mt, kfModalContentIn as qt } from "../../../lib/emotionTw.js";
15
- import { floatingCollisionPadding as Yt } from "../../ui/overlays/overlayPositioning.js";
16
- import { createTableViewSelectorStore as Gt, isReservedViewName as Oe } from "./viewStore.js";
17
- import { BfrsPortalScope as ce } from "../../ui/providers/BfrsProvider/BfrsProvider.js";
18
- import { Tooltip as Jt } from "../../ui/overlays/Tooltip/Tooltip.js";
19
- import { ActionMenu as He } from "../../navigation/ActionMenu/ActionMenu.js";
13
+ import { IconButton as Oe, Button as Y } from "../../primitives/Button/Button.js";
14
+ import { twRing as fe, twTransform as Ge, kfContentIn as Yt, kfOverlayIn as Gt, kfModalContentIn as Jt } from "../../../lib/emotionTw.js";
15
+ import { floatingCollisionPadding as Qt } from "../../ui/overlays/overlayPositioning.js";
16
+ import { createTableViewSelectorStore as Xt, isReservedViewName as He } from "./viewStore.js";
17
+ import { BfrsPortalScope as de } from "../../ui/providers/BfrsProvider/BfrsProvider.js";
18
+ import { Tooltip as Zt } from "../../ui/overlays/Tooltip/Tooltip.js";
19
+ import { ActionMenu as Ee } from "../../navigation/ActionMenu/ActionMenu.js";
20
20
  const D = {
21
21
  "--tw-text-opacity": "1",
22
22
  color: "hsl(var(--bfrs-color-text-primary) / var(--tw-text-opacity, 1))"
23
- }, V = {
23
+ }, W = {
24
24
  "--tw-text-opacity": "1",
25
25
  color: "hsl(var(--bfrs-color-text-muted) / var(--tw-text-opacity, 1))"
26
- }, me = {
26
+ }, pe = {
27
27
  "--tw-bg-opacity": "1",
28
28
  backgroundColor: "hsl(var(--bfrs-color-surface-card) / var(--tw-bg-opacity, 1))"
29
- }, de = {
29
+ }, me = {
30
30
  "--tw-bg-opacity": "1",
31
31
  backgroundColor: "hsl(var(--bfrs-color-primary-soft) / var(--tw-bg-opacity, 1))"
32
- }, Qt = {
33
- backgroundColor: "var(--bfrs-sidenav-row-active-hover-bg, var(--bfrs-dcl-color-accent-light))"
34
- }, Xt = {
32
+ }, Ut = {
35
33
  backgroundColor: "#F6F9F6"
36
- }, fe = {
34
+ }, he = {
37
35
  "--tw-border-opacity": "1",
38
36
  borderColor: "hsl(var(--bfrs-color-border) / var(--tw-border-opacity, 1))"
39
- }, Zt = /* @__PURE__ */ i("div", {
37
+ }, er = /* @__PURE__ */ i("div", {
40
38
  label: "AgenticTableViewSelector-root"
41
39
  })({
42
40
  display: "inline-flex",
43
41
  minWidth: "0px"
44
- }), Ut = /* @__PURE__ */ i("button", {
42
+ }), tr = /* @__PURE__ */ i("button", {
45
43
  label: "AgenticTableViewSelector-trigger",
46
- shouldForwardProp: (o) => o !== "ownerState"
47
- })(({ ownerState: o }) => [
44
+ shouldForwardProp: (n) => n !== "ownerState"
45
+ })(({ ownerState: n }) => [
48
46
  {
49
47
  display: "inline-flex",
50
48
  minWidth: "0px",
@@ -54,7 +52,7 @@ const D = {
54
52
  gap: ".5rem",
55
53
  borderRadius: "7px",
56
54
  borderWidth: "1px",
57
- ...Xt,
55
+ ...Ut,
58
56
  paddingLeft: ".75rem",
59
57
  paddingRight: ".75rem",
60
58
  fontSize: "12px",
@@ -66,14 +64,14 @@ const D = {
66
64
  transitionProperty: "color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",
67
65
  transitionTimingFunction: "cubic-bezier(0,0,.2,1)",
68
66
  transitionDuration: ".15s",
69
- "&:hover": de,
70
- "&:focus-visible": ue("2px", "hsl(var(--bfrs-color-border-focus) / .25)"),
67
+ "&:hover": me,
68
+ "&:focus-visible": fe("2px", "hsl(var(--bfrs-color-border-focus) / .25)"),
71
69
  "&:disabled": {
72
70
  pointerEvents: "none",
73
71
  opacity: ".55"
74
72
  }
75
73
  },
76
- o.size === "sm" ? { height: "1.75rem" } : { height: "2.25rem" },
74
+ n.size === "sm" ? { height: "1.75rem" } : { height: "2.25rem" },
77
75
  // Stays highlighted once a view is selected, not just while the popover is
78
76
  // open — matches the data-filled convention every other Select-like
79
77
  // trigger in the library already follows (Select, MultiSelect,
@@ -81,14 +79,14 @@ const D = {
81
79
  // "Default" is a real selection, not an empty trigger, so it carries the same
82
80
  // emphasized border as a named view. border-focus is the ink colour (#29343D
83
81
  // in light) and flips light in dark mode — a literal black would not.
84
- o.open || o.filled || o.defaultSelected ? {
82
+ n.open || n.filled || n.defaultSelected ? {
85
83
  "--tw-border-opacity": "1",
86
84
  borderColor: "hsl(var(--bfrs-color-border-focus) / var(--tw-border-opacity, 1))"
87
- } : fe,
85
+ } : he,
88
86
  // Default is a selected, built-in view. It must use the same primary text
89
87
  // colour as a selected saved view; only a genuinely empty trigger is muted.
90
- o.empty && !o.defaultSelected && V
91
- ]), er = /* @__PURE__ */ i("span", {
88
+ n.empty && !n.defaultSelected && W
89
+ ]), rr = /* @__PURE__ */ i("span", {
92
90
  label: "AgenticTableViewSelector-triggerLabel"
93
91
  })({
94
92
  minWidth: "0px",
@@ -96,25 +94,25 @@ const D = {
96
94
  overflow: "hidden",
97
95
  textOverflow: "ellipsis",
98
96
  whiteSpace: "nowrap"
99
- }), se = /* @__PURE__ */ i(M, {
97
+ }), ue = /* @__PURE__ */ i(q, {
100
98
  label: "AgenticTableViewSelector-primaryStar"
101
99
  })({
102
100
  flexShrink: 0,
103
101
  "--tw-text-opacity": "1",
104
102
  color: "hsl(var(--bfrs-color-warning) / var(--tw-text-opacity, 1))"
105
- }), tr = /* @__PURE__ */ i(Pt, {
103
+ }), nr = /* @__PURE__ */ i(Nt, {
106
104
  label: "AgenticTableViewSelector-caret",
107
- shouldForwardProp: (o) => o !== "ownerState"
108
- })(({ ownerState: o }) => [
105
+ shouldForwardProp: (n) => n !== "ownerState"
106
+ })(({ ownerState: n }) => [
109
107
  {
110
108
  flexShrink: 0,
111
- ...V,
109
+ ...W,
112
110
  transitionProperty: "transform",
113
111
  transitionTimingFunction: "cubic-bezier(.4,0,.2,1)",
114
112
  transitionDuration: ".15s"
115
113
  },
116
- o.open && Me({ "--tw-rotate": "180deg" })
117
- ]), rr = /* @__PURE__ */ i(Lt, {
114
+ n.open && Ge({ "--tw-rotate": "180deg" })
115
+ ]), ir = /* @__PURE__ */ i(Ft, {
118
116
  label: "AgenticTableViewSelector-content"
119
117
  })({
120
118
  zIndex: 1e3,
@@ -122,14 +120,14 @@ const D = {
122
120
  overflow: "hidden",
123
121
  borderRadius: "var(--bfrs-radius-lg)",
124
122
  borderWidth: "1px",
125
- ...fe,
126
- ...me,
123
+ ...he,
124
+ ...pe,
127
125
  "--tw-shadow": "var(--bfrs-shadow-elevated)",
128
126
  "--tw-shadow-colored": "var(--bfrs-shadow-elevated)",
129
127
  boxShadow: "var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)",
130
128
  outline: "2px solid transparent",
131
129
  outlineOffset: "2px",
132
- ...Kt,
130
+ ...Yt,
133
131
  animation: "bfrs-bfrs-content-in var(--bfrs-motion-normal) var(--bfrs-ease-out)"
134
132
  }), or = /* @__PURE__ */ i("div", {
135
133
  label: "AgenticTableViewSelector-header"
@@ -146,8 +144,8 @@ const D = {
146
144
  fontWeight: 700,
147
145
  letterSpacing: ".08em",
148
146
  textTransform: "uppercase",
149
- ...V
150
- }), ir = /* @__PURE__ */ i("span", {
147
+ ...W
148
+ }), ar = /* @__PURE__ */ i("span", {
151
149
  label: "AgenticTableViewSelector-headerInfo"
152
150
  })({
153
151
  display: "inline-flex",
@@ -161,12 +159,12 @@ const D = {
161
159
  // either or it renders offset from the cap height.
162
160
  letterSpacing: "normal",
163
161
  cursor: "default",
164
- ...V,
162
+ ...W,
165
163
  "&:hover": {
166
164
  "--tw-text-opacity": "1",
167
165
  color: "hsl(var(--bfrs-color-text-primary) / var(--tw-text-opacity, 1))"
168
166
  }
169
- }), nr = /* @__PURE__ */ i("div", {
167
+ }), lr = /* @__PURE__ */ i("div", {
170
168
  label: "AgenticTableViewSelector-list"
171
169
  })({
172
170
  display: "flex",
@@ -174,7 +172,7 @@ const D = {
174
172
  flexDirection: "column",
175
173
  overflowY: "auto",
176
174
  paddingBottom: ".25rem"
177
- }), qe = /* @__PURE__ */ i("div", {
175
+ }), Je = /* @__PURE__ */ i("div", {
178
176
  label: "AgenticTableViewSelector-row"
179
177
  })({
180
178
  display: "flex",
@@ -183,17 +181,16 @@ const D = {
183
181
  gap: ".375rem",
184
182
  paddingLeft: ".5rem",
185
183
  paddingRight: ".625rem"
186
- }), ar = /* @__PURE__ */ i(qe, {
184
+ }), cr = /* @__PURE__ */ i(Je, {
187
185
  label: "AgenticTableViewSelector-defaultRow"
188
186
  })({
189
187
  marginLeft: ".5rem",
190
188
  marginRight: ".5rem",
191
189
  marginBottom: ".25rem",
192
190
  borderRadius: "var(--bfrs-radius-sm)",
193
- backgroundColor: "hsl(var(--bfrs-color-primary-soft) / .55)",
194
191
  paddingLeft: ".125rem",
195
192
  paddingRight: ".125rem"
196
- }), lr = /* @__PURE__ */ i("div", {
193
+ }), sr = /* @__PURE__ */ i("div", {
197
194
  label: "AgenticTableViewSelector-defaultDivider"
198
195
  })({
199
196
  height: "1px",
@@ -203,10 +200,13 @@ const D = {
203
200
  marginBottom: ".25rem",
204
201
  "--tw-bg-opacity": "1",
205
202
  backgroundColor: "hsl(var(--bfrs-color-border-strong) / var(--tw-bg-opacity, 1))"
206
- }), Le = /* @__PURE__ */ i("button", {
203
+ }), Fe = /* @__PURE__ */ i("button", {
207
204
  label: "AgenticTableViewSelector-viewButton",
208
- shouldForwardProp: (o) => o !== "ownerState"
209
- })(({ ownerState: o }) => [
205
+ shouldForwardProp: (n) => n !== "ownerState"
206
+ })(({ ownerState: n }) => [
207
+ // Rows mirror a Select option in every state (Select/SearchableSelect/
208
+ // MultiSelect): transparent at rest, `primary-soft` on hover and while
209
+ // pressed, and `primary-soft` + bold once selected.
210
210
  {
211
211
  display: "flex",
212
212
  minWidth: "0px",
@@ -222,19 +222,18 @@ const D = {
222
222
  textAlign: "left",
223
223
  fontSize: "12px",
224
224
  lineHeight: "1rem",
225
- fontWeight: 500,
225
+ fontWeight: 400,
226
226
  ...D,
227
227
  outline: "2px solid transparent",
228
228
  outlineOffset: "2px",
229
- "&:hover": de,
230
- "&:focus-visible": ue("2px", "hsl(var(--bfrs-color-border-focus) / .25)")
229
+ "&:hover": me,
230
+ "&:focus-visible": fe("2px", "hsl(var(--bfrs-color-border-focus) / .25)")
231
231
  },
232
- o.selected && {
233
- ...de,
234
- fontWeight: 700,
235
- "&:hover": Qt
232
+ n.selected && {
233
+ ...me,
234
+ fontWeight: 700
236
235
  }
237
- ]), Ee = /* @__PURE__ */ i("span", {
236
+ ]), je = /* @__PURE__ */ i("span", {
238
237
  label: "AgenticTableViewSelector-name"
239
238
  })({
240
239
  minWidth: "0px",
@@ -242,7 +241,7 @@ const D = {
242
241
  overflow: "hidden",
243
242
  textOverflow: "ellipsis",
244
243
  whiteSpace: "nowrap"
245
- }), Pe = /* @__PURE__ */ i("div", {
244
+ }), Ne = /* @__PURE__ */ i("div", {
246
245
  label: "AgenticTableViewSelector-empty"
247
246
  })({
248
247
  paddingLeft: ".75rem",
@@ -251,17 +250,17 @@ const D = {
251
250
  paddingBottom: ".75rem",
252
251
  fontSize: ".75rem",
253
252
  lineHeight: "1rem",
254
- ...V
255
- }), Fe = /* @__PURE__ */ i(It, {
253
+ ...W
254
+ }), Ke = /* @__PURE__ */ i(Wt, {
256
255
  label: "AgenticTableViewSelector-renameOverlay"
257
256
  })({
258
257
  position: "fixed",
259
258
  inset: 0,
260
259
  zIndex: 1050,
261
260
  backgroundColor: "hsl(var(--bfrs-color-text-primary) / .45)",
262
- ...Mt,
261
+ ...Gt,
263
262
  animation: "bfrs-bfrs-overlay-in var(--bfrs-motion-fast) var(--bfrs-ease-out)"
264
- }), je = /* @__PURE__ */ i(Dt, {
263
+ }), Me = /* @__PURE__ */ i(Pt, {
265
264
  label: "AgenticTableViewSelector-renameContent"
266
265
  })({
267
266
  position: "fixed",
@@ -274,8 +273,8 @@ const D = {
274
273
  overflow: "auto",
275
274
  borderRadius: "var(--bfrs-radius-lg)",
276
275
  borderWidth: "1px",
277
- ...fe,
278
- ...me,
276
+ ...he,
277
+ ...pe,
279
278
  padding: "1.25rem",
280
279
  ...D,
281
280
  "--tw-shadow": "var(--bfrs-shadow-overlay)",
@@ -283,24 +282,24 @@ const D = {
283
282
  boxShadow: "var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)",
284
283
  outline: "2px solid transparent",
285
284
  outlineOffset: "2px",
286
- ...Me({ "--tw-translate-x": "-50%", "--tw-translate-y": "-50%" }),
287
- ...qt,
285
+ ...Ge({ "--tw-translate-x": "-50%", "--tw-translate-y": "-50%" }),
286
+ ...Jt,
288
287
  animation: "bfrs-bfrs-modal-content-in var(--bfrs-motion-normal) var(--bfrs-ease-out)"
289
- }), Ne = /* @__PURE__ */ i(Vt, {
288
+ }), $e = /* @__PURE__ */ i(Bt, {
290
289
  label: "AgenticTableViewSelector-renameTitle"
291
290
  })({
292
291
  fontSize: "1.125rem",
293
292
  lineHeight: "1.5rem",
294
293
  fontWeight: 700,
295
294
  ...D
296
- }), $e = /* @__PURE__ */ i(Wt, {
295
+ }), qe = /* @__PURE__ */ i(Lt, {
297
296
  label: "AgenticTableViewSelector-renameDescription"
298
297
  })({
299
298
  marginTop: ".25rem",
300
299
  fontSize: ".75rem",
301
300
  lineHeight: "1.25rem",
302
- ...V
303
- }), cr = /* @__PURE__ */ i("label", {
301
+ ...W
302
+ }), dr = /* @__PURE__ */ i("label", {
304
303
  label: "AgenticTableViewSelector-renameLabel"
305
304
  })({
306
305
  display: "block",
@@ -309,7 +308,7 @@ const D = {
309
308
  lineHeight: "1rem",
310
309
  fontWeight: 700,
311
310
  ...D
312
- }), sr = /* @__PURE__ */ i("input", {
311
+ }), ur = /* @__PURE__ */ i("input", {
313
312
  label: "AgenticTableViewSelector-renameInput"
314
313
  })({
315
314
  marginTop: ".5rem",
@@ -319,7 +318,7 @@ const D = {
319
318
  borderWidth: "1.5px",
320
319
  "--tw-border-opacity": "1",
321
320
  borderColor: "hsl(var(--bfrs-color-border-focus) / var(--tw-border-opacity, 1))",
322
- ...me,
321
+ ...pe,
323
322
  paddingLeft: ".75rem",
324
323
  paddingRight: ".75rem",
325
324
  fontSize: ".875rem",
@@ -328,15 +327,15 @@ const D = {
328
327
  ...D,
329
328
  outline: "2px solid transparent",
330
329
  outlineOffset: "2px",
331
- "&:focus-visible": ue("2px", "hsl(var(--bfrs-color-border-focus) / .25)")
332
- }), Ke = /* @__PURE__ */ i("div", {
330
+ "&:focus-visible": fe("2px", "hsl(var(--bfrs-color-border-focus) / .25)")
331
+ }), Ye = /* @__PURE__ */ i("div", {
333
332
  label: "AgenticTableViewSelector-renameFooter"
334
333
  })({
335
334
  marginTop: "1.5rem",
336
335
  display: "flex",
337
336
  justifyContent: "flex-end",
338
337
  gap: ".625rem"
339
- }), dr = /* @__PURE__ */ i(q, {
338
+ }), mr = /* @__PURE__ */ i(Y, {
340
339
  label: "AgenticTableViewSelector-renameSubmitButton"
341
340
  })({
342
341
  "&&:disabled": {
@@ -347,7 +346,7 @@ const D = {
347
346
  "--tw-text-opacity": "1",
348
347
  color: "hsl(var(--bfrs-color-text-muted) / var(--tw-text-opacity, 1))"
349
348
  }
350
- }), ur = /* @__PURE__ */ i("p", {
349
+ }), fr = /* @__PURE__ */ i("p", {
351
350
  label: "AgenticTableViewSelector-renameFieldError"
352
351
  })({
353
352
  marginTop: ".375rem",
@@ -356,337 +355,348 @@ const D = {
356
355
  "--tw-text-opacity": "1",
357
356
  color: "hsl(var(--bfrs-color-danger) / var(--tw-text-opacity, 1))"
358
357
  });
359
- function I(o, n) {
360
- return n ? o.find((r) => r.view_id === n) ?? null : null;
358
+ function V(n, o) {
359
+ return o ? n.find((r) => r.view_id === o) ?? null : null;
361
360
  }
362
- function mr(o, n, r) {
363
- var h;
364
- const S = [], x = /* @__PURE__ */ new Set(), T = n ?? ((h = o.find((s) => s.is_default)) == null ? void 0 : h.view_id) ?? null, b = (s) => {
361
+ function pr(n, o, r) {
362
+ var _;
363
+ const S = [], x = /* @__PURE__ */ new Set(), T = o ?? ((_ = n.find((s) => s.is_default)) == null ? void 0 : _.view_id) ?? null, p = (s) => {
365
364
  if (!s || x.has(s)) return;
366
- const u = I(o, s);
367
- u && (S.push(u), x.add(u.view_id));
365
+ const h = V(n, s);
366
+ h && (S.push(h), x.add(h.view_id));
368
367
  };
369
- b(T), b(r);
370
- for (const s of o)
368
+ p(T), p(r);
369
+ for (const s of n)
371
370
  x.has(s.view_id) || (S.push(s), x.add(s.view_id));
372
371
  return S;
373
372
  }
374
- function fr(o) {
375
- return o ? [
373
+ const hr = /* @__PURE__ */ new Set(["true", "1"]);
374
+ function br() {
375
+ if (typeof window > "u") return !1;
376
+ const n = new URLSearchParams(window.location.search).get("skip_primary_view");
377
+ return n !== null && hr.has(n.trim().toLowerCase());
378
+ }
379
+ function gr(n) {
380
+ return n ? [
376
381
  "api",
377
- o.viewType && o.tab ? "scoped" : "local",
378
- o.saveEndpoint || o.endpoint ? "remote-save" : "local-save"
382
+ n.viewType && n.tab ? "scoped" : "local",
383
+ n.saveEndpoint || n.endpoint ? "remote-save" : "local-save"
379
384
  ].join(":") : "none";
380
385
  }
381
- function pr(o) {
382
- const n = () => o.current;
386
+ function wr(n) {
387
+ const o = () => n.current;
383
388
  return {
384
389
  get baseUrl() {
385
390
  var r;
386
- return (r = n()) == null ? void 0 : r.baseUrl;
391
+ return (r = o()) == null ? void 0 : r.baseUrl;
387
392
  },
388
393
  get endpoint() {
389
394
  var r;
390
- return (r = n()) == null ? void 0 : r.endpoint;
395
+ return (r = o()) == null ? void 0 : r.endpoint;
391
396
  },
392
397
  get saveEndpoint() {
393
398
  var r;
394
- return (r = n()) == null ? void 0 : r.saveEndpoint;
399
+ return (r = o()) == null ? void 0 : r.saveEndpoint;
395
400
  },
396
401
  get listEndpoint() {
397
402
  var r;
398
- return (r = n()) == null ? void 0 : r.listEndpoint;
403
+ return (r = o()) == null ? void 0 : r.listEndpoint;
399
404
  },
400
405
  get updateEndpoint() {
401
406
  var r;
402
- return (r = n()) == null ? void 0 : r.updateEndpoint;
407
+ return (r = o()) == null ? void 0 : r.updateEndpoint;
403
408
  },
404
409
  get deleteEndpoint() {
405
410
  var r;
406
- return (r = n()) == null ? void 0 : r.deleteEndpoint;
411
+ return (r = o()) == null ? void 0 : r.deleteEndpoint;
407
412
  },
408
413
  get viewType() {
409
414
  var r;
410
- return (r = n()) == null ? void 0 : r.viewType;
415
+ return (r = o()) == null ? void 0 : r.viewType;
411
416
  },
412
417
  get tab() {
413
418
  var r;
414
- return (r = n()) == null ? void 0 : r.tab;
419
+ return (r = o()) == null ? void 0 : r.tab;
415
420
  },
416
421
  get token() {
417
422
  var r;
418
- return (r = n()) == null ? void 0 : r.token;
423
+ return (r = o()) == null ? void 0 : r.token;
419
424
  },
420
425
  get headers() {
421
426
  var r;
422
- return (r = n()) == null ? void 0 : r.headers;
427
+ return (r = o()) == null ? void 0 : r.headers;
423
428
  },
424
429
  get credentials() {
425
430
  var r;
426
- return (r = n()) == null ? void 0 : r.credentials;
431
+ return (r = o()) == null ? void 0 : r.credentials;
427
432
  },
428
433
  get fetcher() {
429
434
  var r;
430
- return (r = n()) == null ? void 0 : r.fetcher;
435
+ return (r = o()) == null ? void 0 : r.fetcher;
431
436
  }
432
437
  };
433
438
  }
434
- function Br({
435
- screenName: o,
436
- store: n,
439
+ function Hr({
440
+ screenName: n,
441
+ store: o,
437
442
  saveApi: r,
438
443
  value: S,
439
444
  defaultValue: x,
440
- selectPrimaryByDefault: T = !0,
441
- onValueChange: b,
442
- onViewSelect: h,
443
- onPrimaryViewChange: s,
444
- onUnsetPrimaryView: u,
445
- onRenameView: Y,
445
+ onValueChange: T,
446
+ onViewSelect: p,
447
+ onPrimaryViewChange: _,
448
+ onUnsetPrimaryView: s,
449
+ onRenameView: h,
446
450
  onDeleteView: G,
447
- onResetSavedFilters: _,
448
- onError: L,
449
- triggerLabel: Ye,
450
- placeholder: Ge = "Views",
451
- viewsLabel: Je = "VIEWS",
452
- primaryHintLabel: pe = "Set a view as primary to load it automatically. With no primary view, the table opens in its default state.",
453
- emptyLabel: Qe = "No saved views",
454
- loadingLabel: Xe = "Loading views",
455
- defaultViewLabel: be = "Default",
456
- setPrimaryLabel: he = "Set as Primary View",
457
- unsetPrimaryLabel: Ze = "Unset as Primary",
458
- renameLabel: Ue = "Rename",
459
- deleteLabel: et = "Delete",
460
- renameTitle: tt = "Rename view",
461
- renameDescription: ge = "Update the saved view name.",
462
- renameInputLabel: rt = "View name",
463
- renameCancelLabel: ot = "Cancel",
464
- renameSaveLabel: it = "Save",
465
- deleteTitle: nt = "Delete view",
466
- deleteDescription: at,
467
- deleteCancelLabel: lt = "Cancel",
468
- deleteConfirmLabel: ct = "Delete",
469
- size: st = "sm",
470
- disabled: dt = !1,
471
- className: ut,
472
- triggerClassName: mt,
473
- contentClassName: ft,
474
- actionMenuClassName: ve
451
+ onResetSavedFilters: R,
452
+ onError: H,
453
+ triggerLabel: Qe,
454
+ placeholder: Xe = "Views",
455
+ viewsLabel: Ze = "VIEWS",
456
+ primaryHintLabel: be = "Set a view as primary to load it automatically. With no primary view, the table opens in its default state.",
457
+ emptyLabel: Ue = "No saved views",
458
+ loadingLabel: et = "Loading views",
459
+ defaultViewLabel: ge = "Default",
460
+ setPrimaryLabel: we = "Set as Primary View",
461
+ unsetPrimaryLabel: tt = "Unset as Primary",
462
+ renameLabel: rt = "Rename",
463
+ deleteLabel: nt = "Delete",
464
+ renameTitle: it = "Rename view",
465
+ renameDescription: ve = "Update the saved view name.",
466
+ renameInputLabel: ot = "View name",
467
+ renameCancelLabel: at = "Cancel",
468
+ renameSaveLabel: lt = "Save",
469
+ deleteTitle: ct = "Delete view",
470
+ deleteDescription: st,
471
+ deleteCancelLabel: dt = "Cancel",
472
+ deleteConfirmLabel: ut = "Delete",
473
+ size: mt = "sm",
474
+ disabled: ft = !1,
475
+ className: pt,
476
+ triggerClassName: ht,
477
+ contentClassName: bt,
478
+ actionMenuClassName: ye
475
479
  }) {
476
- const we = A(r);
477
- we.current = r;
478
- const ye = fr(r), J = le(
479
- () => ye === "none" ? void 0 : pr(we),
480
- [ye]
481
- ), m = le(
482
- () => n ?? Gt(o, J ? { saveApi: J } : void 0),
483
- [o, n, J]
484
- ), E = S !== void 0, [Q, X] = p(!1), [R, pt] = p([]), [W, bt] = p(null), [ht, Se] = p(x ?? null), [xe, Te] = p(!1), [P, _e] = p(null), [B, Z] = p(""), [g, Re] = p(null), O = S ?? ht, H = A(O), F = A(E), U = A(!1), v = A(!1), C = A(null), Ce = $t();
485
- $(() => {
486
- H.current = O, O && (v.current = !1);
487
- }, [O]), $(() => {
488
- F.current = E;
489
- }, [E]), $(() => {
490
- C.current = null, U.current = !1, v.current = !1;
491
- }, [m, o]);
492
- const w = K(
480
+ const Se = y(r);
481
+ Se.current = r;
482
+ const xe = gr(r), J = se(
483
+ () => xe === "none" ? void 0 : wr(Se),
484
+ [xe]
485
+ ), u = se(
486
+ () => o ?? Xt(n, J ? { saveApi: J } : void 0),
487
+ [n, o, J]
488
+ ), Q = S !== void 0, E = !br(), [X, Z] = m(!1), [A, gt] = m([]), [P, wt] = m(null), [vt, Te] = m(x ?? null), [_e, Re] = m(!1), [F, Ae] = m(null), [B, U] = m(""), [b, ke] = m(null), [Ce, j] = m(null), k = y(!1), L = S ?? vt, O = y(L), ee = y(Q), te = y(!1), g = y(!1), C = y(null), ze = qt();
489
+ M(() => {
490
+ O.current = L, L && (g.current = !1);
491
+ }, [L]), M(() => {
492
+ ee.current = Q;
493
+ }, [Q]), M(() => {
494
+ C.current = null, te.current = !1, g.current = !1;
495
+ }, [u, n]);
496
+ const w = $(
493
497
  (e) => {
494
- L == null || L(e);
498
+ H == null || H(e);
495
499
  },
496
- [L]
497
- ), f = K(
500
+ [H]
501
+ ), f = $(
498
502
  (e) => {
499
- e && (v.current = !1), F.current || Se((e == null ? void 0 : e.view_id) ?? null), b == null || b((e == null ? void 0 : e.view_id) ?? null, e), e && (h == null || h(e));
503
+ e && (g.current = !1), ee.current || Te((e == null ? void 0 : e.view_id) ?? null), T == null || T((e == null ? void 0 : e.view_id) ?? null, e), e && (p == null || p(e));
500
504
  },
501
- [b, h]
502
- ), ee = K(
505
+ [T, p]
506
+ ), re = $(
503
507
  (e) => {
504
508
  f(e);
505
509
  },
506
510
  [f]
507
- ), y = K(
511
+ ), v = $(
508
512
  async (e) => {
509
- var ze;
513
+ var Ve;
510
514
  const a = e === void 0 ? "__default__" : e ?? "__none__";
511
- if (((ze = C.current) == null ? void 0 : ze.key) === a) return C.current.promise;
515
+ if (((Ve = C.current) == null ? void 0 : Ve.key) === a) return C.current.promise;
512
516
  const d = { key: a, promise: Promise.resolve(null) };
513
517
  return C.current = d, d.promise = (async () => {
514
- Te(!0);
518
+ Re(!0);
515
519
  try {
516
- const k = await m.list(), z = k.find((At) => At.is_default) ?? null, kt = e !== void 0 ? e : H.current, Ae = I(k, kt), zt = !v.current && (e !== void 0 || T || !F.current), ae = Ae || !zt ? null : I(k, z == null ? void 0 : z.view_id), N = Ae ?? ae ?? null;
517
- return pt(k), bt((z == null ? void 0 : z.view_id) ?? null), F.current || Se((N == null ? void 0 : N.view_id) ?? null), T && ae && e === void 0 && !H.current && !U.current && (U.current = !0, ee(ae)), N;
518
- } catch (k) {
519
- return w(k), null;
520
+ const z = await u.list(), I = z.find((Dt) => Dt.is_default) ?? null, It = e !== void 0 ? e : O.current, De = V(z, It), Vt = E && !g.current, ce = De || !Vt ? null : V(z, I == null ? void 0 : I.view_id), K = De ?? ce ?? null;
521
+ return gt(z), wt((I == null ? void 0 : I.view_id) ?? null), ee.current || Te((K == null ? void 0 : K.view_id) ?? null), E && ce && e === void 0 && !O.current && !te.current && (te.current = !0, re(ce)), K;
522
+ } catch (z) {
523
+ return w(z), null;
520
524
  } finally {
521
- Te(!1), C.current === d && (C.current = null);
525
+ Re(!1), C.current === d && (C.current = null);
522
526
  }
523
527
  })(), d.promise;
524
528
  },
525
- [ee, w, m, T, f]
529
+ [E, re, w, u, f]
526
530
  );
527
- $(() => {
531
+ M(() => {
528
532
  const e = () => {
529
- y();
533
+ v();
530
534
  };
531
- return e(), m.subscribe(e);
532
- }, [y, m]);
533
- const l = I(R, O) ?? (!v.current && (T || !E) ? I(R, W) : null), gt = le(
534
- () => mr(R, W, l == null ? void 0 : l.view_id),
535
- [W, l == null ? void 0 : l.view_id, R]
536
- ), j = !l, te = W === null, vt = Ye ?? (l == null ? void 0 : l.name) ?? (j ? be : Ge), re = R.length > 0, wt = (e) => {
537
- X(!1), ee(e);
538
- }, yt = (e) => {
539
- m.setPrimary(e.view_id).then(async (a) => {
540
- const d = await y(e.view_id);
541
- f(d ?? a), s == null || s(a);
535
+ return e(), u.subscribe(e);
536
+ }, [v, u]);
537
+ const l = V(A, L) ?? (E && !g.current ? V(A, P) : null), yt = se(
538
+ () => pr(A, P, l == null ? void 0 : l.view_id),
539
+ [P, l == null ? void 0 : l.view_id, A]
540
+ ), N = !l, ne = P === null, St = Qe ?? (l == null ? void 0 : l.name) ?? (N ? ge : Xe), ie = A.length > 0, xt = (e) => {
541
+ Z(!1), re(e);
542
+ }, Tt = (e) => {
543
+ u.setPrimary(e.view_id).then(async (a) => {
544
+ const d = await v(e.view_id);
545
+ f(d ?? a), _ == null || _(a);
542
546
  }).catch(w);
543
- }, St = (e) => {
544
- m.unsetPrimary(e.view_id).then(async (a) => {
545
- const d = await y(e.view_id);
546
- f(d ?? a), u == null || u(a);
547
+ }, _t = (e) => {
548
+ u.unsetPrimary(e.view_id).then(async (a) => {
549
+ const d = await v(e.view_id);
550
+ f(d ?? a), s == null || s(a);
547
551
  }).catch(w);
548
- }, oe = () => Re(null), xt = (e) => {
549
- const a = H.current === e.view_id;
550
- m.remove(e.view_id).then(async () => {
551
- const d = await y(a ? null : H.current);
552
+ }, oe = () => ke(null), Rt = (e) => {
553
+ if (k.current) return;
554
+ k.current = !0, j("delete");
555
+ const a = O.current === e.view_id;
556
+ u.remove(e.view_id).then(async () => {
557
+ const d = await v(a ? null : O.current);
552
558
  a && f(d), G == null || G(e.view_id);
553
- }).catch(w).finally(oe);
554
- }, Tt = () => {
555
- g && xt(g);
556
- }, ke = () => {
557
- v.current = !0, f(null), _ == null || _(), X(!1);
558
- }, _t = () => {
559
- const e = I(R, W);
559
+ }).catch(w).finally(() => {
560
+ k.current = !1, j(null), oe();
561
+ });
562
+ }, At = () => {
563
+ b && Rt(b);
564
+ }, Ie = () => {
565
+ g.current = !0, f(null), R == null || R(), Z(!1);
566
+ }, kt = () => {
567
+ const e = V(A, P);
560
568
  if (!e) {
561
- ke();
569
+ Ie();
562
570
  return;
563
571
  }
564
- m.unsetPrimary(e.view_id).then(async (a) => {
565
- v.current = !0, await y(null), f(null), _ == null || _(), u == null || u(a);
572
+ u.unsetPrimary(e.view_id).then(async (a) => {
573
+ g.current = !0, await v(null), f(null), R == null || R(), s == null || s(a);
566
574
  }).catch(w);
567
- }, Rt = (e) => {
568
- _e(e), Z(e.name);
569
- }, ie = () => {
570
- _e(null), Z("");
571
575
  }, Ct = (e) => {
576
+ Ae(e), U(e.name);
577
+ }, ae = () => {
578
+ Ae(null), U("");
579
+ }, zt = (e) => {
572
580
  e.preventDefault();
573
581
  const a = B.trim();
574
- !P || !a || Oe(a) || m.rename(P.view_id, a).then(async (d) => {
575
- await y(P.view_id), Y == null || Y(d), ie();
576
- }).catch(w);
577
- }, ne = Oe(B);
578
- return re ? /* @__PURE__ */ c(Zt, { className: ut, children: [
579
- /* @__PURE__ */ c(Bt, { open: Q, onOpenChange: X, children: [
580
- /* @__PURE__ */ t(Ot, { asChild: !0, children: /* @__PURE__ */ c(
581
- Ut,
582
+ !F || !a || He(a) || k.current || (k.current = !0, j("rename"), u.rename(F.view_id, a).then(async (d) => {
583
+ await v(F.view_id), h == null || h(d), ae();
584
+ }).catch(w).finally(() => {
585
+ k.current = !1, j(null);
586
+ }));
587
+ }, le = He(B);
588
+ return ie ? /* @__PURE__ */ c(er, { className: pt, children: [
589
+ /* @__PURE__ */ c(Ot, { open: X, onOpenChange: Z, children: [
590
+ /* @__PURE__ */ t(Ht, { asChild: !0, children: /* @__PURE__ */ c(
591
+ tr,
582
592
  {
583
593
  type: "button",
584
594
  "aria-label": "Saved views",
585
- className: mt,
586
- disabled: dt,
595
+ className: ht,
596
+ disabled: ft,
587
597
  "data-filled": l ? "" : void 0,
588
- ownerState: { open: Q, empty: !l, filled: !!l, defaultSelected: j, size: st },
598
+ ownerState: { open: X, empty: !l, filled: !!l, defaultSelected: N, size: mt },
589
599
  children: [
590
- /* @__PURE__ */ t(Et, { size: 13 }),
591
- /* @__PURE__ */ t(er, { children: vt }),
592
- l != null && l.is_default || j && te ? /* @__PURE__ */ t(se, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null,
593
- /* @__PURE__ */ t(tr, { size: 13, ownerState: { open: Q } })
600
+ /* @__PURE__ */ t(jt, { size: 13 }),
601
+ /* @__PURE__ */ t(rr, { children: St }),
602
+ l != null && l.is_default || N && ne ? /* @__PURE__ */ t(ue, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null,
603
+ /* @__PURE__ */ t(nr, { size: 13, ownerState: { open: X } })
594
604
  ]
595
605
  }
596
606
  ) }),
597
- /* @__PURE__ */ t(Ht, { children: /* @__PURE__ */ t(ce, { children: /* @__PURE__ */ c(
598
- rr,
607
+ /* @__PURE__ */ t(Et, { children: /* @__PURE__ */ t(de, { children: /* @__PURE__ */ c(
608
+ ir,
599
609
  {
600
610
  align: "start",
601
611
  sideOffset: 8,
602
- collisionPadding: Yt,
603
- className: ft,
612
+ collisionPadding: Qt,
613
+ className: bt,
604
614
  children: [
605
615
  /* @__PURE__ */ c(or, { children: [
606
- Je,
607
- pe ? /* @__PURE__ */ t(Jt, { content: pe, side: "right", variant: "white", children: /* @__PURE__ */ t(ir, { role: "img", "aria-label": "About primary views", children: /* @__PURE__ */ t(Ft, { size: 13, weight: "fill", "aria-hidden": "true" }) }) }) : null
616
+ Ze,
617
+ be ? /* @__PURE__ */ t(Zt, { content: be, side: "right", variant: "white", children: /* @__PURE__ */ t(ar, { role: "img", "aria-label": "About primary views", children: /* @__PURE__ */ t(Kt, { size: 13, weight: "fill", "aria-hidden": "true" }) }) }) : null
608
618
  ] }),
609
- /* @__PURE__ */ c(nr, { children: [
610
- xe && !re ? /* @__PURE__ */ t(Pe, { children: Xe }) : null,
611
- !xe && !re ? /* @__PURE__ */ t(Pe, { children: Qe }) : null,
612
- /* @__PURE__ */ c(ar, { "data-default-view-surface": !0, children: [
613
- /* @__PURE__ */ c(Le, { type: "button", ownerState: { selected: j }, onClick: ke, children: [
614
- /* @__PURE__ */ t(Ee, { children: be }),
615
- te ? /* @__PURE__ */ t(se, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null
619
+ /* @__PURE__ */ c(lr, { children: [
620
+ _e && !ie ? /* @__PURE__ */ t(Ne, { children: et }) : null,
621
+ !_e && !ie ? /* @__PURE__ */ t(Ne, { children: Ue }) : null,
622
+ /* @__PURE__ */ c(cr, { "data-default-view-surface": !0, children: [
623
+ /* @__PURE__ */ c(Fe, { type: "button", ownerState: { selected: N }, onClick: Ie, children: [
624
+ /* @__PURE__ */ t(je, { children: ge }),
625
+ ne ? /* @__PURE__ */ t(ue, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null
616
626
  ] }),
617
627
  /* @__PURE__ */ t(
618
- He,
628
+ Ee,
619
629
  {
620
630
  align: "start",
621
631
  side: "right",
622
632
  size: "sm",
623
- className: ve,
633
+ className: ye,
624
634
  trigger: /* @__PURE__ */ t(
625
- Be,
635
+ Oe,
626
636
  {
627
637
  variant: "secondary",
628
638
  size: "sm",
629
- icon: /* @__PURE__ */ t(We, { size: 14, weight: "bold" }),
639
+ icon: /* @__PURE__ */ t(Le, { size: 14, weight: "bold" }),
630
640
  "aria-label": "View actions for Default"
631
641
  }
632
642
  ),
633
643
  items: [
634
644
  {
635
- label: he,
636
- icon: /* @__PURE__ */ t(M, { size: 16 }),
637
- disabled: te,
638
- onSelect: _t
645
+ label: we,
646
+ icon: /* @__PURE__ */ t(q, { size: 16 }),
647
+ disabled: ne,
648
+ onSelect: kt
639
649
  }
640
650
  ]
641
651
  }
642
652
  )
643
653
  ] }),
644
- /* @__PURE__ */ t(lr, { role: "separator", "data-default-view-divider": !0 }),
645
- gt.map((e) => {
654
+ /* @__PURE__ */ t(sr, { role: "separator", "data-default-view-divider": !0 }),
655
+ yt.map((e) => {
646
656
  const a = (l == null ? void 0 : l.view_id) === e.view_id;
647
- return /* @__PURE__ */ c(qe, { children: [
648
- /* @__PURE__ */ c(Le, { type: "button", ownerState: { selected: a }, onClick: () => wt(e), children: [
649
- /* @__PURE__ */ t(Ee, { children: e.name }),
650
- e.is_default ? /* @__PURE__ */ t(se, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null
657
+ return /* @__PURE__ */ c(Je, { children: [
658
+ /* @__PURE__ */ c(Fe, { type: "button", ownerState: { selected: a }, onClick: () => xt(e), children: [
659
+ /* @__PURE__ */ t(je, { children: e.name }),
660
+ e.is_default ? /* @__PURE__ */ t(ue, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null
651
661
  ] }),
652
662
  /* @__PURE__ */ t(
653
- He,
663
+ Ee,
654
664
  {
655
665
  align: "start",
656
666
  side: "right",
657
667
  size: "sm",
658
- className: ve,
668
+ className: ye,
659
669
  trigger: /* @__PURE__ */ t(
660
- Be,
670
+ Oe,
661
671
  {
662
672
  variant: "secondary",
663
673
  size: "sm",
664
- icon: /* @__PURE__ */ t(We, { size: 14, weight: "bold" }),
674
+ icon: /* @__PURE__ */ t(Le, { size: 14, weight: "bold" }),
665
675
  "aria-label": `View actions for ${e.name}`
666
676
  }
667
677
  ),
668
678
  items: [
669
679
  ...e.is_system_defined ? [] : [
670
680
  e.is_default ? {
671
- label: Ze,
672
- icon: /* @__PURE__ */ t(M, { size: 16 }),
673
- onSelect: () => St(e)
681
+ label: tt,
682
+ icon: /* @__PURE__ */ t(q, { size: 16 }),
683
+ onSelect: () => _t(e)
674
684
  } : {
675
- label: he,
676
- icon: /* @__PURE__ */ t(M, { size: 16 }),
677
- onSelect: () => yt(e)
685
+ label: we,
686
+ icon: /* @__PURE__ */ t(q, { size: 16 }),
687
+ onSelect: () => Tt(e)
678
688
  }
679
689
  ],
680
690
  {
681
- label: Ue,
682
- icon: /* @__PURE__ */ t(jt, { size: 16 }),
683
- onSelect: () => Rt(e)
691
+ label: rt,
692
+ icon: /* @__PURE__ */ t(Mt, { size: 16 }),
693
+ onSelect: () => Ct(e)
684
694
  },
685
695
  {
686
- label: et,
687
- icon: /* @__PURE__ */ t(Nt, { size: 16 }),
696
+ label: nt,
697
+ icon: /* @__PURE__ */ t($t, { size: 16 }),
688
698
  destructive: !0,
689
- onSelect: () => Re(e)
699
+ onSelect: () => ke(e)
690
700
  }
691
701
  ]
692
702
  }
@@ -698,59 +708,67 @@ function Br({
698
708
  }
699
709
  ) }) })
700
710
  ] }),
701
- /* @__PURE__ */ t(De, { open: !!P, onOpenChange: (e) => {
702
- e || ie();
703
- }, children: /* @__PURE__ */ t(Ve, { children: /* @__PURE__ */ c(ce, { children: [
704
- /* @__PURE__ */ t(Fe, {}),
705
- /* @__PURE__ */ t(je, { children: /* @__PURE__ */ c("form", { onSubmit: Ct, children: [
706
- /* @__PURE__ */ t(Ne, { children: tt }),
707
- ge ? /* @__PURE__ */ t($e, { children: ge }) : null,
708
- /* @__PURE__ */ t(cr, { htmlFor: Ce, children: rt }),
711
+ /* @__PURE__ */ t(Pe, { open: !!F, onOpenChange: (e) => {
712
+ e || ae();
713
+ }, children: /* @__PURE__ */ t(Be, { children: /* @__PURE__ */ c(de, { children: [
714
+ /* @__PURE__ */ t(Ke, {}),
715
+ /* @__PURE__ */ t(Me, { children: /* @__PURE__ */ c("form", { onSubmit: zt, children: [
716
+ /* @__PURE__ */ t($e, { children: it }),
717
+ ve ? /* @__PURE__ */ t(qe, { children: ve }) : null,
718
+ /* @__PURE__ */ t(dr, { htmlFor: ze, children: ot }),
709
719
  /* @__PURE__ */ t(
710
- sr,
720
+ ur,
711
721
  {
712
- id: Ce,
722
+ id: ze,
713
723
  autoFocus: !0,
714
724
  value: B,
715
- onChange: (e) => Z(e.currentTarget.value),
716
- "aria-invalid": ne
725
+ onChange: (e) => U(e.currentTarget.value),
726
+ "aria-invalid": le
717
727
  }
718
728
  ),
719
- ne ? /* @__PURE__ */ c(ur, { children: [
729
+ le ? /* @__PURE__ */ c(fr, { children: [
720
730
  "“",
721
731
  B.trim(),
722
732
  "” is reserved. Choose a different name."
723
733
  ] }) : null,
724
- /* @__PURE__ */ c(Ke, { children: [
725
- /* @__PURE__ */ t(q, { type: "button", variant: "secondary", onClick: ie, children: ot }),
726
- /* @__PURE__ */ t(dr, { type: "submit", disabled: B.trim().length === 0 || ne, children: it })
734
+ /* @__PURE__ */ c(Ye, { children: [
735
+ /* @__PURE__ */ t(Y, { type: "button", variant: "secondary", onClick: ae, children: at }),
736
+ /* @__PURE__ */ t(
737
+ mr,
738
+ {
739
+ type: "submit",
740
+ loading: Ce === "rename",
741
+ disabled: B.trim().length === 0 || le,
742
+ children: lt
743
+ }
744
+ )
727
745
  ] })
728
746
  ] }) })
729
747
  ] }) }) }),
730
- /* @__PURE__ */ t(De, { open: !!g, onOpenChange: (e) => {
748
+ /* @__PURE__ */ t(Pe, { open: !!b, onOpenChange: (e) => {
731
749
  e || oe();
732
- }, children: /* @__PURE__ */ t(Ve, { children: /* @__PURE__ */ c(ce, { children: [
733
- /* @__PURE__ */ t(Fe, {}),
734
- /* @__PURE__ */ c(je, { children: [
735
- /* @__PURE__ */ t(Ne, { children: nt }),
736
- /* @__PURE__ */ t($e, { children: at ?? /* @__PURE__ */ c(Ie, { children: [
750
+ }, children: /* @__PURE__ */ t(Be, { children: /* @__PURE__ */ c(de, { children: [
751
+ /* @__PURE__ */ t(Ke, {}),
752
+ /* @__PURE__ */ c(Me, { children: [
753
+ /* @__PURE__ */ t($e, { children: ct }),
754
+ /* @__PURE__ */ t(qe, { children: st ?? /* @__PURE__ */ c(We, { children: [
737
755
  "Are you sure you want to delete",
738
- g != null && g.name ? /* @__PURE__ */ c(Ie, { children: [
756
+ b != null && b.name ? /* @__PURE__ */ c(We, { children: [
739
757
  " “",
740
- /* @__PURE__ */ t("strong", { children: g.name }),
758
+ /* @__PURE__ */ t("strong", { children: b.name }),
741
759
  "”"
742
760
  ] }) : " this view",
743
761
  "? This can’t be undone."
744
762
  ] }) }),
745
- /* @__PURE__ */ c(Ke, { children: [
746
- /* @__PURE__ */ t(q, { type: "button", variant: "secondary", onClick: oe, children: lt }),
747
- /* @__PURE__ */ t(q, { type: "button", variant: "danger", onClick: Tt, children: ct })
763
+ /* @__PURE__ */ c(Ye, { children: [
764
+ /* @__PURE__ */ t(Y, { type: "button", variant: "secondary", onClick: oe, children: dt }),
765
+ /* @__PURE__ */ t(Y, { type: "button", variant: "danger", onClick: At, loading: Ce === "delete", children: ut })
748
766
  ] })
749
767
  ] })
750
768
  ] }) }) })
751
769
  ] }) : null;
752
770
  }
753
771
  export {
754
- Br as TableViewSelector
772
+ Hr as TableViewSelector
755
773
  };
756
774
  //# sourceMappingURL=TableViewSelector.js.map