@ynput/ayon-frontend-shared 0.6.9 → 0.7.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 (65) hide show
  1. package/dist/ContextMenu.es.js +44 -27
  2. package/dist/DetailsPanel.es.js +225 -224
  3. package/dist/ListTable.es.js +420 -420
  4. package/dist/NewEntity.es.js +42 -41
  5. package/dist/ProjectTreeTable.es.js +3517 -3378
  6. package/dist/Slicer.es.js +301 -276
  7. package/dist/Views.es.js +366 -352
  8. package/dist/api.es.js +428 -413
  9. package/dist/chunks/Actions.es.js +18 -17
  10. package/dist/chunks/ColumnDropIndicator.es.js +19 -18
  11. package/dist/chunks/ColumnHeaderMenuUI.es.js +2 -2
  12. package/dist/chunks/ContextMenuContextInstance.es.js +4 -3
  13. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +53 -41
  14. package/dist/chunks/DetailsDialog.es.js +26 -24
  15. package/dist/chunks/EmptyPlaceholder.es.js +3 -3
  16. package/dist/chunks/EmptyPlaceholderFlex.styled.es.js +40 -0
  17. package/dist/chunks/EntityPath.es.js +60 -59
  18. package/dist/chunks/EntityPickerDialog.es.js +88 -83
  19. package/dist/chunks/EntityTooltip.es.js +15 -14
  20. package/dist/chunks/EntityUpdatesContext.es.js +11 -11
  21. package/dist/chunks/Feed.es.js +864 -859
  22. package/dist/chunks/FilterErrorActions.es.js +4 -3
  23. package/dist/chunks/Menu.es.js +633 -289
  24. package/dist/chunks/MenuContext.es.js +1 -1
  25. package/dist/chunks/MetaWidget.es.js +2457 -2196
  26. package/dist/chunks/PlayableIcon.es.js +77 -76
  27. package/dist/chunks/ProjectContext.es.js +6 -6
  28. package/dist/chunks/RepresentationsList.es.js +1 -1
  29. package/dist/chunks/ReviewablesSelector.es.js +625 -609
  30. package/dist/chunks/SimpleForm.es.js +1 -1
  31. package/dist/chunks/SimpleTable.es.js +386 -363
  32. package/dist/chunks/Slicer.es.js +954 -821
  33. package/dist/chunks/{DeleteEntitiesContextInstance.es.js → TableExportContextInstance.es.js} +190 -186
  34. package/dist/chunks/TableSettingsFallback.es.js +4 -3
  35. package/dist/chunks/ThumbnailSimple.es.js +100 -99
  36. package/dist/chunks/VideoPlayer.es.js +1 -1
  37. package/dist/chunks/Watchers.es.js +222 -221
  38. package/dist/chunks/getBundleMode.es.js +1 -1
  39. package/dist/chunks/getEntityTypeIcon.es.js +5 -4
  40. package/dist/chunks/getUris.es.js +3873 -3736
  41. package/dist/chunks/realtimeUpdatesUtils.es.js +91 -82
  42. package/dist/chunks/searchTerms.es.js +621 -499
  43. package/dist/chunks/sortLists.es.js +22 -0
  44. package/dist/chunks/useAttributeEnums.es.js +43 -43
  45. package/dist/chunks/useHierarchySelection.es.js +6 -5
  46. package/dist/chunks/useLoadModule.es.js +24 -23
  47. package/dist/chunks/viewUpdateHelper.es.js +16 -15
  48. package/dist/components.es.js +565 -531
  49. package/dist/context.es.js +529 -503
  50. package/dist/hooks.es.js +13 -13
  51. package/dist/index.es.js +4 -4
  52. package/dist/types/ContextMenu.d.ts +4 -1
  53. package/dist/types/Feed.d.ts +1 -1
  54. package/dist/types/ListTable.d.ts +1 -1
  55. package/dist/types/ProjectTreeTable.d.ts +123 -13
  56. package/dist/types/SimpleTable.d.ts +2 -1
  57. package/dist/types/Slicer.d.ts +26 -1
  58. package/dist/types/Views.d.ts +2 -0
  59. package/dist/types/api.d.ts +2359 -590
  60. package/dist/types/components.d.ts +30 -4
  61. package/dist/types/context.d.ts +94 -2
  62. package/dist/types/util.d.ts +54 -0
  63. package/dist/util.es.js +129 -119
  64. package/package.json +2 -2
  65. package/dist/chunks/MenuItem.es.js +0 -420
@@ -1,15 +1,15 @@
1
- import { jsx as E, jsxs as G, Fragment as $e } from "react/jsx-runtime";
2
- import { useState as U, useCallback as A, useMemo as O, useContext as Ye, useEffect as se, forwardRef as Je, useRef as ye, useId as Xe, useImperativeHandle as Ze, useLayoutEffect as Te } from "react";
3
- import { Splitter as et, SplitterPanel as tt } from "primereact/splitter";
4
- import V from "styled-components";
5
- import { h as nt, P as st, d as Ie, U as ze } from "./MetaWidget.es.js";
1
+ import { jsx as E, jsxs as H, Fragment as _e } from "react/jsx-runtime";
2
+ import { useState as z, useCallback as N, useMemo as M, useContext as pt, useEffect as se, forwardRef as ft, useRef as Ie, useId as mt, useImperativeHandle as ht, useLayoutEffect as we } from "react";
3
+ import { Splitter as gt, SplitterPanel as yt } from "primereact/splitter";
4
+ import U from "styled-components";
5
+ import { h as bt, P as St, d as Me, U as Ye } from "./MetaWidget.es.js";
6
6
  import "@module-federation/enhanced/runtime";
7
- import { toast as ke } from "react-toastify";
8
- import { InputText as ot, Button as at, Icon as it } from "@ynput/ayon-react-components";
9
- import { bj as Re, bs as rt, bk as Ue, bq as lt, bv as ct } from "./searchTerms.es.js";
10
- import { dp as Ve, cI as dt, bU as ut, bz as pt } from "./getUris.es.js";
7
+ import { toast as $e } from "react-toastify";
8
+ import { InputText as Tt, Button as vt, Icon as It } from "@ynput/ayon-react-components";
9
+ import { bt as ze, bD as xt, bB as Qe, bA as Ct, bG as Lt } from "./searchTerms.es.js";
10
+ import { du as Je, cN as wt, bY as Et, bC as Dt } from "./getUris.es.js";
11
11
  import "primereact/confirmdialog";
12
- import { p as He, y as Ce, x as ue, d as ft, a as we, o as mt, a5 as ht, a4 as gt, u as yt, ac as bt } from "./DeleteEntitiesContextInstance.es.js";
12
+ import { p as Xe, y as Pe, x as me, d as Rt, a as Oe, o as kt, a7 as At, a6 as _t, u as Ze, ae as Mt } from "./TableExportContextInstance.es.js";
13
13
  import "lodash";
14
14
  import "uuid";
15
15
  import "semver";
@@ -17,7 +17,8 @@ import "./ContextMenuContextInstance.es.js";
17
17
  import W from "clsx";
18
18
  import "react-dom";
19
19
  import "react-redux";
20
- import { E as St, u as Tt } from "./EntityPickerDialog.es.js";
20
+ import "react-router-dom";
21
+ import { E as Pt, u as Ot } from "./EntityPickerDialog.es.js";
21
22
  import "./PlayableIcon.es.js";
22
23
  import "date-fns";
23
24
  import "lexical";
@@ -31,409 +32,483 @@ import "@lexical/utils";
31
32
  import "@lexical/react/LexicalBlockWithAlignableContents";
32
33
  import "@lexical/react/LexicalDecoratorBlockNode";
33
34
  import "@tanstack/react-table";
34
- import { b as he, H as vt, a as xt, e as It, S as Ct } from "./SimpleTable.es.js";
35
- import { g as ge } from "./getEntityTypeIcon.es.js";
36
- import { g as wt } from "./iconUtils.es.js";
37
- import { u as Lt, a as Et } from "./useAttributeEnums.es.js";
38
- import { b as Dt, s as kt } from "./buildHierarchicalTableRows.es.js";
39
- import { n as me } from "./entityDefinitions.es.js";
40
- import { a as Rt, K as Pt } from "./platform.es.js";
41
- import { u as Mt } from "./NewEntityContextInstance.es.js";
42
- import { u as _t } from "./VersionUploadContextInstance.es.js";
43
- import { F as Pe } from "./EntityUpdatesContext.es.js";
44
- import "./MenuItem.es.js";
45
- const At = 180, Be = 100, Ge = 34, Ot = (e, t = [], a = Be) => e.map((r) => t.includes(r) ? Ge : a), Nt = (e, t, a, r) => {
46
- const u = e.reduce((p, h) => p + h, 0), l = r.filter(Boolean).length;
47
- if (!l || u === a) return e;
48
- if (u < a) {
49
- const p = (a - u) / l;
50
- return e.map((h, w) => r[w] ? h + p : h);
35
+ import { b as pe, H as Nt, a as Ft, e as jt, S as $t } from "./SimpleTable.es.js";
36
+ import { D as zt, L as Ut, s as Vt } from "./sortLists.es.js";
37
+ import { a as Ue, g as Ee } from "./getEntityTypeIcon.es.js";
38
+ import { g as Bt } from "./iconUtils.es.js";
39
+ import { u as Ht, a as Gt } from "./useAttributeEnums.es.js";
40
+ import { b as Wt, s as Kt } from "./buildHierarchicalTableRows.es.js";
41
+ import { n as Te } from "./entityDefinitions.es.js";
42
+ import { a as qt, K as Yt } from "./platform.es.js";
43
+ import { u as Qt } from "./NewEntityContextInstance.es.js";
44
+ import { u as Jt } from "./VersionUploadContextInstance.es.js";
45
+ import { F as Ve } from "./EntityUpdatesContext.es.js";
46
+ import { M as Xt, a as Zt } from "./Menu.es.js";
47
+ const et = "default", ve = { id: "label", label: "Name", desc: !1 }, De = (e) => ({
48
+ id: et,
49
+ label: e,
50
+ desc: !1
51
+ }), en = ["hierarchy", "assignees", "author"], tn = ["status", "type", "taskType", "folderType"], Ne = (e) => en.includes(e) ? [ve] : e === "entityList" ? Ut : e.startsWith("attrib.") ? [De("Attribute order"), ve] : tn.includes(e) ? [De("Anatomy order"), ve] : [De("Default order"), ve], tt = (e) => {
52
+ if (e === "entityList") return zt;
53
+ const [t] = Ne(e);
54
+ return { by: t.id, desc: t.desc };
55
+ }, Ns = (e, t) => {
56
+ const { by: n, desc: s } = t || {};
57
+ return Ne(e).some((d) => d.id === n) ? { by: n, desc: !!s } : tt(e);
58
+ }, nn = ["noValue", "hasValue"], sn = (e) => e.id.startsWith("folder-"), an = new Intl.Collator(void 0, { sensitivity: "base", numeric: !0 }), Re = (e) => e.label || e.name || "", nt = (e, t, { by: n, desc: s }) => {
59
+ const d = (l) => nn.includes(l.id) || t === "entityList" && sn(l), c = e.filter(d), p = e.filter((l) => !d(l));
60
+ let h;
61
+ if (t === "entityList")
62
+ h = Vt(
63
+ p.map((l) => ({
64
+ row: l,
65
+ label: Re(l),
66
+ active: l.data?.active ?? !0,
67
+ createdAt: l.data?.createdAt,
68
+ updatedAt: l.data?.updatedAt
69
+ })),
70
+ { by: n, desc: s }
71
+ ).map(({ row: l }) => l);
72
+ else if (n === et)
73
+ h = s ? [...p].reverse() : p;
74
+ else {
75
+ const l = s ? -1 : 1;
76
+ h = [...p].sort(
77
+ (f, y) => an.compare(Re(f), Re(y)) * l
78
+ );
79
+ }
80
+ return [...c, ...h].map(
81
+ (l) => l.subRows?.length ? { ...l, subRows: nt(l.subRows, t, { by: n, desc: s }) } : l
82
+ );
83
+ }, on = (e, t, n) => {
84
+ const s = tt(t);
85
+ return n.by !== "label" && n.by === s.by && n.desc === s.desc ? e : nt(e, t, n);
86
+ }, rn = ({
87
+ options: e,
88
+ sort: t,
89
+ onChange: n,
90
+ id: s = "sort",
91
+ label: d = "Sort",
92
+ icon: c = "sort"
93
+ }) => ({
94
+ id: s,
95
+ label: d,
96
+ icon: c,
97
+ items: e.map((p) => {
98
+ const h = t.by === p.id;
99
+ return {
100
+ id: `${s}-${p.id}`,
101
+ label: p.label,
102
+ onClick: () => n({ by: p.id, desc: p.desc }),
103
+ selected: h,
104
+ endActions: h ? [
105
+ {
106
+ icon: t.desc ? "arrow_downward" : "arrow_upward",
107
+ tooltip: t.desc ? "Descending" : "Ascending",
108
+ onClick: () => n({ ...t, desc: !t.desc })
109
+ }
110
+ ] : void 0
111
+ };
112
+ })
113
+ }), ln = 180, st = 100, at = 34, cn = (e, t = [], n = st) => e.map((s) => t.includes(s) ? at : n), dn = (e, t, n, s) => {
114
+ const d = e.reduce((f, y) => f + y, 0), c = s.filter(Boolean).length;
115
+ if (!c || d === n) return e;
116
+ if (d < n) {
117
+ const f = (n - d) / c;
118
+ return e.map((y, C) => s[C] ? y + f : y);
51
119
  }
52
- const m = e.map((p, h) => r[h] ? p - t[h] : 0), b = m.reduce((p, h) => p + h, 0);
53
- if (!b) return e;
54
- const f = u - a;
55
- return e.map((p, h) => p - f * (m[h] / b));
56
- }, jt = (e, t, a = [], r = 0, u = At) => {
120
+ const p = e.map((f, y) => s[y] ? f - t[y] : 0), h = p.reduce((f, y) => f + y, 0);
121
+ if (!h) return e;
122
+ const l = d - n;
123
+ return e.map((f, y) => f - l * (p[y] / h));
124
+ }, un = (e, t, n = [], s = 0, d = ln) => {
57
125
  if (!t.length)
58
- return { heights: [], mins: [], sizes: [], minSize: 2, height: r };
59
- const l = t.filter((g) => !a.includes(g)).length, m = (t.length - l) * Ge, b = r && l ? Math.min(
60
- u,
126
+ return { heights: [], mins: [], sizes: [], minSize: 2, height: s };
127
+ const c = t.filter((S) => !n.includes(S)).length, p = (t.length - c) * at, h = s && c ? Math.min(
128
+ d,
61
129
  Math.max(
62
- Be,
63
- Math.floor((r - m) / l)
130
+ st,
131
+ Math.floor((s - p) / c)
64
132
  )
65
- ) : u, f = Ot(t, a), p = t.map(
66
- (g, i) => a.includes(g) ? f[i] : Math.max(e[g] ?? b, f[i])
67
- ), h = t.map((g) => !a.includes(g)), w = f.reduce((g, i) => g + i, 0), d = h.some(Boolean) ? Math.max(r, w) : w, S = Nt(p, f, d, h);
133
+ ) : d, l = cn(t, n), f = t.map(
134
+ (S, r) => n.includes(S) ? l[r] : Math.max(e[S] ?? h, l[r])
135
+ ), y = t.map((S) => !n.includes(S)), C = l.reduce((S, r) => S + r, 0), m = y.some(Boolean) ? Math.max(s, C) : C, g = dn(f, l, m, y);
68
136
  return {
69
- heights: S,
70
- mins: f,
71
- sizes: S.map((g) => g / d * 100),
137
+ heights: g,
138
+ mins: l,
139
+ sizes: g.map((S) => S / m * 100),
72
140
  // primereact must allow the drag past the min; clampDraggedHeights puts it back
73
141
  minSize: 2,
74
- height: d
142
+ height: m
75
143
  };
76
- }, Ft = (e, t, a) => {
77
- const r = e.map((f, p) => Math.max(f / 100 * t, a[p])), u = Math.max(
144
+ }, pn = (e, t, n) => {
145
+ const s = e.map((l, f) => Math.max(l / 100 * t, n[f])), d = Math.max(
78
146
  t,
79
- a.reduce((f, p) => f + p, 0)
80
- ), l = r.reduce((f, p) => f + p, 0) - u;
81
- if (l <= 0) return r;
82
- const m = r.map((f, p) => f - a[p]), b = m.reduce((f, p) => f + p, 0);
83
- return b ? r.map((f, p) => f - l * (m[p] / b)) : r;
84
- }, $t = "slicer-splitter", Me = {
147
+ n.reduce((l, f) => l + f, 0)
148
+ ), c = s.reduce((l, f) => l + f, 0) - d;
149
+ if (c <= 0) return s;
150
+ const p = s.map((l, f) => l - n[f]), h = p.reduce((l, f) => l + f, 0);
151
+ return h ? s.map((l, f) => l - c * (p[f] / h)) : s;
152
+ }, fn = "slicer-splitter", Be = {
85
153
  minSize: 2,
86
154
  size: 12
87
- }, rs = () => {
88
- const [e, t] = He($t, [
89
- Me.size,
90
- 100 - Me.size
155
+ }, Fs = () => {
156
+ const [e, t] = Xe(fn, [
157
+ Be.size,
158
+ 100 - Be.size
91
159
  ]);
92
- return [e, (r) => {
93
- t(r.sizes);
160
+ return [e, (s) => {
161
+ t(s.sizes);
94
162
  }];
95
- }, zt = (e, t, a = [], r = 0) => {
96
- const [u, l] = He(
163
+ }, mn = (e, t, n = [], s = 0) => {
164
+ const [d, c] = Xe(
97
165
  `slicer-panel-heights-${e}`,
98
166
  {}
99
- ), [m, b] = U(0), f = Array.isArray(u) ? {} : u, {
100
- sizes: p,
101
- mins: h,
102
- minSize: w,
103
- height: d,
104
- heights: S
105
- } = jt(f, t, a, r), g = (i) => {
106
- const c = Ft(i.sizes, d, h);
107
- l({
108
- ...f,
167
+ ), [p, h] = z(0), l = Array.isArray(d) ? {} : d, {
168
+ sizes: f,
169
+ mins: y,
170
+ minSize: C,
171
+ height: m,
172
+ heights: g
173
+ } = un(l, t, n, s), S = (r) => {
174
+ const u = pn(r.sizes, m, y);
175
+ c({
176
+ ...l,
109
177
  ...Object.fromEntries(
110
- t.map((o, y) => [o, c[y]]).filter(([o]) => !a.includes(o))
178
+ t.map((i, b) => [i, u[b]]).filter(([i]) => !n.includes(i))
111
179
  )
112
- }), c.some(
113
- (o, y) => Math.abs(o - i.sizes[y] / 100 * d) > 1
114
- ) && b((o) => o + 1);
180
+ }), u.some(
181
+ (i, b) => Math.abs(i - r.sizes[b] / 100 * m) > 1
182
+ ) && h((i) => i + 1);
115
183
  };
116
184
  return {
117
- sizes: p,
118
- minSize: w,
119
- height: d,
120
- panelHeights: S,
121
- layoutKey: `${t.join("|")}#${a.join("|")}#${m}`,
122
- handleResizeEnd: g
185
+ sizes: f,
186
+ minSize: C,
187
+ height: m,
188
+ panelHeights: g,
189
+ layoutKey: `${t.join("|")}#${n.join("|")}#${p}`,
190
+ handleResizeEnd: S
123
191
  };
124
- }, Ut = ({
192
+ }, hn = ({
125
193
  projectName: e,
126
194
  movingEntities: t,
127
- onClose: a,
128
- onMoveComplete: r
195
+ onClose: n,
196
+ onMoveComplete: s
129
197
  }) => {
130
- const [u] = Ve(), l = nt(), { folders: m } = Ce(), b = l?.tableData || [], f = A(
131
- (g) => l?.getEntityById(g) || m.find((i) => i.id === g),
132
- [m, l]
133
- ), p = A(
134
- async (g) => {
135
- if (!t || g.length === 0) return;
136
- const i = g[0];
198
+ const [d] = Je(), c = bt(), { folders: p } = Pe(), h = c?.tableData || [], l = N(
199
+ (S) => c?.getEntityById(S) || p.find((r) => r.id === S),
200
+ [p, c]
201
+ ), f = N(
202
+ async (S) => {
203
+ if (!t || S.length === 0) return;
204
+ const r = S[0];
137
205
  try {
138
- const c = t.entities.map(
139
- (y, n) => ({
140
- id: `move-${y.entityId}-${Date.now()}-${n}`,
206
+ const u = t.entities.map(
207
+ (b, a) => ({
208
+ id: `move-${b.entityId}-${Date.now()}-${a}`,
141
209
  type: "update",
142
- entityType: y.entityType,
143
- entityId: y.entityId,
144
- data: y.entityType === "folder" ? { parentId: i } : { folderId: i }
210
+ entityType: b.entityType,
211
+ entityId: b.entityId,
212
+ data: b.entityType === "folder" ? { parentId: r } : { folderId: r }
145
213
  })
146
- ), o = (await u({
214
+ ), i = (await d({
147
215
  projectName: e,
148
216
  operationsRequestModel: {
149
- operations: c
217
+ operations: u
150
218
  }
151
- }).unwrap())?.operations?.filter((y) => y.success === !1) || [];
152
- if (o.length > 0) {
153
- const y = o.map((n) => n.detail).join(", ");
154
- throw new Error(y || "Some move operations failed");
219
+ }).unwrap())?.operations?.filter((b) => b.success === !1) || [];
220
+ if (i.length > 0) {
221
+ const b = i.map((a) => a.detail).join(", ");
222
+ throw new Error(b || "Some move operations failed");
155
223
  }
156
- r?.(i);
157
- } catch (c) {
158
- let s = Re(c) || "Failed to move entities";
159
- if (s.includes("already exists"))
224
+ s?.(r);
225
+ } catch (u) {
226
+ let o = ze(u) || "Failed to move entities";
227
+ if (o.includes("already exists"))
160
228
  if (t.entities.length > 1)
161
- s = "Cannot move some entities - one or more entities with the same name already exist in the target location";
229
+ o = "Cannot move some entities - one or more entities with the same name already exist in the target location";
162
230
  else if (t.entities[0].entityType === "task") {
163
- const y = s.match(/name '.*?, (.+?)' already exists/);
164
- s = `Cannot move "${y ? y[1] : "this task"}" - a task with this name already exists in the target folder`;
231
+ const b = o.match(/name '.*?, (.+?)' already exists/);
232
+ o = `Cannot move "${b ? b[1] : "this task"}" - a task with this name already exists in the target folder`;
165
233
  } else {
166
- const y = s.match(/name '.*?, (.+?)' already exists/);
167
- s = `Cannot move "${y ? y[1] : "this folder"}" - a folder with this name already exists in the target location`;
234
+ const b = o.match(/name '.*?, (.+?)' already exists/);
235
+ o = `Cannot move "${b ? b[1] : "this folder"}" - a folder with this name already exists in the target location`;
168
236
  }
169
- ke.error(s);
237
+ $e.error(o);
170
238
  } finally {
171
- a();
239
+ n();
172
240
  }
173
241
  },
174
- [t, e, u, a, r]
175
- ), h = A(async () => {
242
+ [t, e, d, n, s]
243
+ ), y = N(async () => {
176
244
  if (t)
177
245
  try {
178
- const g = t.entities.map(
179
- (s, o) => ({
180
- id: `move-to-root-${s.entityId}-${Date.now()}-${o}`,
246
+ const S = t.entities.map(
247
+ (o, i) => ({
248
+ id: `move-to-root-${o.entityId}-${Date.now()}-${i}`,
181
249
  type: "update",
182
- entityType: s.entityType,
183
- entityId: s.entityId,
184
- data: s.entityType === "folder" ? { parentId: null } : { folderId: null }
250
+ entityType: o.entityType,
251
+ entityId: o.entityId,
252
+ data: o.entityType === "folder" ? { parentId: null } : { folderId: null }
185
253
  })
186
- ), c = (await u({
254
+ ), u = (await d({
187
255
  projectName: e,
188
256
  operationsRequestModel: {
189
- operations: g
257
+ operations: S
190
258
  }
191
- }).unwrap())?.operations?.filter((s) => s.success === !1) || [];
192
- if (c.length > 0) {
193
- const s = c.map((o) => o.detail).join(", ");
194
- throw new Error(s || "Some move operations failed");
259
+ }).unwrap())?.operations?.filter((o) => o.success === !1) || [];
260
+ if (u.length > 0) {
261
+ const o = u.map((i) => i.detail).join(", ");
262
+ throw new Error(o || "Some move operations failed");
195
263
  }
196
- } catch (g) {
197
- let i = Re(g) || "Failed to move entities to root";
198
- ke.error(i);
264
+ } catch (S) {
265
+ let r = ze(S) || "Failed to move entities to root";
266
+ $e.error(r);
199
267
  } finally {
200
- a();
268
+ n();
201
269
  }
202
- }, [t, e, u, a]), w = A(() => {
270
+ }, [t, e, d, n]), C = N(() => {
203
271
  if (!t) return [];
204
- const g = [];
205
- return t.entities.forEach((i) => {
206
- g.push(i.entityId);
207
- }), m.forEach((i) => {
208
- t.entities.some((s) => {
209
- const o = f(s.entityId);
210
- return o?.name ? b.filter((n) => s.entityType === "folder" ? n.entityType === "folder" && n.parentId === i.id : s.entityType === "task" ? n.entityType === "task" && n.folderId === i.id : !1).some(
211
- (n) => n.name === o.name && n.entityId !== s.entityId
272
+ const S = [];
273
+ return t.entities.forEach((r) => {
274
+ S.push(r.entityId);
275
+ }), p.forEach((r) => {
276
+ t.entities.some((o) => {
277
+ const i = l(o.entityId);
278
+ return i?.name ? h.filter((a) => o.entityType === "folder" ? a.entityType === "folder" && a.parentId === r.id : o.entityType === "task" ? a.entityType === "task" && a.folderId === r.id : !1).some(
279
+ (a) => a.name === i.name && a.entityId !== o.entityId
212
280
  ) : !1;
213
- }) && g.push(i.id);
214
- }), [...new Set(g)];
215
- }, [t, m, b, f]), d = A(
216
- (g) => {
281
+ }) && S.push(r.id);
282
+ }), [...new Set(S)];
283
+ }, [t, p, h, l]), m = N(
284
+ (S) => {
217
285
  if (!t) return;
218
286
  if (t.entities.some(
219
- (y) => y.entityType === "folder" && y.entityId === g
287
+ (b) => b.entityType === "folder" && b.entityId === S
220
288
  ))
221
289
  return "Cannot move folder to itself";
222
290
  if (t.entities.some(
223
- (y) => y.currentParentId === g
291
+ (b) => b.currentParentId === S
224
292
  ))
225
293
  return "Cannot move to the same location";
226
- const s = m.find((y) => y.id === g);
227
- if (s) {
228
- const y = t.entities.find((n) => {
229
- const x = f(n.entityId);
230
- return x?.name ? b.filter((v) => n.entityType === "folder" ? v.entityType === "folder" && v.parentId === s.id : n.entityType === "task" ? v.entityType === "task" && v.folderId === s.id : !1).some(
231
- (v) => v.name === x.name && v.entityId !== n.entityId
294
+ const o = p.find((b) => b.id === S);
295
+ if (o) {
296
+ const b = t.entities.find((a) => {
297
+ const x = l(a.entityId);
298
+ return x?.name ? h.filter((v) => a.entityType === "folder" ? v.entityType === "folder" && v.parentId === o.id : a.entityType === "task" ? v.entityType === "task" && v.folderId === o.id : !1).some(
299
+ (v) => v.name === x.name && v.entityId !== a.entityId
232
300
  ) : !1;
233
301
  });
234
- if (y)
235
- return `Cannot move "${f(y.entityId)?.name || "Entity"}" - an entity with the same name already exists in this folder`;
302
+ if (b)
303
+ return `Cannot move "${l(b.entityId)?.name || "Entity"}" - an entity with the same name already exists in this folder`;
236
304
  }
237
305
  return t.entities.some(
238
- (y) => y.entityType === "folder"
306
+ (b) => b.entityType === "folder"
239
307
  ) ? "Cannot move folder to its child" : "Cannot move to this location";
240
308
  },
241
- [t, m, b, f]
242
- ), S = O(() => t?.entities.every((g) => g.entityType === "folder") || !1, [t]);
309
+ [t, p, h, l]
310
+ ), g = M(() => t?.entities.every((S) => S.entityType === "folder") || !1, [t]);
243
311
  return {
244
- handleMoveSubmit: p,
245
- handleMoveToRoot: h,
246
- getDisabledFolderIds: w,
247
- getDisabledMessage: d,
248
- canMoveToRoot: S
312
+ handleMoveSubmit: f,
313
+ handleMoveToRoot: y,
314
+ getDisabledFolderIds: C,
315
+ getDisabledMessage: m,
316
+ canMoveToRoot: g
249
317
  };
250
- }, Vt = ({
318
+ }, gn = ({
251
319
  projectName: e,
252
320
  movingEntities: t,
253
- onClose: a,
254
- onMoveComplete: r
321
+ onClose: n,
322
+ onMoveComplete: s
255
323
  }) => {
256
- const { handleMoveSubmit: u, handleMoveToRoot: l, getDisabledFolderIds: m, getDisabledMessage: b } = Ut({
324
+ const { handleMoveSubmit: d, handleMoveToRoot: c, getDisabledFolderIds: p, getDisabledMessage: h } = hn({
257
325
  projectName: e,
258
326
  movingEntities: t ?? null,
259
- onClose: a,
260
- onMoveComplete: r
327
+ onClose: n,
328
+ onMoveComplete: s
261
329
  });
262
330
  return t?.entities.length ? /* @__PURE__ */ E(
263
- St,
331
+ Pt,
264
332
  {
265
333
  projectName: e,
266
334
  entityType: "folder",
267
- onSubmit: u,
268
- onClose: a,
335
+ onSubmit: d,
336
+ onClose: n,
269
337
  showMoveToRoot: t.entities.every(
270
- (f) => f.entityType === "folder"
338
+ (l) => l.entityType === "folder"
271
339
  ),
272
- onMoveToRoot: l,
273
- disabledIds: m(),
274
- getDisabledMessage: b
340
+ onMoveToRoot: c,
341
+ disabledIds: p(),
342
+ getDisabledMessage: h
275
343
  }
276
344
  ) : null;
277
- }, Ht = ({ projectName: e, useExtraSlices: t }) => {
278
- const [a, { isLoading: r, isFetching: u }] = dt(), { formatAssignees: l } = t();
345
+ }, yn = ({ projectName: e, useExtraSlices: t }) => {
346
+ const [n, { isLoading: s, isFetching: d }] = wt(), { formatAssignees: c } = t();
279
347
  return {
280
348
  getData: async () => {
281
- const b = await a({ projectName: e || "" }, !0).unwrap();
282
- return l(b);
349
+ const h = await n({ projectName: e || "" }, !0).unwrap();
350
+ return c(h);
283
351
  },
284
- isLoading: r || u
352
+ isLoading: s || d
285
353
  };
286
- }, Bt = ({ scopes: e, useExtraSlices: t }) => {
287
- const { isLoading: a, productTypes: r, ...u } = ue(), { formatStatuses: l, formatTaskTypes: m, formatProductTypes: b, formatTypes: f, formatAttribute: p } = t();
288
- return { project: u, getStatuses: async () => l(u, e), getTypes: async () => f(u), getTaskTypes: async () => m(u), getProductTypes: async () => b(r), getAttribute: async (i) => p ? p(i).map(
289
- (c) => rt(c.icon ?? void 0) ? { ...c, icon: void 0, img: c.icon, imgShape: "circle" } : c
290
- ) : void 0, isLoading: a };
291
- }, Gt = ({ entityTypes: e, request: t }) => {
354
+ }, bn = ({ scopes: e, useExtraSlices: t }) => {
355
+ const { isLoading: n, productTypes: s, ...d } = me(), { formatStatuses: c, formatTaskTypes: p, formatProductTypes: h, formatTypes: l, formatAttribute: f } = t();
356
+ return { project: d, getStatuses: async () => c(d, e), getTypes: async () => l(d), getTaskTypes: async () => p(d), getProductTypes: async () => h(s), getAttribute: async (r) => f ? f(r).map(
357
+ (u) => xt(u.icon ?? void 0) ? { ...u, icon: void 0, img: u.icon, imgShape: "circle" } : u
358
+ ) : void 0, isLoading: n };
359
+ }, Sn = ({ entityTypes: e, request: t }) => {
292
360
  const {
293
- attributes: a,
294
- isLoading: { siteInfo: r }
295
- } = ft(), u = Ye(st), l = u?.attribFields?.length ? u.attribFields : a, { projectName: m } = ue();
296
- return { attributes: Lt(l, { projectName: m, request: t ?? [] }).filter((p) => Ue(p.data)).filter((p) => e.some((h) => p.scope?.includes(h))).map(
297
- (p) => p.data.enum?.some((h) => h.hidden) ? { ...p, data: { ...p.data, enum: lt(p.data.enum) } } : p
298
- ), isLoading: r };
299
- }, Kt = "snippet_folder", de = "folder", Wt = (e) => `${de}-${e}`, _e = (e) => e.entityListType === "review-session" ? "subscriptions" : ge(e.entityType), ve = (e) => [...e].sort((t, a) => {
300
- if (t.active && !a.active) return -1;
301
- if (!t.active && a.active) return 1;
302
- const r = new Date(t.createdAt || 0);
303
- return new Date(a.createdAt || 0).getTime() - r.getTime();
304
- }), qt = (e = !0) => {
305
- const { projectName: t } = ue(), { powerLicense: a } = we(), {
306
- data: r,
307
- isLoading: u,
308
- isFetching: l
309
- } = ut(
361
+ attributes: n,
362
+ isLoading: { siteInfo: s }
363
+ } = Rt(), d = pt(St), c = d?.attribFields?.length ? d.attribFields : n, { projectName: p } = me();
364
+ return { attributes: Ht(c, { projectName: p, request: t ?? [] }).filter((f) => Qe(f.data)).filter((f) => e.some((y) => f.scope?.includes(y))).map(
365
+ (f) => f.data.enum?.some((y) => y.hidden) ? { ...f, data: { ...f.data, enum: Ct(f.data.enum) } } : f
366
+ ), isLoading: s };
367
+ }, Tn = "snippet_folder", fe = "folder", vn = (e) => `${fe}-${e}`, ke = (e) => [...e].sort((t, n) => {
368
+ if (t.active && !n.active) return -1;
369
+ if (!t.active && n.active) return 1;
370
+ const s = new Date(t.createdAt || 0);
371
+ return new Date(n.createdAt || 0).getTime() - s.getTime();
372
+ }), In = (e = !0) => {
373
+ const { projectName: t } = me(), { powerLicense: n } = Oe(), {
374
+ data: s,
375
+ isLoading: d,
376
+ isFetching: c
377
+ } = Et(
310
378
  { projectName: t || "" },
311
379
  {
312
380
  initialPageParam: { cursor: "" },
313
381
  skip: !t || !e
314
382
  }
315
- ), { data: m = [], isLoading: b } = pt(
383
+ ), { data: p = [], isLoading: h } = Dt(
316
384
  { projectName: t || "" },
317
- { skip: !t || !a || !e }
318
- ), f = O(() => {
319
- if (!r?.pages) return [];
320
- const w = r.pages.flatMap((d) => d.lists);
321
- if (a && m.length > 0) {
322
- const d = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Set();
323
- for (const n of m)
324
- d.set(n.id, {
325
- id: n.id,
326
- folder: n,
385
+ { skip: !t || !n || !e }
386
+ ), l = M(() => {
387
+ if (!s?.pages) return [];
388
+ const C = s.pages.flatMap((m) => m.lists);
389
+ if (n && p.length > 0) {
390
+ const m = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Set();
391
+ for (const a of p)
392
+ m.set(a.id, {
393
+ id: a.id,
394
+ folder: a,
327
395
  children: /* @__PURE__ */ new Map(),
328
396
  items: [],
329
397
  hasAnyItems: !1
330
- }), n.parentId || S.add(n.id);
331
- for (const n of m)
332
- if (n.parentId && d.has(n.parentId)) {
333
- const x = d.get(n.parentId), T = d.get(n.id);
334
- x.children.set(n.id, T);
398
+ }), a.parentId || g.add(a.id);
399
+ for (const a of p)
400
+ if (a.parentId && m.has(a.parentId)) {
401
+ const x = m.get(a.parentId), T = m.get(a.id);
402
+ x.children.set(a.id, T);
335
403
  }
336
- const g = [];
337
- for (const n of w) {
338
- const x = n.entityListFolderId;
339
- if (x && d.has(x)) {
340
- const T = d.get(x);
341
- T.items.push(n), T.hasAnyItems = !0;
404
+ const S = [];
405
+ for (const a of C) {
406
+ const x = a.entityListFolderId;
407
+ if (x && m.has(x)) {
408
+ const T = m.get(x);
409
+ T.items.push(a), T.hasAnyItems = !0;
342
410
  } else
343
- g.push(n);
411
+ S.push(a);
344
412
  }
345
- for (const n of d.values())
346
- if (n.hasAnyItems) {
347
- let x = n.folder;
413
+ for (const a of m.values())
414
+ if (a.hasAnyItems) {
415
+ let x = a.folder;
348
416
  for (; x.parentId; ) {
349
- const T = d.get(x.parentId);
417
+ const T = m.get(x.parentId);
350
418
  if (T)
351
419
  T.hasAnyItems = !0, x = T.folder;
352
420
  else
353
421
  break;
354
422
  }
355
423
  }
356
- const i = (n, x, T = []) => ({
357
- id: n.id,
358
- name: n.label,
359
- label: n.label,
424
+ const r = (a, x, T = []) => ({
425
+ id: a.id,
426
+ name: a.label,
427
+ label: a.label,
360
428
  ...T.length > 0 && { parents: T },
361
- icon: _e(n),
429
+ icon: Ue(a),
362
430
  subRows: [],
363
431
  data: {
364
- id: n.id,
365
- name: n.label,
366
- label: n.label,
367
- entityType: n.entityType,
368
- listId: n.id
432
+ id: a.id,
433
+ name: a.label,
434
+ label: a.label,
435
+ entityType: a.entityType,
436
+ listId: a.id,
437
+ // for sorting
438
+ active: a.active,
439
+ createdAt: a.createdAt,
440
+ updatedAt: a.updatedAt
369
441
  }
370
- }), c = (n) => n.sort((x, T) => {
371
- const v = m.findIndex((H) => H.id === x.id), D = m.findIndex((H) => H.id === T.id);
442
+ }), u = (a) => a.sort((x, T) => {
443
+ const v = p.findIndex((K) => K.id === x.id), D = p.findIndex((K) => K.id === T.id);
372
444
  return v === -1 && D === -1 ? x.folder.label.localeCompare(T.folder.label) : v === -1 ? 1 : D === -1 ? -1 : v - D;
373
- }), s = (n) => {
374
- const x = n.items.map((T) => T.id);
375
- for (const T of n.children.values())
376
- x.push(...s(T));
445
+ }), o = (a) => {
446
+ const x = a.items.map((T) => T.id);
447
+ for (const T of a.children.values())
448
+ x.push(...o(T));
377
449
  return x;
378
- }, o = Dt({
379
- folderNodes: d,
380
- rootFolderIds: S,
450
+ }, i = Wt({
451
+ folderNodes: m,
452
+ rootFolderIds: g,
381
453
  showEmptyFolders: !1,
382
- buildFolderRowId: Wt,
383
- createItemRow: i,
384
- sortFolderNodes: c,
385
- sortItems: ve,
386
- getFolderLabel: (n) => n.label,
387
- getFolderIcon: (n) => n.data?.icon || Kt,
388
- getFolderColor: (n) => n.data?.color,
389
- getItemCount: (n) => n.items.length + Array.from(n.children.values()).reduce((x, T) => x + T.items.length, 0)
454
+ buildFolderRowId: vn,
455
+ createItemRow: r,
456
+ sortFolderNodes: u,
457
+ sortItems: ke,
458
+ getFolderLabel: (a) => a.label,
459
+ getFolderIcon: (a) => a.data?.icon || Tn,
460
+ getFolderColor: (a) => a.data?.color,
461
+ getItemCount: (a) => a.items.length + Array.from(a.children.values()).reduce((x, T) => x + T.items.length, 0)
390
462
  });
391
- for (const n of o) {
392
- if (n.id.startsWith(de + "-")) {
393
- const T = n.id.substring((de + "-").length), v = d.get(T);
394
- v && (n.data = { ...n.data, childListIds: s(v) });
463
+ for (const a of i) {
464
+ if (a.id.startsWith(fe + "-")) {
465
+ const T = a.id.substring((fe + "-").length), v = m.get(T);
466
+ v && (a.data = { ...a.data, childListIds: o(v) });
395
467
  }
396
- const x = [...n.subRows || []];
468
+ const x = [...a.subRows || []];
397
469
  for (; x.length > 0; ) {
398
470
  const T = x.shift();
399
- if (T.id.startsWith(de + "-")) {
400
- const v = T.id.substring((de + "-").length), D = d.get(v);
401
- D && (T.data = { ...T.data, childListIds: s(D) });
471
+ if (T.id.startsWith(fe + "-")) {
472
+ const v = T.id.substring((fe + "-").length), D = m.get(v);
473
+ D && (T.data = { ...T.data, childListIds: o(D) });
402
474
  }
403
475
  T.subRows && x.push(...T.subRows);
404
476
  }
405
477
  }
406
- const y = ve(g).map((n) => i(n));
407
- return [...o, ...y];
478
+ const b = ke(S).map((a) => r(a));
479
+ return [...i, ...b];
408
480
  }
409
- return ve(w).map((d) => ({
410
- id: d.id,
411
- name: d.label,
412
- label: d.label,
413
- icon: _e(d),
481
+ return ke(C).map((m) => ({
482
+ id: m.id,
483
+ name: m.label,
484
+ label: m.label,
485
+ icon: Ue(m),
414
486
  subRows: [],
415
487
  data: {
416
- id: d.id,
417
- name: d.label,
418
- label: d.label,
419
- entityType: d.entityType,
420
- listId: d.id
488
+ id: m.id,
489
+ name: m.label,
490
+ label: m.label,
491
+ entityType: m.entityType,
492
+ listId: m.id,
493
+ active: m.active,
494
+ createdAt: m.createdAt,
495
+ updatedAt: m.updatedAt
421
496
  }
422
497
  }));
423
- }, [r, a, m]), p = a && m.length > 0;
498
+ }, [s, n, p]), f = n && p.length > 0;
424
499
  return {
425
- getData: A(async () => f, [f]),
426
- isLoading: u || l || b,
427
- isExpandable: p
500
+ getData: N(async () => l, [l]),
501
+ isLoading: d || c || h,
502
+ isExpandable: f
428
503
  };
429
- }, Qt = (e, t, a, r) => e.id === "noValue" ? t.get(ze)?.count ?? (r ? 0 : void 0) : e.id === "hasValue" ? r ? a : void 0 : t.get(e.id)?.count ?? (e.name ? t.get(e.name)?.count : void 0) ?? (r ? 0 : void 0), Ke = (e, t, a, r) => t ? e.map((u) => {
430
- const l = Qt(u, t, a, r);
504
+ }, xn = (e, t, n, s) => e.id === "noValue" ? t.get(Ye)?.count ?? (s ? 0 : void 0) : e.id === "hasValue" ? s ? n : void 0 : t.get(e.id)?.count ?? (e.name ? t.get(e.name)?.count : void 0) ?? (s ? 0 : void 0), ot = (e, t, n, s) => t ? e.map((d) => {
505
+ const c = xn(d, t, n, s);
431
506
  return {
432
- ...u,
433
- badge: l != null ? String(l) : u.badge,
434
- subRows: u.subRows?.length ? Ke(u.subRows, t, a, r) : u.subRows
507
+ ...d,
508
+ badge: c != null ? String(c) : d.badge,
509
+ subRows: d.subRows?.length ? ot(d.subRows, t, n, s) : d.subRows
435
510
  };
436
- }) : e, Yt = (e) => ({
511
+ }) : e, Cn = (e) => ({
437
512
  id: "noValue",
438
513
  name: "noValue",
439
514
  label: `No ${e}`,
@@ -442,7 +517,7 @@ const At = 180, Be = 100, Ge = 34, Ot = (e, t = [], a = Be) => e.map((r) => t.in
442
517
  data: {
443
518
  id: "noValue"
444
519
  }
445
- }), Jt = (e) => ({
520
+ }), Ln = (e) => ({
446
521
  id: "hasValue",
447
522
  name: "hasValue",
448
523
  label: `Some ${e}`,
@@ -451,7 +526,7 @@ const At = 180, Be = 100, Ge = 34, Ot = (e, t = [], a = Be) => e.map((r) => t.in
451
526
  data: {
452
527
  id: "hasValue"
453
528
  }
454
- }), Ae = [
529
+ }), He = [
455
530
  {
456
531
  label: "Hierarchy",
457
532
  value: "hierarchy",
@@ -470,17 +545,17 @@ const At = 180, Be = 100, Ge = 34, Ot = (e, t = [], a = Be) => e.map((r) => t.in
470
545
  {
471
546
  label: "Task Type",
472
547
  value: "taskType",
473
- icon: ge("task")
548
+ icon: Ee("task")
474
549
  },
475
550
  {
476
551
  label: "Folder Type",
477
552
  value: "folderType",
478
- icon: ge("folder")
553
+ icon: Ee("folder")
479
554
  },
480
555
  {
481
556
  label: "Product Type",
482
557
  value: "productType",
483
- icon: ge("product")
558
+ icon: Ee("product")
484
559
  },
485
560
  {
486
561
  label: "Author",
@@ -492,187 +567,191 @@ const At = 180, Be = 100, Ge = 34, Ot = (e, t = [], a = Be) => e.map((r) => t.in
492
567
  value: "entityList",
493
568
  icon: "list_alt"
494
569
  }
495
- ], Xt = ({
570
+ ], wn = ({
496
571
  sliceFields: e,
497
572
  usedSliceTypes: t = [],
498
- entityTypes: a = [],
499
- counts: r,
500
- filled: u = 0,
501
- countsComplete: l = !1,
502
- sliceType: m,
503
- onSliceTypeChange: b
573
+ entityTypes: n = [],
574
+ counts: s,
575
+ filled: d = 0,
576
+ countsComplete: c = !1,
577
+ sliceType: p,
578
+ onSliceTypeChange: h,
579
+ sort: l
504
580
  }) => {
505
581
  const {
506
582
  sliceType: f,
507
- onSliceTypeChange: p,
508
- useExtraSlices: h,
509
- isLoadingExtraSlices: w
510
- } = Ie(), d = m ?? f, S = b ?? p, { projectName: g } = ue(), { formatAttribute: i } = h(), c = e.filter((C) => Ae.some((R) => R.value === C.value)).map((C) => ({
511
- ...Ae.find((_) => _.value === C.value),
512
- ...C
513
- })), s = e.some((C) => C.value === "attributes"), o = d?.startsWith("attrib.") ? d.slice(7) : void 0, y = O(
514
- () => o ? [o] : [],
515
- [o]
516
- ), { attributes: n, isLoading: x } = Gt({
517
- entityTypes: a,
518
- request: y
583
+ onSliceTypeChange: y,
584
+ useExtraSlices: C,
585
+ isLoadingExtraSlices: m
586
+ } = Me(), g = p ?? f, S = h ?? y, { projectName: r } = me(), { formatAttribute: u } = C(), o = e.filter((I) => He.some((A) => A.value === I.value)).map((I) => ({
587
+ ...He.find((O) => O.value === I.value),
588
+ ...I
589
+ })), i = e.some((I) => I.value === "attributes"), b = g?.startsWith("attrib.") ? g.slice(7) : void 0, a = M(
590
+ () => b ? [b] : [],
591
+ [b]
592
+ ), { attributes: x, isLoading: T } = Sn({
593
+ entityTypes: n,
594
+ request: a
519
595
  });
520
- s && typeof i == "function" && n.forEach(
521
- (C) => c.push({
522
- label: C.data.title || C.name,
523
- value: "attrib." + C.name,
524
- icon: wt(C.name, C.data.type, Ue(C.data))
596
+ i && typeof u == "function" && x.forEach(
597
+ (I) => o.push({
598
+ label: I.data.title || I.name,
599
+ value: "attrib." + I.name,
600
+ icon: Bt(I.name, I.data.type, Qe(I.data))
525
601
  })
526
602
  );
527
- const [T, v] = U(!1), H = !!n.find((C) => C.name === o)?.enumIsLoading, {
603
+ const [v, D] = z(!1), ae = !!x.find((I) => I.name === b)?.enumIsLoading, {
528
604
  project: oe,
529
- getStatuses: ae,
530
- getTypes: q,
531
- getTaskTypes: ie,
532
- getProductTypes: Z,
605
+ getStatuses: Z,
606
+ getTypes: ie,
607
+ getTaskTypes: re,
608
+ getProductTypes: q,
533
609
  getAttribute: ee,
534
- isLoading: B
535
- } = Bt({ scopes: a, useExtraSlices: h }), {
536
- data: te,
537
- getData: Q,
538
- isFetching: Y
539
- } = Tt({
540
- projectName: g || "",
610
+ isLoading: V
611
+ } = bn({ scopes: n, useExtraSlices: C }), {
612
+ data: le,
613
+ getData: te,
614
+ isFetching: L
615
+ } = Ot({
616
+ projectName: r || "",
541
617
  folderTypes: oe?.folderTypes || [],
542
618
  includeColors: !0
543
- }), { getData: I, isLoading: k } = Ht({
544
- projectName: g,
545
- useExtraSlices: h
619
+ }), { getData: R, isLoading: k } = yn({
620
+ projectName: r,
621
+ useExtraSlices: C
546
622
  }), {
547
- getData: P,
548
- isLoading: K,
549
- isExpandable: re
550
- } = qt(d === "entityList"), F = Y || B || k || w && d !== "hierarchy" || K && d === "entityList" || x || H, N = {
623
+ getData: Q,
624
+ isLoading: he,
625
+ isExpandable: xe
626
+ } = In(g === "entityList"), J = L || V || k || m && g !== "hierarchy" || he && g === "entityList" || T || ae, B = {
551
627
  hierarchy: {
552
- getData: Q,
553
- isLoading: Y,
628
+ getData: te,
629
+ isLoading: L,
554
630
  isExpandable: !0
555
631
  },
556
632
  assignees: {
557
- getData: I,
633
+ getData: R,
558
634
  isLoading: k,
559
635
  isExpandable: !1,
560
636
  noValue: !0,
561
637
  hasValue: !0
562
638
  },
563
639
  author: {
564
- getData: I,
640
+ getData: R,
565
641
  isLoading: k,
566
642
  isExpandable: !1
567
643
  },
568
644
  status: {
569
- getData: ae,
570
- isLoading: B,
645
+ getData: Z,
646
+ isLoading: V,
571
647
  isExpandable: !1
572
648
  },
573
649
  type: {
574
- getData: q,
575
- isLoading: B,
650
+ getData: ie,
651
+ isLoading: V,
576
652
  isExpandable: !0
577
653
  },
578
654
  taskType: {
579
- getData: ie,
580
- isLoading: B,
655
+ getData: re,
656
+ isLoading: V,
581
657
  isExpandable: !1
582
658
  },
583
659
  productType: {
584
- getData: Z,
660
+ getData: q,
585
661
  isLoading: !1,
586
662
  isExpandable: !1
587
663
  },
588
664
  entityList: {
589
- getData: P,
590
- isLoading: K,
591
- isExpandable: re
665
+ getData: Q,
666
+ isLoading: he,
667
+ isExpandable: xe
592
668
  }
593
669
  };
594
- for (const C of n)
595
- N["attrib." + C.name] = {
596
- getData: () => ee(C),
597
- isLoading: x || !!C.enumIsLoading,
670
+ for (const I of x)
671
+ B["attrib." + I.name] = {
672
+ getData: () => ee(I),
673
+ isLoading: T || !!I.enumIsLoading,
598
674
  isExpandable: !1,
599
675
  isAttribute: !0
600
676
  };
601
- const pe = { data: [], isExpandable: !1 }, [le, fe] = U(pe), $ = N[d], ne = c.find(
602
- (C) => N[C.value] && !t.includes(C.value)
677
+ const Y = { data: [], isExpandable: !1 }, [P, ge] = z(Y), G = B[g], ne = o.find(
678
+ (I) => B[I.value] && !t.includes(I.value)
603
679
  )?.value;
604
680
  se(() => {
605
- F || $ || !ne || S(ne, !1);
606
- }, [F, $, ne]);
607
- const z = (C, R) => {
608
- const _ = N[C];
609
- if (!_) {
610
- console.warn(`Slice type ${C} not found`);
681
+ J || G || !ne || S(ne, !1);
682
+ }, [J, G, ne]);
683
+ const ce = (I, A) => {
684
+ const O = B[I];
685
+ if (!O) {
686
+ console.warn(`Slice type ${I} not found`);
611
687
  return;
612
688
  }
613
- (_.isAttribute && s || e.some((ce) => ce.value === C)) && S(C, R);
689
+ (O.isAttribute && i || e.some(($) => $.value === I)) && S(I, A);
614
690
  };
615
691
  se(() => {
616
- if (F) return;
692
+ if (J) return;
617
693
  (async () => {
618
694
  try {
619
- if (!$) return;
620
- v(!0);
621
- const R = await $.getData();
622
- if (R === void 0)
695
+ if (!G) return;
696
+ D(!0);
697
+ const A = await G.getData();
698
+ if (A === void 0)
623
699
  throw window.alert(
624
700
  "Slice options failed to load. This likely means the PowerFeatures addon is out of date. Please update to the latest version."
625
701
  ), S(ne ?? "hierarchy", !1), new Error("Slice data is undefined");
626
- $.hasValue && R.unshift(Jt(d)), $.noValue && R.unshift(Yt(d)), fe({
627
- data: R,
628
- isExpandable: $.isExpandable
702
+ G.hasValue && A.unshift(Ln(g)), G.noValue && A.unshift(Cn(g)), ge({
703
+ data: A,
704
+ isExpandable: G.isExpandable
629
705
  });
630
- } catch (R) {
631
- console.error("Error fetching slice data:", R), fe(pe);
706
+ } catch (A) {
707
+ console.error("Error fetching slice data:", A), ge(Y);
632
708
  } finally {
633
- v(!1);
709
+ D(!1);
634
710
  }
635
711
  })();
636
- }, [d, g, F, d === "hierarchy" ? te : null]);
637
- const j = O(
638
- () => Ke(le.data, r, u, l),
639
- [le.data, r, u, l]
640
- ), Le = O(() => {
641
- const C = /* @__PURE__ */ new Map(), R = [...j];
642
- for (; R.length > 0; ) {
643
- const _ = R.shift();
644
- if (_ && (C.set(_.id, _), _.subRows && _.subRows.length > 0))
645
- for (const ce of _.subRows)
646
- R.push(ce);
712
+ }, [g, r, J, g === "hierarchy" ? le : null]);
713
+ const de = l?.by, F = !!l?.desc, j = M(
714
+ () => de ? on(P.data, g, { by: de, desc: F }) : P.data,
715
+ [P.data, g, de, F]
716
+ ), ye = M(
717
+ () => ot(j, s, d, c),
718
+ [j, s, d, c]
719
+ ), be = M(() => {
720
+ const I = /* @__PURE__ */ new Map(), A = [...ye];
721
+ for (; A.length > 0; ) {
722
+ const O = A.shift();
723
+ if (O && (I.set(O.id, O), O.subRows && O.subRows.length > 0))
724
+ for (const $ of O.subRows)
725
+ A.push($);
647
726
  }
648
- return C;
649
- }, [j]);
727
+ return I;
728
+ }, [ye]);
650
729
  return {
651
- sliceOptions: c,
652
- table: { ...le, data: j },
653
- sliceMap: Le,
654
- isLoading: N[d] && N[d].isLoading || T || F,
655
- sliceType: d,
656
- handleSliceTypeChange: z
730
+ sliceOptions: o,
731
+ table: { ...P, data: ye },
732
+ sliceMap: be,
733
+ isLoading: B[g] && B[g].isLoading || v || J,
734
+ sliceType: g,
735
+ handleSliceTypeChange: ce
657
736
  };
658
- }, Zt = /* @__PURE__ */ new Map(), en = (e, t, a, r) => {
659
- const u = O(() => ({ id: t, desc: !1 }), [t]), l = O(
660
- () => (a ?? []).filter((g) => g !== t).map((g) => ({ id: g, desc: !1 })),
661
- [a, t]
662
- ), m = !!r || !e, b = e?.entity === "version" ? { entity: "version", groupBy: u, extraGroupBys: l, args: e.args, skip: m } : {
737
+ }, En = /* @__PURE__ */ new Map(), Dn = (e, t, n, s) => {
738
+ const d = M(() => ({ id: t, desc: !1 }), [t]), c = M(
739
+ () => (n ?? []).filter((S) => S !== t).map((S) => ({ id: S, desc: !1 })),
740
+ [n, t]
741
+ ), p = !!s || !e, h = e?.entity === "version" ? { entity: "version", groupBy: d, extraGroupBys: c, args: e.args, skip: p } : {
663
742
  entity: "task",
664
- groupBy: u,
665
- extraGroupBys: l,
743
+ groupBy: d,
744
+ extraGroupBys: c,
666
745
  args: e?.args ?? { projectName: "" },
667
- skip: m
668
- }, { counts: f, total: p, complete: h } = Et(b), w = f?.get(ze)?.count ?? 0, d = Math.max(p - w, 0);
746
+ skip: p
747
+ }, { counts: l, total: f, complete: y } = Gt(h), C = l?.get(Ye)?.count ?? 0, m = Math.max(f - C, 0);
669
748
  return {
670
- counts: m ? void 0 : f ?? (h ? Zt : void 0),
671
- total: p,
672
- filled: d,
673
- complete: !m && h
749
+ counts: p ? void 0 : l ?? (y ? En : void 0),
750
+ total: f,
751
+ filled: m,
752
+ complete: !p && y
674
753
  };
675
- }, tn = V.div`
754
+ }, Rn = U.div`
676
755
  display: flex;
677
756
  align-items: center;
678
757
 
@@ -680,206 +759,206 @@ const At = 180, Be = 100, Ge = 34, Ot = (e, t = [], a = Be) => e.map((r) => t.in
680
759
  flex: 1;
681
760
  min-width: 0;
682
761
  }
683
- `, nn = V(ot)`
762
+ `, kn = U(Tt)`
684
763
  flex: 1;
685
764
  min-width: 0;
686
765
  height: 28px;
687
766
  min-height: 28px;
688
- `, sn = ({ open: e, value: t, subject: a, onChange: r }) => {
689
- const u = () => r(e ? void 0 : ""), l = (b) => {
690
- b.key === "Escape" && r(void 0);
691
- }, m = (b) => {
692
- const f = ct(b.clipboardData.getData("text"));
693
- if (f === null) return;
694
- b.preventDefault();
695
- const p = b.currentTarget, h = p.selectionStart ?? t.length, w = p.selectionEnd ?? t.length, d = h + f.length;
696
- r(t.slice(0, h) + f + t.slice(w)), requestAnimationFrame(() => p.setSelectionRange(d, d));
767
+ `, An = ({ open: e, value: t, subject: n, onChange: s }) => {
768
+ const d = () => s(e ? void 0 : ""), c = (h) => {
769
+ h.key === "Escape" && s(void 0);
770
+ }, p = (h) => {
771
+ const l = Lt(h.clipboardData.getData("text"));
772
+ if (l === null) return;
773
+ h.preventDefault();
774
+ const f = h.currentTarget, y = f.selectionStart ?? t.length, C = f.selectionEnd ?? t.length, m = y + l.length;
775
+ s(t.slice(0, y) + l + t.slice(C)), requestAnimationFrame(() => f.setSelectionRange(m, m));
697
776
  };
698
- return /* @__PURE__ */ G(tn, { className: W({ open: e }), children: [
777
+ return /* @__PURE__ */ H(Rn, { className: W({ open: e }), children: [
699
778
  e && /* @__PURE__ */ E(
700
- nn,
779
+ kn,
701
780
  {
702
781
  value: t,
703
- onChange: (b) => r(b.target.value),
782
+ onChange: (h) => s(h.target.value),
704
783
  placeholder: "Search",
705
784
  autoFocus: !0,
706
- onKeyDown: l,
707
- onPaste: m
785
+ onKeyDown: c,
786
+ onPaste: p
708
787
  }
709
788
  ),
710
789
  /* @__PURE__ */ E(
711
- he,
790
+ pe,
712
791
  {
713
792
  icon: e ? "close" : "search",
714
- onClick: u,
793
+ onClick: d,
715
794
  className: W({ open: e }),
716
- "data-tooltip": e ? "Close search" : `Search ${a}`
795
+ "data-tooltip": e ? "Close search" : `Search ${n}`
717
796
  }
718
797
  )
719
798
  ] });
720
- }, xe = (e, t) => {
721
- e.toggleExpanded(t), e.subRows?.forEach((a) => xe(a, t));
722
- }, Oe = (e) => e.map((t) => t.id).filter(Boolean), on = (e, t, a, r) => {
723
- const { onOpenNew: u } = Mt(), { projectName: l } = ue(), { setEntities: m } = mt(), b = _t(), [f] = Ve(), { deleteEntities: p } = ht(), [h, w] = U(null), d = A(
724
- (c, s) => s.map((o) => t?.get(o) || (o === c.id ? c : void 0)).filter((o) => !!o),
799
+ }, Ae = (e, t) => {
800
+ e.toggleExpanded(t), e.subRows?.forEach((n) => Ae(n, t));
801
+ }, Ge = (e) => e.map((t) => t.id).filter(Boolean), _n = (e, t, n, s) => {
802
+ const { onOpenNew: d } = Qt(), { projectName: c } = me(), { setEntities: p } = kt(), h = Jt(), [l] = Je(), { deleteEntities: f } = At(), [y, C] = z(null), m = N(
803
+ (u, o) => o.map((i) => t?.get(i) || (i === u.id ? u : void 0)).filter((i) => !!i),
725
804
  [t]
726
- ), S = O(
805
+ ), g = M(
727
806
  () => ({
728
- onShowDetails: (c, s = [c.id]) => {
729
- m({
807
+ onShowDetails: (u, o = [u.id]) => {
808
+ p({
730
809
  entityType: "folder",
731
- entities: s.map((o) => ({ id: o, projectName: l }))
810
+ entities: o.map((i) => ({ id: i, projectName: c }))
732
811
  });
733
812
  },
734
813
  onAddToList: e,
735
- onMove: (c) => {
736
- r?.({
737
- entities: c.map((s) => ({
738
- entityId: s.id,
739
- entityType: s.data?.entityType === "task" ? "task" : "folder",
740
- currentParentId: s.parentId || s.data?.parentId
814
+ onMove: (u) => {
815
+ s?.({
816
+ entities: u.map((o) => ({
817
+ entityId: o.id,
818
+ entityType: o.data?.entityType === "task" ? "task" : "folder",
819
+ currentParentId: o.parentId || o.data?.parentId
741
820
  }))
742
821
  });
743
822
  },
744
- onRename: (c) => w(c),
745
- onOpenViewer: (c) => a?.(c, l),
746
- onUploadVersion: (c) => {
747
- const s = c.data?.entityType === "task", o = s ? c.parentId || c.data?.parentId : c.id;
748
- o && b?.onOpenVersionUpload({
749
- folderId: o,
750
- taskId: s ? c.id : void 0
823
+ onRename: (u) => C(u),
824
+ onOpenViewer: (u) => n?.(u, c),
825
+ onUploadVersion: (u) => {
826
+ const o = u.data?.entityType === "task", i = o ? u.parentId || u.data?.parentId : u.id;
827
+ i && h?.onOpenVersionUpload({
828
+ folderId: i,
829
+ taskId: o ? u.id : void 0
751
830
  });
752
831
  },
753
- onDelete: (c) => {
754
- const s = c.map((o) => {
755
- const y = o.data?.entityType === "task" ? "task" : "folder", n = o.parentId || o.data?.parentId;
832
+ onDelete: (u) => {
833
+ const o = u.map((i) => {
834
+ const b = i.data?.entityType === "task" ? "task" : "folder", a = i.parentId || i.data?.parentId;
756
835
  return {
757
- id: o.id,
758
- entityType: y,
759
- name: o.name,
760
- label: o.label,
761
- projectName: l,
762
- folderId: y === "task" ? n : void 0,
763
- parentId: y === "folder" ? n : void 0
836
+ id: i.id,
837
+ entityType: b,
838
+ name: i.name,
839
+ label: i.label,
840
+ projectName: c,
841
+ folderId: b === "task" ? a : void 0,
842
+ parentId: b === "folder" ? a : void 0
764
843
  };
765
844
  });
766
- p(s);
845
+ f(o);
767
846
  }
768
847
  }),
769
848
  [
770
849
  e,
771
- a,
772
- r,
773
- l,
774
- m,
850
+ n,
851
+ s,
852
+ c,
775
853
  p,
776
- b
854
+ f,
855
+ h
777
856
  ]
778
- ), g = A(
779
- (c) => {
780
- h && (f({
781
- projectName: l,
857
+ ), S = N(
858
+ (u) => {
859
+ y && (l({
860
+ projectName: c,
782
861
  operationsRequestModel: {
783
862
  operations: [
784
863
  {
785
864
  type: "update",
786
- entityType: h.data?.entityType === "task" ? "task" : "folder",
787
- entityId: h.id,
788
- data: { label: c }
865
+ entityType: y.data?.entityType === "task" ? "task" : "folder",
866
+ entityId: y.id,
867
+ data: { label: u }
789
868
  }
790
869
  ]
791
870
  }
792
- }), w(null));
871
+ }), C(null));
793
872
  },
794
- [l, h, f]
873
+ [c, y, l]
795
874
  );
796
875
  return {
797
- rowContextMenuBuilders: O(
876
+ rowContextMenuBuilders: M(
798
877
  () => [
799
- (c, { row: s, selectedRows: o }) => ({
878
+ (u, { row: o, selectedRows: i }) => ({
800
879
  label: "Show details",
801
880
  icon: "dock_to_left",
802
- shortcut: Rt("click", [Pt.Alt]),
803
- command: () => S.onShowDetails(s.original, o)
881
+ shortcut: qt("click", [Yt.Alt]),
882
+ command: () => g.onShowDetails(o.original, i)
804
883
  }),
805
- (c, { row: s }) => ({
884
+ (u, { row: o }) => ({
806
885
  label: "Rename label",
807
886
  icon: "titlecase",
808
887
  shortcut: "R",
809
- command: () => S.onRename(s.original)
888
+ command: () => g.onRename(o.original)
810
889
  }),
811
- (c, { row: s }) => ({
890
+ (u, { row: o }) => ({
812
891
  label: "Open in viewer",
813
892
  icon: "play_circle",
814
- command: () => S.onOpenViewer(s.original),
815
- hidden: !a
893
+ command: () => g.onOpenViewer(o.original),
894
+ hidden: !n
816
895
  }),
817
- (c, { selectedTableRows: s }) => ({
896
+ (u, { selectedTableRows: o }) => ({
818
897
  label: "Expand all children",
819
898
  icon: "expand_all",
820
- command: () => s.filter((o) => o.getCanExpand() && !o.getIsExpanded()).forEach((o) => xe(o, !0)),
821
- hidden: !s.some(
822
- (o) => o.getCanExpand() && !o.getIsExpanded()
899
+ command: () => o.filter((i) => i.getCanExpand() && !i.getIsExpanded()).forEach((i) => Ae(i, !0)),
900
+ hidden: !o.some(
901
+ (i) => i.getCanExpand() && !i.getIsExpanded()
823
902
  )
824
903
  }),
825
- (c, { selectedTableRows: s }) => ({
904
+ (u, { selectedTableRows: o }) => ({
826
905
  label: "Collapse all children",
827
906
  icon: "collapse_all",
828
- command: () => s.filter((o) => o.getCanExpand() && o.getIsExpanded()).forEach((o) => xe(o, !1)),
829
- hidden: !s.some(
830
- (o) => o.getCanExpand() && o.getIsExpanded()
907
+ command: () => o.filter((i) => i.getCanExpand() && i.getIsExpanded()).forEach((i) => Ae(i, !1)),
908
+ hidden: !o.some(
909
+ (i) => i.getCanExpand() && i.getIsExpanded()
831
910
  )
832
911
  }),
833
- (c, { row: s, selectedRows: o }) => {
834
- const y = S.onAddToList?.(s.original, o);
835
- return y ? Array.isArray(y) ? y : [y] : void 0;
912
+ (u, { row: o, selectedRows: i }) => {
913
+ const b = g.onAddToList?.(o.original, i);
914
+ return b ? Array.isArray(b) ? b : [b] : void 0;
836
915
  },
837
- (c, { row: s }) => ({
916
+ (u, { row: o }) => ({
838
917
  label: "Upload version",
839
918
  icon: "upload",
840
- command: () => S.onUploadVersion(s.original)
919
+ command: () => g.onUploadVersion(o.original)
841
920
  }),
842
- (c, { row: s, selectedRows: o }) => ({
921
+ (u, { row: o, selectedRows: i }) => ({
843
922
  label: "Move",
844
923
  icon: "drive_file_move",
845
- command: () => S.onMove(d(s.original, o)),
846
- hidden: !r
924
+ command: () => g.onMove(m(o.original, i)),
925
+ hidden: !s
847
926
  }),
848
- (c, { row: s, selectedRows: o }) => ({
849
- label: me.folder.createLabel,
850
- icon: me.folder.icon,
851
- command: () => u?.("folder", {
852
- parentFolderIds: Oe(
853
- d(s.original, o)
927
+ (u, { row: o, selectedRows: i }) => ({
928
+ label: Te.folder.createLabel,
929
+ icon: Te.folder.icon,
930
+ command: () => d?.("folder", {
931
+ parentFolderIds: Ge(
932
+ m(o.original, i)
854
933
  )
855
934
  })
856
935
  }),
857
- (c, { row: s, selectedRows: o }) => ({
858
- label: me.task.createLabel,
859
- icon: me.task.icon,
860
- command: () => u?.("task", {
861
- parentFolderIds: Oe(
862
- d(s.original, o)
936
+ (u, { row: o, selectedRows: i }) => ({
937
+ label: Te.task.createLabel,
938
+ icon: Te.task.icon,
939
+ command: () => d?.("task", {
940
+ parentFolderIds: Ge(
941
+ m(o.original, i)
863
942
  )
864
943
  })
865
944
  }),
866
- (c, { row: s, selectedRows: o }) => ({
945
+ (u, { row: o, selectedRows: i }) => ({
867
946
  label: "Delete",
868
947
  icon: "delete",
869
948
  danger: !0,
870
- command: () => S.onDelete(d(s.original, o))
949
+ command: () => g.onDelete(m(o.original, i))
871
950
  })
872
951
  ],
873
- [S, d, u]
952
+ [g, m, d]
874
953
  ),
875
- onOptionClick: S.onShowDetails,
876
- onRename: S.onRename,
877
- renamingRow: h,
878
- renameInitialValue: h?.label || h?.name || "",
879
- onSubmitRename: g,
880
- onCancelRename: () => w(null)
954
+ onOptionClick: g.onShowDetails,
955
+ onRename: g.onRename,
956
+ renamingRow: y,
957
+ renameInitialValue: y?.label || y?.name || "",
958
+ onSubmitRename: S,
959
+ onCancelRename: () => C(null)
881
960
  };
882
- }, an = V(at)`
961
+ }, Mn = U(vt)`
883
962
  /* put above the menu so it's still clickable */
884
963
  /* NOTE: this will need fixing as this also puts it above dialogs */
885
964
  /* z-index: 1001; */
@@ -910,7 +989,7 @@ const At = 180, Be = 100, Ge = 34, Ot = (e, t = [], a = Be) => e.map((r) => t.in
910
989
  }
911
990
  }
912
991
  `;
913
- V.div`
992
+ U.div`
914
993
  display: flex;
915
994
  flex-direction: column;
916
995
  gap: var(--base-gap-large);
@@ -932,82 +1011,82 @@ V.div`
932
1011
  font-weight: 600;
933
1012
  }
934
1013
  `;
935
- const rn = (e, t, a) => {
936
- const r = `${t}${a === 1 ? "" : "s"}`;
937
- return e === "created" ? `new ${r}` : e === "deleted" ? `${r} deleted` : `${a} ${r} ${e.replaceAll("_", " ")}`;
938
- }, ln = (e) => {
1014
+ const Pn = (e, t, n) => {
1015
+ const s = `${t}${n === 1 ? "" : "s"}`;
1016
+ return e === "created" ? `new ${s}` : e === "deleted" ? `${s} deleted` : `${n} ${s} ${e.replaceAll("_", " ")}`;
1017
+ }, On = (e) => {
939
1018
  const t = /* @__PURE__ */ new Map();
940
- return e.forEach((r) => {
941
- const [, u, l] = r.topic.split(".");
942
- if (!u || !l) return;
943
- const m = `${u}.${l}`, b = t.get(m) || {
944
- entityType: u,
945
- updateType: l,
1019
+ return e.forEach((s) => {
1020
+ const [, d, c] = s.topic.split(".");
1021
+ if (!d || !c) return;
1022
+ const p = `${d}.${c}`, h = t.get(p) || {
1023
+ entityType: d,
1024
+ updateType: c,
946
1025
  ids: /* @__PURE__ */ new Set()
947
1026
  };
948
- b.ids.add(r.entityId || String(r.id)), t.set(m, b);
1027
+ h.ids.add(s.entityId || String(s.id)), t.set(p, h);
949
1028
  }), `${Array.from(t.values()).map(
950
- ({ entityType: r, updateType: u, ids: l }) => rn(u, r, l.size)
1029
+ ({ entityType: s, updateType: d, ids: c }) => Pn(d, s, c.size)
951
1030
  ).join(", ")} since last sync`;
952
- }, cn = Je(
953
- ({ projectNames: e, topics: t, onSync: a, shouldSyncOnUpdate: r, hideWhenNoUpdates: u = !1, ...l }, m) => {
954
- const [b, f] = U(!1), [p, h] = gt(), { setMenuOpen: w } = yt(), d = ye(null), S = ye(), g = Xe();
1031
+ }, Nn = ft(
1032
+ ({ projectNames: e, topics: t, onSync: n, shouldSyncOnUpdate: s, hideWhenNoUpdates: d = !1, ...c }, p) => {
1033
+ const [h, l] = z(!1), [f, y] = _t(), { setMenuOpen: C } = Ze(), m = Ie(null), g = Ie(), S = mt();
955
1034
  se(() => () => {
956
- const v = S.current;
957
- S.current = void 0, v !== void 0 && clearTimeout(v);
958
- }, []), Ze(m, () => d.current, []);
959
- const i = async () => {
960
- f(!0);
1035
+ const v = g.current;
1036
+ g.current = void 0, v !== void 0 && clearTimeout(v);
1037
+ }, []), ht(p, () => m.current, []);
1038
+ const r = async () => {
1039
+ l(!0);
961
1040
  try {
962
- await a?.(c);
1041
+ await n?.(u);
963
1042
  } finally {
964
- f(!1);
1043
+ l(!1);
965
1044
  }
966
- }, { updates: c, hasUpdates: s } = bt({
1045
+ }, { updates: u, hasUpdates: o } = Mt({
967
1046
  projectNames: e,
968
1047
  topics: t,
969
- isSyncing: b,
970
- shouldSyncOnUpdate: r
1048
+ isSyncing: h,
1049
+ shouldSyncOnUpdate: s
971
1050
  });
972
1051
  if (se(() => {
973
1052
  const v = (D) => {
974
- D.repeat || !D.shiftKey || D.ctrlKey || D.metaKey || D.key.toLowerCase() !== "r" || kt(D) || (D.preventDefault(), D.stopPropagation(), i());
1053
+ D.repeat || !D.shiftKey || D.ctrlKey || D.metaKey || D.key.toLowerCase() !== "r" || Kt(D) || (D.preventDefault(), D.stopPropagation(), r());
975
1054
  };
976
1055
  return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
977
- }, [i]), u && !s) return null;
978
- const o = ln(c), y = Object.values(p).some(Boolean);
979
- Object.values(p).every(Boolean);
980
- const n = () => {
981
- S.current && clearTimeout(S.current);
1056
+ }, [r]), d && !o) return null;
1057
+ const i = On(u), b = Object.values(f).some(Boolean);
1058
+ Object.values(f).every(Boolean);
1059
+ const a = () => {
1060
+ g.current && clearTimeout(g.current);
982
1061
  };
983
- return /* @__PURE__ */ G($e, { children: [
1062
+ return /* @__PURE__ */ H(_e, { children: [
984
1063
  /* @__PURE__ */ E(
985
- an,
1064
+ Mn,
986
1065
  {
987
- ...l,
1066
+ ...c,
988
1067
  icon: "sync",
989
- ref: d,
990
- onClick: i,
1068
+ ref: m,
1069
+ onClick: r,
991
1070
  onMouseEnter: () => {
992
- n(), w(g);
1071
+ a(), C(S);
993
1072
  },
994
1073
  onMouseLeave: () => {
995
- n(), S.current = setTimeout(() => w(!1), 100);
1074
+ a(), g.current = setTimeout(() => C(!1), 100);
996
1075
  },
997
- className: W(l.className, {
998
- syncing: b,
999
- "has-updates": s,
1000
- "auto-sync": y && !Pe
1076
+ className: W(c.className, {
1077
+ syncing: h,
1078
+ "has-updates": o,
1079
+ "auto-sync": b && !Ve
1001
1080
  }),
1002
1081
  "data-shortcut": "Shift+R",
1003
- "data-tooltip": s ? o : "Refresh data",
1004
- variant: s ? "filled" : "surface"
1082
+ "data-tooltip": o ? i : "Refresh data",
1083
+ variant: o ? "filled" : "surface"
1005
1084
  }
1006
1085
  ),
1007
- !Pe
1086
+ !Ve
1008
1087
  ] });
1009
1088
  }
1010
- ), Ne = V.div`
1089
+ ), We = U.div`
1011
1090
  display: flex;
1012
1091
  align-items: center;
1013
1092
  gap: var(--base-gap-small);
@@ -1015,7 +1094,7 @@ const rn = (e, t, a) => {
1015
1094
  flex: 1;
1016
1095
  min-width: 0;
1017
1096
  color: var(--md-sys-color-outline);
1018
- `, dn = V.span`
1097
+ `, Fn = U.span`
1019
1098
  display: flex;
1020
1099
  align-items: center;
1021
1100
  gap: 2px;
@@ -1028,56 +1107,56 @@ const rn = (e, t, a) => {
1028
1107
  border-radius: 50%;
1029
1108
  object-fit: cover;
1030
1109
  }
1031
- `, un = ({ rowSelection: e, sliceMap: t }) => {
1032
- const a = ye(null), [r, u] = U(0);
1033
- Te(() => {
1034
- const i = a.current;
1035
- if (!i) return;
1036
- const c = new ResizeObserver(([s]) => u(s.contentRect.width));
1037
- return c.observe(i), () => c.disconnect();
1110
+ `, jn = ({ rowSelection: e, sliceMap: t }) => {
1111
+ const n = Ie(null), [s, d] = z(0);
1112
+ we(() => {
1113
+ const r = n.current;
1114
+ if (!r) return;
1115
+ const u = new ResizeObserver(([o]) => d(o.contentRect.width));
1116
+ return u.observe(r), () => u.disconnect();
1038
1117
  }, []);
1039
- const l = Object.keys(e).filter((i) => e[i]).map((i) => t.get(i)).filter((i) => !!i), m = (i) => !!i.icon || !!i.img || !!i.startContent, [b, f] = U(!0), p = l.length > 1 || !b, [h, w] = U(l.length), d = l.map((i) => i.id).join("|");
1040
- if (Te(() => {
1041
- f(!0), w(l.length);
1042
- }, [r, d]), Te(() => {
1043
- const i = a.current;
1044
- if (!i || !l.length) return;
1045
- const c = Array.from(i.querySelectorAll("[data-chip]")), s = i.querySelector("[data-overflow]")?.offsetWidth ?? 22, o = (v, D) => v.offsetLeft - i.offsetLeft + v.offsetWidth <= D;
1046
- if (l.length === 1) {
1047
- b && c[0] && !o(c[0], i.clientWidth) && m(l[0]) && f(!1);
1118
+ const c = Object.keys(e).filter((r) => e[r]).map((r) => t.get(r)).filter((r) => !!r), p = (r) => !!r.icon || !!r.img || !!r.startContent, [h, l] = z(!0), f = c.length > 1 || !h, [y, C] = z(c.length), m = c.map((r) => r.id).join("|");
1119
+ if (we(() => {
1120
+ l(!0), C(c.length);
1121
+ }, [s, m]), we(() => {
1122
+ const r = n.current;
1123
+ if (!r || !c.length) return;
1124
+ const u = Array.from(r.querySelectorAll("[data-chip]")), o = r.querySelector("[data-overflow]")?.offsetWidth ?? 22, i = (v, D) => v.offsetLeft - r.offsetLeft + v.offsetWidth <= D;
1125
+ if (c.length === 1) {
1126
+ h && u[0] && !i(u[0], r.clientWidth) && p(c[0]) && l(!1);
1048
1127
  return;
1049
1128
  }
1050
- const y = c[c.length - 1];
1051
- if (y && o(y, i.clientWidth)) return;
1052
- const n = i.clientWidth - s, x = c.filter((v) => o(v, n)).length, T = Math.max(1, x);
1053
- T !== h && w(T);
1054
- }), !l.length) return /* @__PURE__ */ E(Ne, { ref: a });
1055
- const S = l.slice(0, h), g = l.length - S.length;
1056
- return /* @__PURE__ */ G(Ne, { ref: a, children: [
1057
- S.map((i) => /* @__PURE__ */ G(
1058
- dn,
1129
+ const b = u[u.length - 1];
1130
+ if (b && i(b, r.clientWidth)) return;
1131
+ const a = r.clientWidth - o, x = u.filter((v) => i(v, a)).length, T = Math.max(1, x);
1132
+ T !== y && C(T);
1133
+ }), !c.length) return /* @__PURE__ */ E(We, { ref: n });
1134
+ const g = c.slice(0, y), S = c.length - g.length;
1135
+ return /* @__PURE__ */ H(We, { ref: n, children: [
1136
+ g.map((r) => /* @__PURE__ */ H(
1137
+ Fn,
1059
1138
  {
1060
1139
  "data-chip": !0,
1061
- title: i.label || i.name,
1062
- "aria-label": i.label || i.name,
1140
+ title: r.label || r.name,
1141
+ "aria-label": r.label || r.name,
1063
1142
  children: [
1064
- i.startContent ?? (i.img ? /* @__PURE__ */ E("img", { src: i.img, alt: "" }) : i.icon && /* @__PURE__ */ E(it, { icon: i.icon, style: { color: i.iconColor } })),
1065
- !(p && m(i)) && /* @__PURE__ */ E("span", { children: i.label || i.name })
1143
+ r.startContent ?? (r.img ? /* @__PURE__ */ E("img", { src: r.img, alt: "" }) : r.icon && /* @__PURE__ */ E(It, { icon: r.icon, style: { color: r.iconColor } })),
1144
+ !(f && p(r)) && /* @__PURE__ */ E("span", { children: r.label || r.name })
1066
1145
  ]
1067
1146
  },
1068
- i.id
1147
+ r.id
1069
1148
  )),
1070
- g > 0 && /* @__PURE__ */ G("span", { "data-overflow": !0, children: [
1149
+ S > 0 && /* @__PURE__ */ H("span", { "data-overflow": !0, children: [
1071
1150
  "+",
1072
- g
1151
+ S
1073
1152
  ] })
1074
1153
  ] });
1075
- }, pn = V.div`
1154
+ }, $n = U.div`
1076
1155
  height: 28px;
1077
1156
  border-radius: 4px;
1078
1157
  background: var(--md-sys-color-surface-container);
1079
1158
  width: 100px;
1080
- `, fn = V.div`
1159
+ `, zn = U.div`
1081
1160
  display: flex;
1082
1161
  align-items: center;
1083
1162
  gap: var(--base-gap-small);
@@ -1089,7 +1168,7 @@ const rn = (e, t, a) => {
1089
1168
  flex: 1;
1090
1169
  min-width: 0;
1091
1170
  }
1092
- `, mn = V(vt)`
1171
+ `, Un = U(Nt)`
1093
1172
  .slicer-dropdown {
1094
1173
  flex: 0 1 auto;
1095
1174
  min-width: 48px;
@@ -1110,7 +1189,7 @@ const rn = (e, t, a) => {
1110
1189
  .power-feature .icon {
1111
1190
  color: var(--md-sys-color-tertiary);
1112
1191
  }
1113
- `, hn = V.div`
1192
+ `, Vn = U.div`
1114
1193
  display: flex;
1115
1194
  align-items: center;
1116
1195
  gap: var(--base-gap-small);
@@ -1123,176 +1202,224 @@ const rn = (e, t, a) => {
1123
1202
  text-overflow: ellipsis;
1124
1203
  white-space: nowrap;
1125
1204
  }
1126
- `, je = "__splitSlicer__", Fe = ({
1205
+ `, Ke = "__splitSlicer__", qe = ({
1127
1206
  panel: e,
1128
1207
  visibleSlices: t,
1129
- sliceFields: a,
1130
- entityTypes: r = ["task"],
1131
- pinnedSliceType: u,
1132
- countsSource: l,
1133
- onAddToList: m,
1134
- openMoveDialog: b,
1135
- splitEnabled: f,
1136
- canCollapse: p,
1137
- isPrimary: h,
1138
- search: w,
1139
- onSearchChange: d
1208
+ sliceFields: n,
1209
+ entityTypes: s = ["task"],
1210
+ pinnedSliceType: d,
1211
+ countsSource: c,
1212
+ onAddToList: p,
1213
+ openMoveDialog: h,
1214
+ splitEnabled: l,
1215
+ canCollapse: f,
1216
+ isPrimary: y,
1217
+ search: C,
1218
+ onSearchChange: m
1140
1219
  }) => {
1141
1220
  const {
1142
- SlicerDropdown: S,
1143
- addSlicePanel: g,
1144
- removeSlicePanel: i,
1145
- collapsedPanels: c,
1146
- togglePanelCollapsed: s,
1147
- setPanelSliceType: o,
1148
- getPanelSelection: y,
1149
- setPanelSelection: n,
1221
+ SlicerDropdown: g,
1222
+ addSlicePanel: S,
1223
+ removeSlicePanel: r,
1224
+ collapsedPanels: u,
1225
+ togglePanelCollapsed: o,
1226
+ setPanelSliceType: i,
1227
+ getPanelSelection: b,
1228
+ setPanelSelection: a,
1150
1229
  getPanelExpanded: x,
1151
1230
  setPanelExpanded: T,
1152
1231
  onSliceTypeChange: v,
1153
1232
  isViewSyncPending: D,
1154
- onOpenViewer: H,
1155
- onAddToList: oe
1156
- } = Ie(), { refetch: ae } = Ce(), { powerLicense: q, setPowerpackDialog: ie } = we(), Z = y(e.id), ee = x(e.id), B = (L) => {
1157
- n(e.id, L);
1158
- }, te = A(
1159
- (L) => T(e.id, L),
1233
+ onOpenViewer: K,
1234
+ onAddToList: ae,
1235
+ page: oe,
1236
+ getSliceSort: Z,
1237
+ setSliceSort: ie
1238
+ } = Me(), { refetch: re } = Pe(), { powerLicense: q, setPowerpackDialog: ee } = Oe(), V = b(e.id), le = x(e.id), te = (w) => {
1239
+ a(e.id, w);
1240
+ }, L = N(
1241
+ (w) => T(e.id, w),
1160
1242
  [T, e.id]
1161
- ), Q = O(
1162
- () => typeof l == "function" ? l(e.sliceType) : l,
1163
- [l, e.sliceType]
1164
- ), Y = O(() => {
1165
- const L = t.map((X) => X.sliceType);
1166
- if (typeof l != "function") return L;
1167
- const M = (X) => JSON.stringify([X?.entity, X?.args]), Qe = M(Q);
1168
- return L.filter((X) => X === e.sliceType || M(l(X)) === Qe);
1169
- }, [l, Q, t, e.sliceType]), { counts: I, filled: k, complete: P } = en(
1170
- Q,
1243
+ ), R = M(
1244
+ () => typeof c == "function" ? c(e.sliceType) : c,
1245
+ [c, e.sliceType]
1246
+ ), k = M(() => {
1247
+ const w = t.map((X) => X.sliceType);
1248
+ if (typeof c != "function") return w;
1249
+ const _ = (X) => JSON.stringify([X?.entity, X?.args]), ut = _(R);
1250
+ return w.filter((X) => X === e.sliceType || _(c(X)) === ut);
1251
+ }, [c, R, t, e.sliceType]), { counts: Q, filled: he, complete: xe } = Dn(
1252
+ R,
1171
1253
  e.sliceType,
1172
- Y
1173
- ), K = A(
1174
- (L, M) => {
1175
- h ? v(L, M) : o(e.id, L);
1254
+ k
1255
+ ), J = N(
1256
+ (w, _) => {
1257
+ y ? v(w, _) : i(e.id, w);
1176
1258
  },
1177
- [h, v, o, e.id]
1178
- ), re = O(
1179
- () => t.filter((L) => L.id !== e.id).map((L) => L.sliceType),
1259
+ [y, v, i, e.id]
1260
+ ), B = M(
1261
+ () => t.filter((w) => w.id !== e.id).map((w) => w.sliceType),
1180
1262
  [t, e.id]
1181
1263
  ), {
1182
- sliceOptions: F,
1183
- sliceType: N,
1184
- handleSliceTypeChange: pe,
1185
- table: { data: le, isExpandable: fe },
1186
- sliceMap: $,
1187
- isLoading: ne
1188
- } = Xt({
1189
- sliceFields: a,
1190
- usedSliceTypes: re,
1191
- entityTypes: r,
1192
- counts: I,
1193
- filled: k,
1194
- countsComplete: P,
1264
+ sliceOptions: Y,
1265
+ sliceType: P,
1266
+ handleSliceTypeChange: ge,
1267
+ table: { data: G, isExpandable: ne },
1268
+ sliceMap: ce,
1269
+ isLoading: de
1270
+ } = wn({
1271
+ sliceFields: n,
1272
+ usedSliceTypes: B,
1273
+ entityTypes: s,
1274
+ counts: Q,
1275
+ filled: he,
1276
+ countsComplete: xe,
1195
1277
  sliceType: e.sliceType,
1196
- onSliceTypeChange: K
1197
- }), z = N === "hierarchy", j = !!p && c.includes(e.id), C = F.find((L) => L.value === N)?.label || N, R = w !== void 0, _ = w ?? "", ce = z ? "Folders" : C, J = on(
1198
- m || oe,
1199
- $,
1200
- H,
1201
- b
1202
- ), We = z ? J.rowContextMenuBuilders : [], Ee = O(
1203
- () => F.map((L) => L.value).filter((L) => !t.some((M) => M.sliceType === L)),
1204
- [F, t]
1205
- ), be = !!f && Ee.length > 0, Se = O(() => {
1206
- const L = F.map(
1207
- (M) => re.includes(M.value) ? { ...M, disabled: !0, disabledMessage: "Already used by another panel" } : M
1278
+ onSliceTypeChange: J,
1279
+ sort: Z(e.sliceType)
1280
+ }), F = P === "hierarchy", j = !!f && u.includes(e.id), be = Y.find((w) => w.value === P)?.label || P, I = C !== void 0, A = C ?? "", O = F ? "Folders" : be, $ = _n(
1281
+ p || ae,
1282
+ ce,
1283
+ K,
1284
+ h
1285
+ ), it = F ? $.rowContextMenuBuilders : [], Fe = M(
1286
+ () => Y.map((w) => w.value).filter((w) => !t.some((_) => _.sliceType === w)),
1287
+ [Y, t]
1288
+ ), Se = !!l && Fe.length > 0, Ce = M(() => {
1289
+ const w = Y.map(
1290
+ (_) => B.includes(_.value) ? { ..._, disabled: !0, disabledMessage: "Already used by another panel" } : _
1208
1291
  );
1209
- return be && L.push({ label: "Split slicer", value: je, icon: "splitscreen_add" }), L;
1210
- }, [F, re, be]), De = () => {
1211
- if (!q) return ie("slicer");
1212
- g(Ee[0]);
1213
- }, qe = (L) => {
1214
- const M = String(L[0]);
1215
- if (M === je) {
1216
- De();
1292
+ return Se && w.push({ label: "Split slicer", value: Ke, icon: "splitscreen_add" }), w;
1293
+ }, [Y, B, Se]), Le = () => {
1294
+ if (!q) return ee("slicer");
1295
+ S(Fe[0]);
1296
+ }, { menuOpen: rt, toggleMenuOpen: je } = Ze(), ue = `slicer-menu-${oe}-${e.id}`.replace(/[^\w-]/g, "-"), lt = rt === ue, ct = [
1297
+ {
1298
+ id: "search",
1299
+ label: `Search ${O}`,
1300
+ icon: "search",
1301
+ onClick: () => m("")
1302
+ },
1303
+ ...Se && y ? [
1304
+ {
1305
+ id: "split",
1306
+ label: "Split slicer",
1307
+ icon: "splitscreen_add",
1308
+ powerFeature: "slicer",
1309
+ onClick: Le
1310
+ }
1311
+ ] : [],
1312
+ ...y ? [] : [
1313
+ {
1314
+ id: "remove-panel",
1315
+ label: "Remove panel",
1316
+ icon: "close",
1317
+ onClick: () => r(e.id)
1318
+ }
1319
+ ],
1320
+ rn({
1321
+ id: "sort",
1322
+ options: Ne(P),
1323
+ sort: Z(P),
1324
+ onChange: (w) => ie(P, w)
1325
+ })
1326
+ ], dt = (w) => {
1327
+ const _ = String(w[0]);
1328
+ if (_ === Ke) {
1329
+ Le();
1217
1330
  return;
1218
1331
  }
1219
- pe(M, !!h && u === N);
1332
+ ge(_, !!y && d === P);
1220
1333
  };
1221
- return /* @__PURE__ */ G(xt, { children: [
1222
- /* @__PURE__ */ G(
1223
- mn,
1334
+ return /* @__PURE__ */ H(Ft, { children: [
1335
+ /* @__PURE__ */ H(
1336
+ Un,
1224
1337
  {
1225
1338
  className: W({ collapsed: j }),
1226
- onClick: j ? () => s(e.id) : void 0,
1339
+ onClick: j ? () => o(e.id) : void 0,
1227
1340
  children: [
1228
- p && /* @__PURE__ */ E(
1229
- he,
1341
+ f && /* @__PURE__ */ E(
1342
+ pe,
1230
1343
  {
1231
1344
  icon: "expand_more",
1232
1345
  className: W("collapse-toggle", { collapsed: j }),
1233
1346
  "data-tooltip": j ? "Expand panel" : "Collapse panel",
1234
1347
  "data-tooltip-delay": 0,
1235
- onClick: () => s(e.id)
1348
+ onClick: () => o(e.id)
1236
1349
  }
1237
1350
  ),
1238
1351
  j ? (
1239
1352
  // the dropdown cannot be used from a collapsed panel, but the dimension it
1240
1353
  // shows has to read the same as the dropdown does when open
1241
- /* @__PURE__ */ E(hn, { children: /* @__PURE__ */ E("span", { children: C }) })
1242
- ) : D ? /* @__PURE__ */ E(pn, {}) : !R && /* @__PURE__ */ E(
1243
- S,
1354
+ /* @__PURE__ */ E(Vn, { children: /* @__PURE__ */ E("span", { children: be }) })
1355
+ ) : D ? /* @__PURE__ */ E($n, {}) : !I && /* @__PURE__ */ E(
1356
+ g,
1244
1357
  {
1245
- options: Se,
1246
- value: [N],
1247
- sliceTypes: a.map((L) => L.value),
1248
- onChange: (L) => qe(L),
1249
- className: W("slicer-dropdown", { "single-option": Se.length === 1 }),
1250
- disableOpen: Se.length === 1
1358
+ options: Ce,
1359
+ value: [P],
1360
+ sliceTypes: n.map((w) => w.value),
1361
+ onChange: (w) => dt(w),
1362
+ className: W("slicer-dropdown", { "single-option": Ce.length === 1 }),
1363
+ disableOpen: Ce.length === 1
1251
1364
  }
1252
1365
  ),
1253
- j && /* @__PURE__ */ E(un, { rowSelection: Z, sliceMap: $ }),
1254
- /* @__PURE__ */ G(
1255
- fn,
1366
+ j && /* @__PURE__ */ E(jn, { rowSelection: V, sliceMap: ce }),
1367
+ /* @__PURE__ */ H(
1368
+ zn,
1256
1369
  {
1257
- className: W({ searching: R }),
1258
- onClick: (L) => L.stopPropagation(),
1370
+ className: W({ searching: I }),
1371
+ onClick: (w) => w.stopPropagation(),
1259
1372
  children: [
1373
+ !j && !I && /* @__PURE__ */ H(_e, { children: [
1374
+ /* @__PURE__ */ E(
1375
+ pe,
1376
+ {
1377
+ icon: "more_horiz",
1378
+ id: ue,
1379
+ className: W("slicer-menu", { active: lt }),
1380
+ "data-tooltip": "More",
1381
+ "data-tooltip-delay": 0,
1382
+ onClick: () => je(ue)
1383
+ }
1384
+ ),
1385
+ /* @__PURE__ */ E(Xt, { targetId: ue, id: ue, align: "left", children: /* @__PURE__ */ E(Zt, { menu: ct, onClose: () => je(!1) }) })
1386
+ ] }),
1260
1387
  !j && /* @__PURE__ */ E(
1261
- sn,
1388
+ An,
1262
1389
  {
1263
- open: R,
1264
- value: _,
1265
- subject: ce,
1266
- onChange: d
1390
+ open: I,
1391
+ value: A,
1392
+ subject: O,
1393
+ onChange: m
1267
1394
  }
1268
1395
  ),
1269
- z && /* @__PURE__ */ E(
1270
- cn,
1396
+ F && /* @__PURE__ */ E(
1397
+ Nn,
1271
1398
  {
1272
1399
  topics: ["entity.folder.created"],
1273
1400
  onSync: async () => {
1274
- await ae();
1401
+ await re();
1275
1402
  },
1276
1403
  hideWhenNoUpdates: !0
1277
1404
  }
1278
1405
  ),
1279
- be && h && !R && /* @__PURE__ */ E(
1280
- he,
1406
+ Se && y && !I && /* @__PURE__ */ E(
1407
+ pe,
1281
1408
  {
1282
1409
  icon: "splitscreen_add",
1283
1410
  className: W({ "power-feature": !q }),
1284
1411
  "data-tooltip": q ? "Split slicer" : "Power feature - Slicer",
1285
1412
  "data-tooltip-delay": 0,
1286
- onClick: De
1413
+ onClick: Le
1287
1414
  }
1288
1415
  ),
1289
- !h && !R && /* @__PURE__ */ E(
1290
- he,
1416
+ !y && !I && /* @__PURE__ */ E(
1417
+ pe,
1291
1418
  {
1292
1419
  icon: "close",
1293
1420
  "data-tooltip": "Remove panel",
1294
1421
  "data-tooltip-delay": 0,
1295
- onClick: () => i(e.id)
1422
+ onClick: () => r(e.id)
1296
1423
  }
1297
1424
  )
1298
1425
  ]
@@ -1302,35 +1429,35 @@ const rn = (e, t, a) => {
1302
1429
  }
1303
1430
  ),
1304
1431
  !j && /* @__PURE__ */ E(
1305
- It,
1432
+ jt,
1306
1433
  {
1307
- rowSelection: Z,
1308
- onRowSelectionChange: B,
1309
- expanded: ee,
1310
- setExpanded: te,
1311
- data: $,
1434
+ rowSelection: V,
1435
+ onRowSelectionChange: te,
1436
+ expanded: le,
1437
+ setExpanded: L,
1438
+ data: ce,
1312
1439
  children: /* @__PURE__ */ E(
1313
- Ct,
1440
+ $t,
1314
1441
  {
1315
- data: le,
1316
- isExpandable: fe,
1317
- isLoading: ne || D,
1318
- forceUpdateTable: N,
1319
- globalFilter: _,
1442
+ data: G,
1443
+ isExpandable: ne,
1444
+ isLoading: de || D,
1445
+ forceUpdateTable: P,
1446
+ globalFilter: A,
1320
1447
  rowIdPrefix: `slicer-${e.id}`,
1321
- onRename: z ? (L, M) => J.onRename(M.original) : void 0,
1322
- renamingId: z ? J.renamingRow?.id : null,
1323
- renameInitialValue: z ? J.renameInitialValue : void 0,
1324
- onSubmitRename: z ? (L, M) => J.onSubmitRename(M) : void 0,
1325
- onCancelRename: z ? J.onCancelRename : void 0,
1326
- onRowOptionClick: z ? J.onOptionClick : void 0,
1327
- rowContextMenuBuilders: We
1448
+ onRename: F ? (w, _) => $.onRename(_.original) : void 0,
1449
+ renamingId: F ? $.renamingRow?.id : null,
1450
+ renameInitialValue: F ? $.renameInitialValue : void 0,
1451
+ onSubmitRename: F ? (w, _) => $.onSubmitRename(_) : void 0,
1452
+ onCancelRename: F ? $.onCancelRename : void 0,
1453
+ onRowOptionClick: F ? $.onOptionClick : void 0,
1454
+ rowContextMenuBuilders: it
1328
1455
  }
1329
1456
  )
1330
1457
  }
1331
1458
  )
1332
1459
  ] });
1333
- }, gn = V.div`
1460
+ }, Bn = U.div`
1334
1461
  height: 100%;
1335
1462
  width: 100%;
1336
1463
  overflow-y: auto;
@@ -1344,133 +1471,139 @@ const rn = (e, t, a) => {
1344
1471
  }
1345
1472
  `
1346
1473
  ).join("")}
1347
- `, ls = ({
1474
+ `, js = ({
1348
1475
  sliceFields: e = [],
1349
1476
  entityTypes: t = ["task"],
1350
- pinnedSliceType: a,
1351
- countsSource: r,
1352
- onAddToList: u,
1353
- enableSplit: l
1477
+ pinnedSliceType: n,
1478
+ countsSource: s,
1479
+ onAddToList: d,
1480
+ enableSplit: c
1354
1481
  }) => {
1355
- const { slices: m, page: b, setPanelExpanded: f, projectName: p, collapsedPanels: h } = Ie(), { powerLicense: w } = we(), d = !!l, S = d && w ? m : m.slice(0, 1), [g, i] = U(null), c = A((I) => {
1356
- i("entities" in I ? I : { entities: [I] });
1357
- }, []), s = A(() => {
1358
- i(null);
1359
- }, []), { getParentFolderIds: o } = Ce(), y = A(
1360
- (I) => {
1361
- const k = [I, ...o(I)];
1362
- f(
1482
+ const { slices: p, page: h, setPanelExpanded: l, projectName: f, collapsedPanels: y } = Me(), { powerLicense: C } = Oe(), m = !!c, g = m && C ? p : p.slice(0, 1), [S, r] = z(null), u = N((L) => {
1483
+ r("entities" in L ? L : { entities: [L] });
1484
+ }, []), o = N(() => {
1485
+ r(null);
1486
+ }, []), { getParentFolderIds: i } = Pe(), b = N(
1487
+ (L) => {
1488
+ const R = [L, ...i(L)];
1489
+ l(
1363
1490
  "hierarchy",
1364
- (P) => typeof P == "boolean" ? P || Object.fromEntries(k.map((K) => [K, !0])) : {
1365
- ...P,
1366
- ...Object.fromEntries(k.map((K) => [K, !0]))
1491
+ (k) => typeof k == "boolean" ? k || Object.fromEntries(R.map((Q) => [Q, !0])) : {
1492
+ ...k,
1493
+ ...Object.fromEntries(R.map((Q) => [Q, !0]))
1367
1494
  }
1368
1495
  );
1369
1496
  },
1370
- [o, f]
1371
- ), n = ye(null), [x, T] = U(0);
1497
+ [i, l]
1498
+ ), a = Ie(null), [x, T] = z(0);
1372
1499
  se(() => {
1373
- const I = n.current;
1374
- if (!I) return;
1375
- const k = new ResizeObserver(([P]) => T(P.contentRect.height));
1376
- return k.observe(I), () => k.disconnect();
1377
- }, [S.length]);
1378
- const v = S.map((I) => I.id), D = S.length > 1, {
1379
- sizes: H,
1380
- minSize: oe,
1381
- height: ae,
1382
- layoutKey: q,
1500
+ const L = a.current;
1501
+ if (!L) return;
1502
+ const R = new ResizeObserver(([k]) => T(k.contentRect.height));
1503
+ return R.observe(L), () => R.disconnect();
1504
+ }, [g.length]);
1505
+ const v = g.map((L) => L.id), D = g.length > 1, {
1506
+ sizes: K,
1507
+ minSize: ae,
1508
+ height: oe,
1509
+ layoutKey: Z,
1383
1510
  handleResizeEnd: ie
1384
- } = zt(b, v, D ? h : [], x), Z = v.slice(0, -1).map(
1385
- (I, k) => D && (h.includes(I) || h.includes(v[k + 1])) ? k : -1
1386
- ).filter((I) => I >= 0), [ee, B] = U({}), te = A(
1387
- (I, k) => B((P) => ({ ...P, [I]: k })),
1511
+ } = mn(h, v, D ? y : [], x), re = v.slice(0, -1).map(
1512
+ (L, R) => D && (y.includes(L) || y.includes(v[R + 1])) ? R : -1
1513
+ ).filter((L) => L >= 0), [q, ee] = z({}), V = N(
1514
+ (L, R) => ee((k) => ({ ...k, [L]: R })),
1388
1515
  []
1389
- ), Q = v.join("|");
1516
+ ), le = v.join("|");
1390
1517
  se(() => {
1391
- B((I) => {
1392
- const k = Object.keys(I).filter((P) => v.includes(P));
1393
- return k.length === Object.keys(I).length ? I : Object.fromEntries(k.map((P) => [P, I[P]]));
1518
+ ee((L) => {
1519
+ const R = Object.keys(L).filter((k) => v.includes(k));
1520
+ return R.length === Object.keys(L).length ? L : Object.fromEntries(R.map((k) => [k, L[k]]));
1394
1521
  });
1395
- }, [Q]);
1396
- const Y = {
1397
- visibleSlices: S,
1522
+ }, [le]);
1523
+ const te = {
1524
+ visibleSlices: g,
1398
1525
  canCollapse: D,
1399
1526
  sliceFields: e,
1400
1527
  entityTypes: t,
1401
- pinnedSliceType: a,
1402
- countsSource: r,
1403
- onAddToList: u,
1404
- openMoveDialog: c,
1405
- splitEnabled: d
1528
+ pinnedSliceType: n,
1529
+ countsSource: s,
1530
+ onAddToList: d,
1531
+ openMoveDialog: u,
1532
+ splitEnabled: m
1406
1533
  };
1407
- return /* @__PURE__ */ G($e, { children: [
1408
- S.length === 1 ? /* @__PURE__ */ E(
1409
- Fe,
1534
+ return /* @__PURE__ */ H(_e, { children: [
1535
+ g.length === 1 ? /* @__PURE__ */ E(
1536
+ qe,
1410
1537
  {
1411
- panel: S[0],
1538
+ panel: g[0],
1412
1539
  isPrimary: !0,
1413
- search: ee[S[0].id],
1414
- onSearchChange: (I) => te(S[0].id, I),
1415
- ...Y
1540
+ search: q[g[0].id],
1541
+ onSearchChange: (L) => V(g[0].id, L),
1542
+ ...te
1416
1543
  }
1417
- ) : /* @__PURE__ */ E(gn, { ref: n, $deadGutters: Z, children: /* @__PURE__ */ E(
1418
- et,
1544
+ ) : /* @__PURE__ */ E(Bn, { ref: a, $deadGutters: re, children: /* @__PURE__ */ E(
1545
+ gt,
1419
1546
  {
1420
1547
  layout: "vertical",
1421
1548
  onResizeEnd: ie,
1422
1549
  style: {
1423
1550
  width: "100%",
1424
- height: ae,
1551
+ height: oe,
1425
1552
  overflow: "hidden"
1426
1553
  },
1427
- children: S.map((I, k) => /* @__PURE__ */ E(
1428
- tt,
1554
+ children: g.map((L, R) => /* @__PURE__ */ E(
1555
+ yt,
1429
1556
  {
1430
- size: H[k],
1431
- minSize: oe,
1557
+ size: K[R],
1558
+ minSize: ae,
1432
1559
  style: { overflow: "hidden" },
1433
1560
  children: /* @__PURE__ */ E(
1434
- Fe,
1561
+ qe,
1435
1562
  {
1436
- panel: I,
1437
- isPrimary: k === 0,
1438
- search: ee[I.id],
1439
- onSearchChange: (P) => te(I.id, P),
1440
- ...Y
1563
+ panel: L,
1564
+ isPrimary: R === 0,
1565
+ search: q[L.id],
1566
+ onSearchChange: (k) => V(L.id, k),
1567
+ ...te
1441
1568
  }
1442
1569
  )
1443
1570
  },
1444
- I.id
1571
+ L.id
1445
1572
  ))
1446
1573
  },
1447
- q
1574
+ Z
1448
1575
  ) }),
1449
1576
  /* @__PURE__ */ E(
1450
- Vt,
1577
+ gn,
1451
1578
  {
1452
- projectName: p,
1453
- movingEntities: g,
1454
- onClose: s,
1455
- onMoveComplete: y
1579
+ projectName: f,
1580
+ movingEntities: S,
1581
+ onClose: o,
1582
+ onMoveComplete: b
1456
1583
  }
1457
1584
  )
1458
1585
  ] });
1459
1586
  };
1460
1587
  export {
1461
- At as S,
1462
- Be as a,
1463
- Me as b,
1464
- $t as c,
1465
- ls as d,
1466
- Wt as e,
1467
- Ft as f,
1468
- Ae as g,
1469
- on as h,
1470
- en as i,
1471
- zt as j,
1472
- rs as k,
1473
- cn as l,
1474
- jt as r,
1475
- qt as u
1588
+ ln as S,
1589
+ st as a,
1590
+ Be as b,
1591
+ fn as c,
1592
+ et as d,
1593
+ js as e,
1594
+ vn as f,
1595
+ pn as g,
1596
+ He as h,
1597
+ tt as i,
1598
+ Ne as j,
1599
+ un as k,
1600
+ _n as l,
1601
+ Dn as m,
1602
+ mn as n,
1603
+ Fs as o,
1604
+ Nn as p,
1605
+ rn as q,
1606
+ Ns as r,
1607
+ on as s,
1608
+ In as u
1476
1609
  };