@ynput/ayon-frontend-shared 0.6.9 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/ContextMenu.es.js +44 -27
  2. package/dist/DetailsPanel.es.js +767 -740
  3. package/dist/ListTable.es.js +430 -430
  4. package/dist/NewEntity.es.js +43 -42
  5. package/dist/ProjectTreeTable.es.js +3496 -3342
  6. package/dist/Slicer.es.js +301 -276
  7. package/dist/Views.es.js +537 -521
  8. package/dist/api.es.js +429 -412
  9. package/dist/chunks/Actions.es.js +19 -18
  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 +72 -71
  18. package/dist/chunks/EntityPickerDialog.es.js +88 -83
  19. package/dist/chunks/EntityTooltip.es.js +11 -10
  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 +2751 -2217
  26. package/dist/chunks/PlayableIcon.es.js +79 -78
  27. package/dist/chunks/ProjectContext.es.js +7 -7
  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 +96 -95
  36. package/dist/chunks/VideoPlayer.es.js +1 -1
  37. package/dist/chunks/Watchers.es.js +850 -797
  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 +3704 -3504
  41. package/dist/chunks/realtimeUpdatesUtils.es.js +91 -82
  42. package/dist/chunks/searchTerms.es.js +649 -563
  43. package/dist/chunks/sortLists.es.js +22 -0
  44. package/dist/chunks/useAttributeEnums.es.js +21 -21
  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 +19 -18
  48. package/dist/components.es.js +628 -593
  49. package/dist/context.es.js +525 -499
  50. package/dist/hooks.es.js +54 -53
  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 +144 -14
  56. package/dist/types/SimpleTable.d.ts +2 -1
  57. package/dist/types/Slicer.d.ts +32 -5
  58. package/dist/types/Views.d.ts +6 -0
  59. package/dist/types/api.d.ts +2252 -510
  60. package/dist/types/components.d.ts +52 -4
  61. package/dist/types/context.d.ts +96 -2
  62. package/dist/types/hooks.d.ts +36 -1
  63. package/dist/types/util.d.ts +54 -0
  64. package/dist/util.es.js +129 -119
  65. package/package.json +4 -4
  66. package/dist/chunks/MenuItem.es.js +0 -420
@@ -1,66 +1,67 @@
1
- import { jsxs as k, jsx as i, Fragment as Ie } from "react/jsx-runtime";
2
- import { Toolbar as ze, Panel as ft, Button as Z, Spacer as Ge, Icon as fe, getTextColor as Ee, Dialog as bt, SEARCH_FILTER_ID as Qe, buildFilterId as Se, getFilterFromId as vt, SearchFilter as yt, AssigneeField as kt } from "@ynput/ayon-react-components";
3
- import { useEffect as H, useRef as ee, useMemo as D, useState as X, useContext as wt, useId as xt } from "react";
4
- import T, { keyframes as St } from "styled-components";
5
- import { bp as Ct } from "./chunks/searchTerms.es.js";
6
- import { bm as Tt, bK as Nt, bZ as Et, ct as qe, bu as Ke, t as Dt, bO as It, c8 as Pt } from "./chunks/getUris.es.js";
1
+ import { jsxs as k, jsx as i, Fragment as xe } from "react/jsx-runtime";
2
+ import { Toolbar as Qe, Panel as yt, Button as Y, Spacer as qe, Icon as we, getMixedCounts as Me, getTextColor as Fe, applyMixedChange as kt, Dialog as wt, SEARCH_FILTER_ID as Ke, buildFilterId as Ee, getFilterFromId as xt, SearchFilter as St, AssigneeField as Ct } from "@ynput/ayon-react-components";
3
+ import { useEffect as B, useRef as Z, useMemo as C, useState as X, useContext as Tt, useId as Nt } from "react";
4
+ import T, { keyframes as Et } from "styled-components";
5
+ import { bz as Dt, bH as It } from "./chunks/searchTerms.es.js";
6
+ import { bq as Pt, bO as Ft, c3 as At, cz as Je, by as Xe, v as Ot, bS as jt, ce as Rt } from "./chunks/getUris.es.js";
7
7
  import "primereact/confirmdialog";
8
- import { o as Ft, y as At, H as Ot, G as Rt, z as jt, w as Xe, A as Vt, B as Ut, E as $t, I as Lt, J as _t, K as Mt, N as Ht, W as Bt, s as Wt } from "./chunks/Watchers.es.js";
9
- import { O as wa, Q as xa, V as Sa, X as Ca, T as Ta } from "./chunks/Watchers.es.js";
10
- import { E as zt, R as Gt, a as Qt } from "./chunks/EntityPath.es.js";
11
- import { union as ue, upperFirst as Je } from "lodash";
8
+ import { o as Vt, y as $t, H as Lt, G as Ut, z as _t, w as Ye, A as Mt, B as Ht, E as Bt, I as Wt, J as zt, K as Gt, N as Qt, W as qt, s as Kt } from "./chunks/Watchers.es.js";
9
+ import { O as Da, Q as Ia, V as Pa, X as Fa, T as Aa } from "./chunks/Watchers.es.js";
10
+ import { E as Jt, R as Xt, a as Yt } from "./chunks/EntityPath.es.js";
11
+ import { union as ue, upperFirst as Ze } from "lodash";
12
12
  import "react-toastify";
13
13
  import "uuid";
14
- import { a as qt, b as Kt, A as _e, e as Xt } from "./chunks/activeEntities.es.js";
14
+ import { a as Zt, b as es, A as He, e as ts } from "./chunks/activeEntities.es.js";
15
15
  import "@module-federation/enhanced/runtime";
16
- import { o as q, u as Jt, T as Yt, a6 as Zt, a0 as en, a8 as tn, B as nn, a7 as sn, X as an } from "./chunks/DeleteEntitiesContextInstance.es.js";
16
+ import { o as K, u as ss, T as ns, a8 as as, a2 as os, aa as is, G as rs, a9 as ls, Z as cs } from "./chunks/TableExportContextInstance.es.js";
17
17
  import "semver";
18
- import { T as on, P as Ye } from "./chunks/ProjectContext.es.js";
18
+ import { T as ds, P as et } from "./chunks/ProjectContext.es.js";
19
19
  import "react-dom";
20
20
  import "react-redux";
21
- import ie from "clsx";
22
- import { A as rn } from "./chunks/Actions.es.js";
21
+ import "react-router-dom";
22
+ import le from "clsx";
23
+ import { A as us } from "./chunks/Actions.es.js";
24
+ import { f as ps, k as hs, r as ms, m as gs } from "./chunks/MetaWidget.es.js";
23
25
  import "./chunks/ContextMenuContextInstance.es.js";
24
- import { g as Ce } from "./chunks/getEntityTypeIcon.es.js";
25
- import { _ as ln } from "./chunks/PlayableIcon.es.js";
26
- import { R as cn } from "./chunks/RepresentationsList.es.js";
27
- import { I as dn } from "./chunks/InfoMessage.es.js";
28
- import { M as un, a as pn } from "./chunks/Menu.es.js";
29
- import { D as hn } from "./chunks/DetailsDialog.es.js";
30
- import { u as mn } from "./chunks/VersionUploadContextInstance.es.js";
31
- import { p as gn } from "./chunks/pluralize.es.js";
32
- import { c as fn } from "./chunks/copyToClipboard.es.js";
33
- import { u as bn } from "./chunks/useQueryArgumentChangeLoading.es.js";
34
- import { d as Ze, c as vn } from "./chunks/Feed.es.js";
35
- import { A as yn, C as kn } from "./chunks/ThumbnailSimple.es.js";
36
- import { o as wn, k as xn } from "./chunks/MetaWidget.es.js";
37
- import { t as Sn, c as Cn } from "./chunks/queryFilterToClientFilter.es.js";
38
- import { u as Tn } from "./chunks/useDateRangeFilter.es.js";
39
- import { e as Nn } from "./chunks/expandRelativeDates.es.js";
26
+ import { g as De } from "./chunks/getEntityTypeIcon.es.js";
27
+ import { _ as fs } from "./chunks/PlayableIcon.es.js";
28
+ import { R as bs } from "./chunks/RepresentationsList.es.js";
29
+ import { I as vs } from "./chunks/InfoMessage.es.js";
30
+ import { M as ys, a as ks } from "./chunks/Menu.es.js";
31
+ import { D as ws } from "./chunks/DetailsDialog.es.js";
32
+ import { u as xs } from "./chunks/VersionUploadContextInstance.es.js";
33
+ import { p as Ss } from "./chunks/pluralize.es.js";
34
+ import { c as Cs } from "./chunks/copyToClipboard.es.js";
35
+ import { u as Ts } from "./chunks/useQueryArgumentChangeLoading.es.js";
36
+ import { d as tt, c as Ns } from "./chunks/Feed.es.js";
37
+ import { A as Es, C as Ds } from "./chunks/ThumbnailSimple.es.js";
38
+ import { t as Is, c as Ps } from "./chunks/queryFilterToClientFilter.es.js";
39
+ import { u as Fs } from "./chunks/useDateRangeFilter.es.js";
40
+ import { e as As } from "./chunks/expandRelativeDates.es.js";
40
41
  import "axios";
41
42
  import "@dnd-kit/core";
42
43
  import "@dnd-kit/sortable";
43
44
  import "@dnd-kit/utilities";
44
45
  import "custom-protocol-check";
45
46
  import "./chunks/SimpleForm.es.js";
46
- import { Dialog as En } from "primereact/dialog";
47
- function Dn({
47
+ import { Dialog as Os } from "primereact/dialog";
48
+ function js({
48
49
  entityData: e,
49
- project: n,
50
+ project: s,
50
51
  activeEntityType: t,
51
52
  entitiesToQuery: o = []
52
53
  }) {
53
- H(() => {
54
- if (!e?.parents || !n) return;
55
- const s = new URL(window.location.href), a = s.searchParams;
56
- a.set("project", n), t && a.set("type", t);
57
- const r = (o || []).filter((f) => f.projectName === n).map((f) => f.id).filter(Boolean)[0];
54
+ B(() => {
55
+ if (!e?.parents || !s) return;
56
+ const n = new URL(window.location.href), a = n.searchParams;
57
+ a.set("project", s), t && a.set("type", t);
58
+ const r = (o || []).filter((f) => f.projectName === s).map((f) => f.id).filter(Boolean)[0];
58
59
  r && a.set("id", r);
59
- const c = `${s.pathname}?${a.toString()}${s.hash}`, m = `${window.location.pathname}${window.location.search}${window.location.hash}`;
60
+ const c = `${n.pathname}?${a.toString()}${n.hash}`, m = `${window.location.pathname}${window.location.search}${window.location.hash}`;
60
61
  c !== m && window.history.replaceState(window.history.state, "", c);
61
- }, [e, n, t, o]);
62
+ }, [e, s, t, o]);
62
63
  }
63
- const In = T(ze)`
64
+ const Rs = T(Qe)`
64
65
  display: flex;
65
66
  justify-content: space-between;
66
67
  align-items: flex-start;
@@ -72,7 +73,7 @@ const In = T(ze)`
72
73
  & > * {
73
74
  min-width: max-content;
74
75
  }
75
- `, Pn = T.div`
76
+ `, Vs = T.div`
76
77
  display: flex;
77
78
  align-items: flex-start;
78
79
  gap: 4px;
@@ -81,31 +82,31 @@ const In = T(ze)`
81
82
  right: 0;
82
83
  padding: var(--padding-m);
83
84
  background-color: var(--md-sys-color-surface-container-low);
84
- `, Fn = T(ft)`
85
+ `, $s = T(yt)`
85
86
  gap: 0px;
86
87
  height: 100%;
87
88
  padding: 0px;
88
89
  box-shadow: -2px 0 6px #00000047;
89
90
  z-index: 300;
90
- `, An = T(ze)`
91
+ `, Ls = T(Qe)`
91
92
  border-radius: 8px 8px 0 0;
92
93
  gap: var(--base-gap-small) !important;
93
94
  position: relative;
94
95
  z-index: 100;
95
96
  grid-column: span 2;
96
- `, On = ["product", "representation"], Rn = ["task"], jn = ({
97
+ `, Us = ["product", "representation"], _s = ["task"], Ms = ({
97
98
  entityType: e,
98
- currentTab: n,
99
+ currentTab: s,
99
100
  onTabChange: t,
100
101
  isLoading: o
101
102
  }) => {
102
- const s = !On.includes(e), a = Rn.includes(e);
103
- return /* @__PURE__ */ k(An, { className: o ? "loading" : "", children: [
104
- s && /* @__PURE__ */ i(
105
- Z,
103
+ const n = !Us.includes(e), a = _s.includes(e);
104
+ return /* @__PURE__ */ k(Ls, { className: o ? "loading" : "", children: [
105
+ n && /* @__PURE__ */ i(
106
+ Y,
106
107
  {
107
108
  icon: "forum",
108
- selected: n === "feed",
109
+ selected: s === "feed",
109
110
  onClick: () => t("feed"),
110
111
  "data-tooltip": "Activity Feed",
111
112
  "data-tooltip-delay": 0,
@@ -113,45 +114,45 @@ const In = T(ze)`
113
114
  }
114
115
  ),
115
116
  a && /* @__PURE__ */ i(
116
- Z,
117
+ Y,
117
118
  {
118
119
  icon: "checklist",
119
- selected: n === "subtasks",
120
+ selected: s === "subtasks",
120
121
  onClick: () => t("subtasks"),
121
122
  "data-tooltip": "Subtasks",
122
123
  "data-tooltip-delay": 0,
123
124
  variant: "text"
124
125
  }
125
126
  ),
126
- /* @__PURE__ */ i(Ge, {}),
127
+ /* @__PURE__ */ i(qe, {}),
127
128
  e === "version" && /* @__PURE__ */ i(
128
- Z,
129
+ Y,
129
130
  {
130
131
  icon: "order_play",
131
132
  onClick: () => t("files"),
132
- selected: n === "files",
133
+ selected: s === "files",
133
134
  "data-tooltip": "Version files",
134
135
  "data-tooltip-delay": 0,
135
136
  variant: "text"
136
137
  }
137
138
  ),
138
139
  /* @__PURE__ */ i(
139
- Z,
140
+ Y,
140
141
  {
141
142
  onClick: () => t("details"),
142
- selected: n === "details",
143
+ selected: s === "details",
143
144
  style: { padding: "6px 8px" },
144
145
  variant: "text",
145
146
  children: "Details"
146
147
  }
147
148
  )
148
149
  ] });
149
- }, Vn = T.div`
150
+ }, Hs = T.div`
150
151
  display: flex;
151
152
  align-items: center;
152
153
  gap: var(--base-gap-small);
153
154
  overflow: hidden;
154
- `, Un = T.button`
155
+ `, Bs = T.button`
155
156
  display: inline-flex;
156
157
  align-items: center;
157
158
  gap: var(--base-gap-small);
@@ -173,56 +174,56 @@ const In = T(ze)`
173
174
  text-overflow: ellipsis;
174
175
  white-space: nowrap;
175
176
  }
176
- `, $n = ({ entity: e, taskTypes: n }) => {
177
- const { openSlideOut: t } = q(), { projectName: o } = e, s = e.task?.name ? e.task : void 0;
178
- if (!s?.id) return null;
179
- const a = n.find((r) => r.name === s.taskType);
180
- return /* @__PURE__ */ k(Vn, { className: "linked-task", children: [
177
+ `, Ws = ({ entity: e, taskTypes: s }) => {
178
+ const { openSlideOut: t } = K(), { projectName: o } = e, n = e.task?.name ? e.task : void 0;
179
+ if (!n?.id) return null;
180
+ const a = s.find((r) => r.name === n.taskType);
181
+ return /* @__PURE__ */ k(Hs, { className: "linked-task", children: [
181
182
  /* @__PURE__ */ i("span", { children: "Task" }),
182
183
  /* @__PURE__ */ k(
183
- Un,
184
+ Bs,
184
185
  {
185
- onClick: () => t({ entityId: s.id, entityType: "task", projectName: o }),
186
+ onClick: () => t({ entityId: n.id, entityType: "task", projectName: o }),
186
187
  children: [
187
- /* @__PURE__ */ i(fe, { icon: a?.icon || "task_alt", style: { color: a?.color || void 0 } }),
188
- /* @__PURE__ */ i("span", { className: "label", children: s.label || s.name })
188
+ /* @__PURE__ */ i(we, { icon: a?.icon || "task_alt", style: { color: a?.color || void 0 } }),
189
+ /* @__PURE__ */ i("span", { className: "label", children: n.label || n.name })
189
190
  ]
190
191
  }
191
192
  )
192
193
  ] });
193
- }, et = (e, n, t) => {
194
+ }, st = (e, s, t) => {
194
195
  if (!e[0]) return [];
195
- if (n === "representation") return [{ icon: "view_in_ar" }];
196
- const o = (s) => {
197
- switch (n) {
196
+ if (s === "representation") return [{ icon: "view_in_ar" }];
197
+ const o = (n) => {
198
+ switch (s) {
198
199
  case "folder":
199
- return s.folder?.folderType ? t.folder[s.folder.folderType] : Ce("folder");
200
+ return n.folder?.folderType ? t.folder[n.folder.folderType] : De("folder");
200
201
  case "task":
201
- return s.task?.taskType ? t.task[s.task.taskType] : Ce("task");
202
+ return n.task?.taskType ? t.task[n.task.taskType] : De("task");
202
203
  case "version":
203
- return s.product?.productType ? t.product[s.product.productType] : Ce("version");
204
+ return n.product?.productType ? t.product[n.product.productType] : De("version");
204
205
  }
205
206
  };
206
- return e.slice(0, 6).map((s) => ({
207
- icon: o(s),
208
- id: s.id,
209
- type: n,
210
- thumbnailHash: s.thumbnailHash,
211
- projectName: s.projectName
207
+ return e.slice(0, 6).map((n) => ({
208
+ icon: o(n),
209
+ id: n.id,
210
+ type: s,
211
+ thumbnailHash: n.thumbnailHash,
212
+ projectName: n.projectName
212
213
  }));
213
- }, Te = (e) => e.filter((n) => !!n.icon).reduce((n, t) => ({ ...n, [t.name]: t.icon }), {}), tt = (e) => ({
214
- task: Te(e.taskTypes),
215
- folder: Te(e.folderTypes),
216
- product: Te(e.productTypes)
217
- }), nt = (e, n) => {
214
+ }, Ie = (e) => e.filter((s) => !!s.icon).reduce((s, t) => ({ ...s, [t.name]: t.icon }), {}), nt = (e) => ({
215
+ task: Ie(e.taskTypes),
216
+ folder: Ie(e.folderTypes),
217
+ product: Ie(e.productTypes)
218
+ }), at = (e, s) => {
218
219
  const t = e.length > 1, o = e[0];
219
220
  if (t)
220
221
  return {
221
- title: `${e.length} ${n}s`,
222
- subTitle: e.map((s) => s.name).join(", ")
222
+ title: `${e.length} ${s}s`,
223
+ subTitle: e.map((n) => n.name).join(", ")
223
224
  };
224
225
  if (!o) return { title: "loading...", subTitle: "loading..." };
225
- switch (n) {
226
+ switch (s) {
226
227
  case "folder":
227
228
  return {
228
229
  title: o.label || o.name || "Unknown Folder",
@@ -249,12 +250,12 @@ const In = T(ze)`
249
250
  subTitle: o.entityType || "Unknown Type"
250
251
  };
251
252
  }
252
- }, Ln = ({
253
+ }, zs = ({
253
254
  entityType: e,
254
- entitySubTypes: n,
255
+ entitySubTypes: s,
255
256
  entities: t = [],
256
257
  disabledAssignees: o = [],
257
- users: s = [],
258
+ users: n = [],
258
259
  disabledStatuses: a,
259
260
  tagsOptions: r = [],
260
261
  isFetching: c,
@@ -264,20 +265,20 @@ const In = T(ze)`
264
265
  projectInfo: g,
265
266
  onOpenViewer: b,
266
267
  onEntityFocus: x,
267
- thumbnailInputRef: R,
268
- versionsInputRef: j
268
+ thumbnailInputRef: $,
269
+ versionsInputRef: U
269
270
  }) => {
270
- const { useSearchParams: P, useNavigate: d, bundleMode: u } = q(), h = d(), [N, A] = P(), E = ee(null), y = D(() => tt(g), [g]), w = Ft(
271
+ const { useSearchParams: A, useNavigate: d, bundleMode: u } = K(), h = d(), [N, j] = A(), E = Z(null), y = C(() => nt(g), [g]), w = Vt(
271
272
  t.map((l) => l.projectName),
272
273
  [e]
273
- ), O = D(() => e === "task" ? ue(...t.map((l) => l.task?.assignees || [])) : e === "version" ? ue(
274
+ ), R = C(() => e === "task" ? ue(...t.map((l) => l.task?.assignees || [])) : e === "version" ? ue(
274
275
  ...t.map((l) => {
275
- const C = l.version?.author;
276
- return Array.isArray(C) ? C : C ? [C] : [];
276
+ const S = l.version?.author;
277
+ return Array.isArray(S) ? S : S ? [S] : [];
277
278
  })
278
279
  ) : [], [t, e]);
279
280
  let V = t[0];
280
- const L = t.length === 0 || !V || c;
281
+ const M = t.length === 0 || !V || c;
281
282
  V || (V = {
282
283
  parents: [],
283
284
  id: "placeholder",
@@ -293,87 +294,109 @@ const In = T(ze)`
293
294
  updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
294
295
  path: ""
295
296
  });
296
- const te = t.length > 1 ? void 0 : V?.projectName;
297
+ const ee = t.length > 1 ? void 0 : V?.projectName;
297
298
  t.filter((l) => l.projectName === V?.projectName && l.id).map((l) => l.id);
298
- const { data: ne } = Tt({ attributeName: "priority" }), se = qt(ne, e), ae = D(
299
- () => et(t, e, y),
299
+ const { data: te } = Pt({ attributeName: "priority" }), se = Zt(te, e), ne = C(
300
+ () => st(t, e, y),
300
301
  [t, e, y]
301
- ), I = D(() => t.map((l) => l.status), [t]), oe = D(() => t.map((l) => l.attrib?.priority), [t]), J = D(() => t.map((l) => l.tags), [t]), re = D(
302
- () => r.reduce((l, C) => (l[C.name] = C, l), {}),
302
+ ), P = C(() => t.map((l) => l.status), [t]), ae = C(() => t.map((l) => l.attrib?.priority), [t]), W = C(() => t.map((l) => l.tags), [t]), ce = C(
303
+ () => r.reduce((l, S) => (l[S.name] = S, l), {}),
303
304
  [r]
304
- ), K = t.length > 1, le = !K && !!V?.hasReviewables, $ = ae.length === 1, { attribAccess: U, updateEntity: ce } = At({
305
+ ), oe = C(() => ue(...W), [W]), pe = t.every((l) => l.projectName === V?.projectName), L = ps(
306
+ pe ? V?.projectName : void 0,
307
+ r
308
+ ), F = t.length > 1, de = C(() => Me(W), [W]), he = C(
309
+ () => Me(t.map((l) => l.task?.assignees || [])),
310
+ [t]
311
+ ), ve = !F && !!V?.hasReviewables, ye = ne.length === 1, { attribAccess: D, updateEntity: me } = $t({
305
312
  entities: t,
306
313
  entityType: e
307
- }), { writableFields: B } = U, be = !B || B.includes("status"), he = !B || B.includes("tags"), S = e === "task" && (!B || B.includes("assignees")), Y = (l, C) => {
308
- if (!(l !== "attrib" && B && !B.includes(l)) && !(l === "assignees" && !S))
309
- return C == null ? console.error("value is null or undefined") : ce(l, C);
310
- }, ve = () => {
311
- let l, C = V.id, z = e + "Id";
312
- e === "version" && V.product?.id && (l = [V.id], C = V.product?.id, z = "productId"), C && b({
313
- [z]: C,
314
- projectName: te,
314
+ }), { writableFields: G } = D, Se = !G || G.includes("status"), J = !G || G.includes("tags"), ie = e === "task" && (!G || G.includes("assignees")), re = (l, S) => {
315
+ if (!(l !== "attrib" && G && !G.includes(l)) && !(l === "assignees" && !ie))
316
+ return S == null ? console.error("value is null or undefined") : me(l, S);
317
+ }, z = (l, S) => {
318
+ const I = new Map(
319
+ t.map((q) => [q.id, (l === "tags" ? q.tags : q.task?.assignees) || []])
320
+ );
321
+ l === "tags" && L?.addTags(S.add), re(l, (q) => kt(I.get(q) || [], S));
322
+ }, _ = () => {
323
+ let l, S = V.id, I = e + "Id";
324
+ e === "version" && V.product?.id && (l = [V.id], S = V.product?.id, I = "productId"), S && b({
325
+ [I]: S,
326
+ projectName: ee,
315
327
  versionIds: l
316
328
  });
317
- }, me = (e === "task" || e === "version") && (O.length > 0 || e === "task"), Q = [...Ct(s, O)];
318
- if (me) {
319
- const l = s.map((z) => z.name), C = O.filter((z) => !l.includes(z));
320
- C.length && Q.push(...C.map((z) => ({ name: z, fullName: z })));
329
+ }, Q = (e === "task" || e === "version") && (R.length > 0 || e === "task"), ke = [...Dt(n, R)];
330
+ if (Q) {
331
+ const l = n.map((I) => I.name), S = R.filter((I) => !l.includes(I));
332
+ S.length && ke.push(...S.map((I) => ({ name: I, fullName: I })));
321
333
  }
322
- const { title: de, subTitle: ye } = nt(t, e), W = w?.length !== 0 && w?.find((l) => l.name === I[0]);
323
- return /* @__PURE__ */ i(Ot, { children: /* @__PURE__ */ i(
324
- zt,
334
+ const { title: Ce, subTitle: ge } = at(t, e), fe = w?.length !== 0 && w?.find((l) => l.name === P[0]);
335
+ return /* @__PURE__ */ i(Lt, { children: /* @__PURE__ */ i(
336
+ Jt,
325
337
  {
326
338
  entities: t,
327
339
  entityType: e,
328
- projectName: te,
329
- thumbnailInputRef: R,
330
- versionsInputRef: j,
340
+ projectName: ee,
341
+ thumbnailInputRef: $,
342
+ versionsInputRef: U,
331
343
  onVersionCreated: (l) => x?.(l, "version"),
332
- children: /* @__PURE__ */ k(Rt, { className: ie("details-panel-header", { isCompact: m }), children: [
344
+ children: /* @__PURE__ */ k(Ut, { className: le("details-panel-header", { isCompact: m }), children: [
333
345
  /* @__PURE__ */ k(
334
- jt,
346
+ _t,
335
347
  {
336
- className: ie("titles", { isCompact: m, loading: L }, "no-shimmer"),
348
+ className: le("titles", { isCompact: m, loading: M }, "no-shimmer"),
337
349
  children: [
338
350
  /* @__PURE__ */ k("div", { style: { position: "relative" }, children: [
339
351
  /* @__PURE__ */ i(
340
- Xe,
352
+ Ye,
341
353
  {
342
- isLoading: L,
343
- shimmer: L,
344
- thumbnails: ae,
345
- onClick: $ ? ve : void 0,
346
- hoverIcon: le ? "play_circle" : void 0
354
+ isLoading: M,
355
+ shimmer: M,
356
+ thumbnails: ne,
357
+ onClick: ye ? _ : void 0,
358
+ hoverIcon: ve ? "play_circle" : void 0
347
359
  }
348
360
  ),
349
- le && /* @__PURE__ */ i(ln, {})
361
+ ve && /* @__PURE__ */ i(fs, {})
350
362
  ] }),
351
- /* @__PURE__ */ k(Vt, { className: ie({ loading: L }), children: [
352
- /* @__PURE__ */ k(Ut, { children: [
353
- /* @__PURE__ */ i("h2", { children: de }),
354
- he ? /* @__PURE__ */ i(
355
- $t,
356
- {
357
- ref: E,
358
- value: ue(...J),
359
- tags: re,
360
- options: [],
361
- editable: !0,
362
- editor: !0,
363
- onChange: (l) => Y("tags", l),
364
- align: "right",
365
- styleDropdown: { display: L ? "none" : "unset" },
366
- className: "tags-select",
367
- itemClassName: "details-tag"
368
- }
369
- ) : /* @__PURE__ */ i(Lt, { className: "tags-select", children: ue(...J).length ? ue(...J).map((l) => {
370
- const C = re[l]?.color;
363
+ /* @__PURE__ */ k(Mt, { className: le({ loading: M }), children: [
364
+ /* @__PURE__ */ k(Ht, { children: [
365
+ /* @__PURE__ */ i("h2", { children: Ce }),
366
+ J ? /* @__PURE__ */ k(xe, { children: [
367
+ /* @__PURE__ */ i(
368
+ Bt,
369
+ {
370
+ ref: E,
371
+ value: ue(...W),
372
+ tags: ce,
373
+ options: [],
374
+ editable: !0,
375
+ editor: !0,
376
+ onChange: (l) => {
377
+ L?.addTags(l.filter((S) => !oe.includes(S))), re("tags", l);
378
+ },
379
+ mixedCounts: F ? de : void 0,
380
+ mixedTotal: t.length,
381
+ mixedLabel: `${e}s`,
382
+ onMixedChange: (l) => z("tags", l),
383
+ onEditOption: L?.onEditOption,
384
+ editOptionTooltip: "Change the colour in the project tags",
385
+ align: "right",
386
+ styleDropdown: { display: M ? "none" : "unset" },
387
+ className: "tags-select",
388
+ itemClassName: "details-tag"
389
+ }
390
+ ),
391
+ L && /* @__PURE__ */ i(hs, { ...L.dialog })
392
+ ] }) : /* @__PURE__ */ i(Wt, { className: "tags-select", children: ue(...W).length ? ue(...W).map((l) => {
393
+ const S = ce[l]?.color;
371
394
  return /* @__PURE__ */ i(
372
395
  "span",
373
396
  {
374
397
  style: {
375
- backgroundColor: C || void 0,
376
- color: C ? Ee(C) : void 0
398
+ backgroundColor: S || void 0,
399
+ color: S ? Fe(S) : void 0
377
400
  },
378
401
  children: l
379
402
  },
@@ -383,13 +406,13 @@ const In = T(ze)`
383
406
  ] }),
384
407
  /* @__PURE__ */ k("div", { className: "sub-title", children: [
385
408
  /* @__PURE__ */ k("span", { className: "entity-type", children: [
386
- Je(e),
409
+ Ze(e),
387
410
  " - "
388
411
  ] }),
389
- /* @__PURE__ */ i("h3", { children: ye })
412
+ /* @__PURE__ */ i("h3", { children: ge })
390
413
  ] }),
391
- e === "version" && !K && !L && V && /* @__PURE__ */ i(
392
- $n,
414
+ e === "version" && !F && !M && V && /* @__PURE__ */ i(
415
+ Ws,
393
416
  {
394
417
  entity: V,
395
418
  taskTypes: g.taskTypes
@@ -401,77 +424,81 @@ const In = T(ze)`
401
424
  }
402
425
  ),
403
426
  /* @__PURE__ */ i(
404
- _t,
427
+ zt,
405
428
  {
406
- value: I,
429
+ value: P,
407
430
  options: w || [],
408
431
  disabledValues: a,
409
- disableOpen: !be,
432
+ disableOpen: !Se,
410
433
  invert: !0,
411
434
  style: { maxWidth: "unset" },
412
- onChange: (l) => Y("status", l),
413
- className: ie("status-select", { loading: L }),
435
+ onChange: (l) => re("status", l),
436
+ className: le("status-select", { loading: M }),
414
437
  align: m ? "right" : "left",
415
- $textColor: Ee(W !== void 0 ? W.color : "#OOO")
438
+ $textColor: Fe(fe !== void 0 ? fe.color : "#OOO")
416
439
  }
417
440
  ),
418
- !m && (!me || L ? /* @__PURE__ */ i("div", {}) : /* @__PURE__ */ i(
419
- Mt,
441
+ !m && (!Q || M ? /* @__PURE__ */ i("div", {}) : /* @__PURE__ */ i(
442
+ Gt,
420
443
  {
421
- value: O,
422
- options: Q,
444
+ value: R,
445
+ options: ke,
423
446
  disabledValues: o.map((l) => l.name),
424
- isMultiple: K && O.length > 1 && e === "task",
425
- readOnly: !S,
426
- emptyMessage: S ? "Assign user" : "-",
447
+ isMultiple: F && R.length > 1 && e === "task",
448
+ readOnly: !ie,
449
+ emptyMessage: ie ? "Assign user" : "-",
427
450
  align: "right",
428
- onChange: (l) => Y("assignees", l),
451
+ onChange: (l) => re("assignees", l),
452
+ mixedCounts: F && e === "task" ? he : void 0,
453
+ mixedTotal: t.length,
454
+ mixedLabel: `${e}s`,
455
+ onMixedChange: (l) => z("assignees", l),
429
456
  className: "assignee-select",
430
- "data-tooltip": O.length ? e === "task" ? "Assigned users" : "Author" : ""
457
+ "data-tooltip": R.length ? e === "task" ? "Assigned users" : "Author" : ""
431
458
  }
432
459
  )),
433
460
  /* @__PURE__ */ i(
434
- rn,
461
+ us,
435
462
  {
436
463
  entities: t,
437
464
  entityType: e,
438
- entitySubTypes: n,
439
- isLoadingEntity: !!c || !!L,
465
+ entitySubTypes: s,
466
+ isLoadingEntity: !!c || !!M,
440
467
  searchParams: N,
441
468
  bundleMode: u,
442
- onSetSearchParams: A,
469
+ onSetSearchParams: j,
443
470
  onNavigate: h
444
471
  }
445
472
  ),
446
473
  se ? /* @__PURE__ */ i(
447
- Ht,
474
+ Qt,
448
475
  {
449
476
  options: se,
450
477
  placeholder: "No priority",
451
- value: oe,
452
- onChange: (l) => Y("attrib", { priority: l[0] }),
478
+ value: ae,
479
+ onChange: (l) => re("attrib", { priority: l[0] }),
453
480
  align: "right"
454
481
  }
455
482
  ) : /* @__PURE__ */ i("div", { style: { height: 32 } }),
456
483
  /* @__PURE__ */ i(
457
- jn,
484
+ Ms,
458
485
  {
459
486
  entityType: e,
460
487
  currentTab: f,
461
488
  onTabChange: p,
462
- isLoading: L
489
+ isLoading: M
463
490
  }
464
491
  )
465
492
  ] })
466
493
  }
467
494
  ) });
468
- }, _n = T.div`
495
+ }, Gs = T.div`
469
496
  display: flex;
470
497
  flex-direction: column;
471
498
 
472
499
  height: 100%;
473
500
  overflow: hidden;
474
- `, Me = T.div`
501
+ `, Be = T.div`
475
502
  position: relative;
476
503
  flex: 1;
477
504
  display: flex;
@@ -485,40 +512,40 @@ const In = T(ze)`
485
512
  &:first-child {
486
513
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
487
514
  }
488
- `, Mn = ({
515
+ `, Qs = ({
489
516
  entities: e = [],
490
- scope: n,
517
+ scope: s,
491
518
  isLoadingVersion: t
492
519
  }) => {
493
520
  const o = e[0];
494
521
  if (!o) return null;
495
- let s = "Reviewables";
496
- return e.length > 1 && (s += ` (${o.name})`), e.some((a) => a.entityType !== "version") ? null : /* @__PURE__ */ k(_n, { children: [
497
- /* @__PURE__ */ k(Me, { children: [
498
- /* @__PURE__ */ i("h4", { children: s }),
522
+ let n = "Reviewables";
523
+ return e.length > 1 && (n += ` (${o.name})`), e.some((a) => a.entityType !== "version") ? null : /* @__PURE__ */ k(Gs, { children: [
524
+ /* @__PURE__ */ k(Be, { children: [
525
+ /* @__PURE__ */ i("h4", { children: n }),
499
526
  /* @__PURE__ */ i(
500
- Gt,
527
+ Xt,
501
528
  {
502
529
  projectName: o.projectName,
503
530
  productId: o.product?.id,
504
531
  versionId: o.id,
505
532
  isLoadingVersion: t,
506
- scope: n
533
+ scope: s
507
534
  }
508
535
  )
509
536
  ] }),
510
- /* @__PURE__ */ k(Me, { children: [
537
+ /* @__PURE__ */ k(Be, { children: [
511
538
  /* @__PURE__ */ i("h4", { children: "Representations" }),
512
- /* @__PURE__ */ i(cn, { entities: e })
539
+ /* @__PURE__ */ i(bs, { entities: e })
513
540
  ] })
514
541
  ] });
515
- }, Hn = ({
542
+ }, qs = ({
516
543
  latestVersion: e,
517
- resolveVersionJump: n
544
+ resolveVersionJump: s
518
545
  }) => {
519
- const t = n?.(e.id);
546
+ const t = s?.(e.id);
520
547
  return /* @__PURE__ */ i(
521
- dn,
548
+ vs,
522
549
  {
523
550
  variant: "info",
524
551
  compact: !0,
@@ -532,21 +559,21 @@ const In = T(ze)`
532
559
  } : void 0
533
560
  }
534
561
  );
535
- }, Bn = (e) => {
536
- const n = e?.version?.version, t = e?.product?.latestVersion;
537
- if (!(e?.entityType !== "version" || !n || n <= 0 || !t?.active))
538
- return t.version > n ? t : void 0;
539
- }, Wn = () => ({
540
- onOpenVersionUpload: mn()?.onOpenVersionUpload ?? null
541
- }), zn = (e, n, t) => {
562
+ }, Ks = (e) => {
563
+ const s = e?.version?.version, t = e?.product?.latestVersion;
564
+ if (!(e?.entityType !== "version" || !s || s <= 0 || !t?.active))
565
+ return t.version > s ? t : void 0;
566
+ }, Js = () => ({
567
+ onOpenVersionUpload: xs()?.onOpenVersionUpload ?? null
568
+ }), Xs = (e, s, t) => {
542
569
  const o = e === "folder" || e === "task" ? "overview" : e === "product" || e === "version" || e === "representation" ? "products" : null;
543
- return o ? `${typeof window < "u" ? window.location.origin : ""}/projects/${t}/${o}?project=${t}&type=${e}&id=${n}` : null;
544
- }, Gn = ({
570
+ return o ? `${typeof window < "u" ? window.location.origin : ""}/projects/${t}/${o}?project=${t}&type=${e}&id=${s}` : null;
571
+ }, Ys = ({
545
572
  entityType: e,
546
- entityId: n,
573
+ entityId: s,
547
574
  projectName: t,
548
575
  selectedEntities: o,
549
- deleteEntities: s,
576
+ deleteEntities: n,
550
577
  canUploadThumbnail: a,
551
578
  canUploadVersion: r,
552
579
  canOpenPip: c,
@@ -556,17 +583,17 @@ const In = T(ze)`
556
583
  onPip: g,
557
584
  onOpenViewer: b,
558
585
  onUploadThumbnail: x,
559
- onUploadVersion: R,
560
- onShare: j,
561
- onViewData: P,
586
+ onUploadVersion: $,
587
+ onShare: U,
588
+ onViewData: A,
562
589
  onDelete: d
563
590
  }) => {
564
- const u = D(() => o.length ? o.filter((h) => !!h?.entityId).map((h) => ({
591
+ const u = C(() => o.length ? o.filter((h) => !!h?.entityId).map((h) => ({
565
592
  entityId: h.entityId,
566
593
  entityType: h.entityType || e,
567
594
  hasReviewables: h.hasReviewables
568
- })) : n ? [{ entityId: n, entityType: e }] : [], [o, n, e]);
569
- return D(() => {
595
+ })) : s ? [{ entityId: s, entityType: e }] : [], [o, s, e]);
596
+ return C(() => {
570
597
  const h = [];
571
598
  if (m && h.push({
572
599
  id: "open-in-viewer",
@@ -587,7 +614,7 @@ const In = T(ze)`
587
614
  id: "upload-version",
588
615
  label: "Upload version",
589
616
  icon: "upload",
590
- onClick: R
617
+ onClick: $
591
618
  }), p?.openAddToListDialog && t && u.length) {
592
619
  const E = u[0]?.entityType || e, y = p.openAddToListDialog;
593
620
  if (h.push({
@@ -596,34 +623,34 @@ const In = T(ze)`
596
623
  icon: "list_alt_add",
597
624
  onClick: () => y(E, u)
598
625
  }), (E === "version" || E === "representation") && p.hasReviewAddon) {
599
- const O = u.some((V) => V.hasReviewables === !0);
626
+ const R = u.some((V) => V.hasReviewables === !0);
600
627
  h.push({
601
628
  id: "add-to-review-list",
602
629
  label: "Add to session",
603
630
  icon: "list_alt_add",
604
- disabled: !O,
605
- ...O ? {} : { "data-tooltip": "No reviewables on selected version" },
631
+ disabled: !R,
632
+ ...R ? {} : { "data-tooltip": "No reviewables on selected version" },
606
633
  onClick: () => y(E, u, { isReview: !0 })
607
634
  });
608
635
  }
609
636
  }
610
- const N = u[0], A = N?.entityId && t ? zn(
637
+ const N = u[0], j = N?.entityId && t ? Xs(
611
638
  N.entityType || e,
612
639
  N.entityId,
613
640
  t
614
641
  ) : null;
615
- if (A && h.push({
642
+ if (j && h.push({
616
643
  id: "share",
617
644
  label: "Share",
618
645
  icon: "share",
619
- onClick: () => j(A)
646
+ onClick: () => U(j)
620
647
  }), h.push({
621
648
  id: "view-data",
622
649
  label: "View data",
623
650
  icon: "database",
624
- onClick: P
625
- }), f && s.length > 0) {
626
- const E = new Set(s.map((O) => O.entityType)), y = E.size === 1 ? [...E][0] : "item", w = s.length === 1 ? `Delete ${y}` : `Delete ${gn(s.length, y)}`;
651
+ onClick: A
652
+ }), f && n.length > 0) {
653
+ const E = new Set(n.map((R) => R.entityType)), y = E.size === 1 ? [...E][0] : "item", w = n.length === 1 ? `Delete ${y}` : `Delete ${Ss(n.length, y)}`;
627
654
  h.push({
628
655
  id: "delete",
629
656
  label: w,
@@ -632,14 +659,14 @@ const In = T(ze)`
632
659
  onClick: d
633
660
  });
634
661
  }
635
- return { items: h, shareLink: A };
662
+ return { items: h, shareLink: j };
636
663
  }, [
637
664
  c,
638
665
  m,
639
666
  a,
640
667
  r,
641
668
  f,
642
- s,
669
+ n,
643
670
  p,
644
671
  t,
645
672
  u,
@@ -647,23 +674,23 @@ const In = T(ze)`
647
674
  g,
648
675
  b,
649
676
  x,
650
- R,
651
- j,
652
- P,
677
+ $,
678
+ U,
679
+ A,
653
680
  d
654
681
  ]);
655
- }, Qn = T.div`
682
+ }, Zs = T.div`
656
683
  display: flex;
657
684
  flex-direction: column;
658
685
  gap: 16px;
659
- `, He = T.div`
686
+ `, We = T.div`
660
687
  display: flex;
661
688
  flex-direction: column;
662
689
  gap: 6px;
663
- `, Be = T.span`
690
+ `, ze = T.span`
664
691
  font-size: 13px;
665
692
  color: var(--md-sys-color-on-surface);
666
- `, We = T.button`
693
+ `, Ge = T.button`
667
694
  display: flex;
668
695
  align-items: center;
669
696
  gap: 12px;
@@ -692,47 +719,47 @@ const In = T(ze)`
692
719
  text-overflow: ellipsis;
693
720
  white-space: nowrap;
694
721
  }
695
- `, qn = ({ link: e, entityLabel: n, visible: t, onHide: o }) => {
722
+ `, en = ({ link: e, entityLabel: s, visible: t, onHide: o }) => {
696
723
  if (!t) return null;
697
- const s = `[${n}](${e})`, a = (r) => {
698
- fn(r, !0), o();
724
+ const n = `[${s}](${e})`, a = (r) => {
725
+ Cs(r, !0), o();
699
726
  };
700
- return /* @__PURE__ */ i(bt, { isOpen: !0, onClose: o, size: "sm", header: "Share", children: /* @__PURE__ */ k(Qn, { children: [
701
- /* @__PURE__ */ k(He, { children: [
702
- /* @__PURE__ */ i(Be, { children: "Link" }),
703
- /* @__PURE__ */ k(We, { type: "button", onClick: () => a(e), "aria-label": "Copy link", children: [
727
+ return /* @__PURE__ */ i(wt, { isOpen: !0, onClose: o, size: "sm", header: "Share", children: /* @__PURE__ */ k(Zs, { children: [
728
+ /* @__PURE__ */ k(We, { children: [
729
+ /* @__PURE__ */ i(ze, { children: "Link" }),
730
+ /* @__PURE__ */ k(Ge, { type: "button", onClick: () => a(e), "aria-label": "Copy link", children: [
704
731
  /* @__PURE__ */ i("span", { className: "value", children: e }),
705
- /* @__PURE__ */ i(fe, { icon: "content_copy" })
732
+ /* @__PURE__ */ i(we, { icon: "content_copy" })
706
733
  ] })
707
734
  ] }),
708
- /* @__PURE__ */ k(He, { children: [
709
- /* @__PURE__ */ i(Be, { children: "Markdown Link" }),
710
- /* @__PURE__ */ k(We, { type: "button", onClick: () => a(s), "aria-label": "Copy markdown link", children: [
711
- /* @__PURE__ */ i("span", { className: "value", children: s }),
712
- /* @__PURE__ */ i(fe, { icon: "content_copy" })
735
+ /* @__PURE__ */ k(We, { children: [
736
+ /* @__PURE__ */ i(ze, { children: "Markdown Link" }),
737
+ /* @__PURE__ */ k(Ge, { type: "button", onClick: () => a(n), "aria-label": "Copy markdown link", children: [
738
+ /* @__PURE__ */ i("span", { className: "value", children: n }),
739
+ /* @__PURE__ */ i(we, { icon: "content_copy" })
713
740
  ] })
714
741
  ] })
715
742
  ] }) });
716
- }, Kn = (e, n, t, o) => {
717
- const s = { projectName: t, quickView: !0 };
743
+ }, tn = (e, s, t, o) => {
744
+ const n = { projectName: t, quickView: !0 };
718
745
  switch (e) {
719
746
  case "folder":
720
- return { ...s, folderId: n };
747
+ return { ...n, folderId: s };
721
748
  case "task":
722
- return { ...s, taskId: n };
749
+ return { ...n, taskId: s };
723
750
  case "product":
724
- return { ...s, productId: n };
751
+ return { ...n, productId: s };
725
752
  case "version":
726
- return o ? { ...s, productId: o, versionIds: [n] } : null;
753
+ return o ? { ...n, productId: o, versionIds: [s] } : null;
727
754
  default:
728
755
  return null;
729
756
  }
730
- }, Xn = ({
757
+ }, sn = ({
731
758
  entityType: e,
732
- entityId: n,
759
+ entityId: s,
733
760
  entityIds: t,
734
761
  entityLabel: o,
735
- projectName: s,
762
+ projectName: n,
736
763
  selectedEntities: a = [],
737
764
  entityListsContext: r,
738
765
  onOpenPip: c,
@@ -741,154 +768,154 @@ const In = T(ze)`
741
768
  taskId: p,
742
769
  folderId: g
743
770
  }) => {
744
- const b = ee(null), [x, R] = X(!1), [j, P] = X(null), { menuOpen: d, toggleMenuOpen: u, setMenuOpen: h } = Jt(), { triggerThumbnailUpload: N, canUploadVersion: A } = wt(Yt), { onOpenVersionUpload: E } = Wn(), y = xt(), w = D(() => {
745
- const $ = n || t?.[0] || "noentity";
746
- return `details-more-menu-${y}-${$}-${s || "noproject"}`;
747
- }, [y, n, t, s]), O = d === w, V = !!n && !!s && !!N, L = !!A && !!E, te = () => {
771
+ const b = Z(null), [x, $] = X(!1), [U, A] = X(null), { menuOpen: d, toggleMenuOpen: u, setMenuOpen: h } = ss(), { triggerThumbnailUpload: N, canUploadVersion: j } = Tt(ns), { onOpenVersionUpload: E } = Js(), y = Nt(), w = C(() => {
772
+ const L = s || t?.[0] || "noentity";
773
+ return `details-more-menu-${y}-${L}-${n || "noproject"}`;
774
+ }, [y, s, t, n]), R = d === w, V = !!s && !!n && !!N, M = !!j && !!E, ee = () => {
748
775
  E?.({ productId: f, taskId: p, folderId: g });
749
- }, ne = n && s ? Kn(e, n, s, f) : null, se = !!m && !!ne, ae = Zt(), I = D(() => (a.length ? a : n ? [{ entityId: n, entityType: e, projectName: s }] : []).map((U) => {
750
- const ce = U.entityType || e, B = U.projectName || s;
751
- return !en(ce) || !U.entityId || !B ? null : {
752
- id: U.entityId,
753
- entityType: ce,
754
- name: U.name,
755
- label: U.label,
756
- projectName: B,
757
- folderId: U.folderId,
758
- parentId: U.parentId
776
+ }, te = s && n ? tn(e, s, n, f) : null, se = !!m && !!te, ne = as(), P = C(() => (a.length ? a : s ? [{ entityId: s, entityType: e, projectName: n }] : []).map((F) => {
777
+ const de = F.entityType || e, he = F.projectName || n;
778
+ return !os(de) || !F.entityId || !he ? null : {
779
+ id: F.entityId,
780
+ entityType: de,
781
+ name: F.name,
782
+ label: F.label,
783
+ projectName: he,
784
+ folderId: F.folderId,
785
+ parentId: F.parentId
759
786
  };
760
- }).filter((U) => U !== null), [a, n, e, s]), oe = !!ae && I.length > 0, J = () => {
761
- h(!1), ae?.deleteEntities(I);
762
- }, { items: re } = Gn({
787
+ }).filter((F) => F !== null), [a, s, e, n]), ae = !!ne && P.length > 0, W = () => {
788
+ h(!1), ne?.deleteEntities(P);
789
+ }, { items: ce } = Ys({
763
790
  entityType: e,
764
- entityId: n,
765
- projectName: s,
791
+ entityId: s,
792
+ projectName: n,
766
793
  selectedEntities: a,
767
- deleteEntities: I,
794
+ deleteEntities: P,
768
795
  canUploadThumbnail: V,
769
- canUploadVersion: L,
796
+ canUploadVersion: M,
770
797
  canOpenPip: !!c,
771
798
  canOpenViewer: se,
772
- canDelete: oe,
799
+ canDelete: ae,
773
800
  entityListsContext: r,
774
801
  onPip: () => c?.(),
775
- onOpenViewer: () => ne && m?.(ne),
802
+ onOpenViewer: () => te && m?.(te),
776
803
  onUploadThumbnail: () => N?.(),
777
- onUploadVersion: te,
778
- onShare: ($) => P($),
779
- onViewData: () => R(!0),
780
- onDelete: J
781
- }), K = t?.length ? t : n ? [n] : [], le = o || n || "";
782
- return /* @__PURE__ */ k(Ie, { children: [
804
+ onUploadVersion: ee,
805
+ onShare: (L) => A(L),
806
+ onViewData: () => $(!0),
807
+ onDelete: W
808
+ }), oe = t?.length ? t : s ? [s] : [], pe = o || s || "";
809
+ return /* @__PURE__ */ k(xe, { children: [
783
810
  /* @__PURE__ */ i(
784
- Z,
811
+ Y,
785
812
  {
786
813
  ref: b,
787
814
  icon: "more_horiz",
788
815
  variant: "text",
789
816
  "data-tooltip": "More actions",
790
817
  "aria-label": "More actions",
791
- className: ie({ active: O }),
818
+ className: le({ active: R }),
792
819
  onClick: () => u(w)
793
820
  }
794
821
  ),
795
- /* @__PURE__ */ i(un, { id: w, target: b.current, align: "right", children: /* @__PURE__ */ i(pn, { menu: re, onClose: () => h(!1) }) }),
796
- x && s && K.length > 0 && /* @__PURE__ */ i(
797
- hn,
822
+ /* @__PURE__ */ i(ys, { id: w, target: b.current, align: "right", children: /* @__PURE__ */ i(ks, { menu: ce, onClose: () => h(!1) }) }),
823
+ x && n && oe.length > 0 && /* @__PURE__ */ i(
824
+ ws,
798
825
  {
799
- projectName: s,
826
+ projectName: n,
800
827
  entityType: e,
801
- entityIds: K,
828
+ entityIds: oe,
802
829
  visible: x,
803
- onHide: () => R(!1)
830
+ onHide: () => $(!1)
804
831
  }
805
832
  ),
806
- j && /* @__PURE__ */ i(
807
- qn,
833
+ U && /* @__PURE__ */ i(
834
+ en,
808
835
  {
809
- link: j,
810
- entityLabel: le,
836
+ link: U,
837
+ entityLabel: pe,
811
838
  visible: !0,
812
- onHide: () => P(null)
839
+ onHide: () => A(null)
813
840
  }
814
841
  )
815
842
  ] });
816
- }, Jn = (e, n) => {
843
+ }, nn = (e, s) => {
817
844
  const t = [e];
818
845
  let o = e;
819
846
  for (; o.parentId && o.parentId !== "root"; ) {
820
- const s = n.get(o.parentId);
821
- if (!s)
847
+ const n = s.get(o.parentId);
848
+ if (!n)
822
849
  break;
823
- t.unshift(s), o = s;
850
+ t.unshift(n), o = n;
824
851
  }
825
852
  return t;
826
- }, Yn = (e, n) => {
853
+ }, an = (e, s) => {
827
854
  const t = [];
828
- let o = n.get(e.folder?.id || "");
829
- if ((o ? Jn(o, n) : []).forEach((a) => {
855
+ let o = s.get(e.folder?.id || "");
856
+ if ((o ? nn(o, s) : []).forEach((a) => {
830
857
  t.push({ type: "folder", label: a.label || a.name, id: a.id });
831
858
  }), e.entityType === "version") {
832
859
  const a = `${e.product?.name} - ${e.name}`;
833
860
  t.push({ type: "version", label: a, id: e.id });
834
861
  }
835
862
  return e.entityType === "task" && t.push({ type: "task", label: e.label || e.name, id: e.id }), t;
836
- }, Zn = ({
863
+ }, on = ({
837
864
  entity: e,
838
- entityType: n,
865
+ entityType: s,
839
866
  projectName: t,
840
867
  isLoading: o
841
868
  }) => {
842
- const { data: { folders: s = [] } = {}, isFetching: a } = Nt(
869
+ const { data: { folders: n = [] } = {}, isFetching: a } = Ft(
843
870
  // TODO: this is major overkill, we are only using label, name and id
844
871
  // We add a patch field that allows us to specify what ws message changes should cause an update to this query
845
872
  // @ts-expect-error - patch is not part of the query args
846
873
  { projectName: t, patch: ["id", "name", "label"] },
847
874
  { skip: !t || o }
848
- ), r = bn(
875
+ ), r = Ts(
849
876
  { projectName: t || "", isLoading: o },
850
877
  a
851
- ), { data: c } = Et(
878
+ ), { data: c } = At(
852
879
  { productId: e.product?.id || "", projectName: t },
853
- { skip: n !== "version" || !e.product?.id }
854
- ), m = D(
880
+ { skip: s !== "version" || !e.product?.id }
881
+ ), m = C(
855
882
  () => c?.project.product?.versionList ? [...c.project.product?.versionList || []].sort((g, b) => g.name === "HERO" ? -1 : b.name === "HERO" ? 1 : b.name.localeCompare(g.name)).map((g) => ({
856
883
  type: "version",
857
884
  label: g.name,
858
885
  id: g.id
859
886
  })) : [],
860
887
  [c]
861
- ), f = D(
862
- () => new Map(s.map((g) => [g.id, g])),
863
- [s]
888
+ ), f = C(
889
+ () => new Map(n.map((g) => [g.id, g])),
890
+ [n]
864
891
  );
865
- return [D(
866
- () => r ? [] : Yn(e, f),
867
- [r, s, e]
892
+ return [C(
893
+ () => r ? [] : an(e, f),
894
+ [r, n, e]
868
895
  ), m];
869
- }, st = (e, n) => {
870
- let t = Object.entries(e).filter(([s]) => n ? n.includes(s) : !0).map(([, s]) => s?.statuses || []).flat();
871
- const o = new Map(t.map((s) => [s.name, s]));
896
+ }, ot = (e, s) => {
897
+ let t = Object.entries(e).filter(([n]) => s ? s.includes(n) : !0).map(([, n]) => n?.statuses || []).flat();
898
+ const o = new Map(t.map((n) => [n.name, n]));
872
899
  return Array.from(o.values());
873
- }, at = ({
900
+ }, it = ({
874
901
  scope: e = "dashboard",
875
- entities: n,
902
+ entities: s,
876
903
  entityType: t,
877
904
  thumbnailHash: o,
878
- projectName: s,
905
+ projectName: n,
879
906
  projectInfo: a,
880
907
  annotations: r,
881
908
  removeAnnotation: c,
882
909
  exportAnnotationComposite: m,
883
910
  ...f
884
911
  }) => {
885
- const p = { annotations: r, removeAnnotation: c, exportAnnotationComposite: m }, { user: g } = q(), b = g.name || "", x = g.attrib?.fullName || "";
912
+ const p = { annotations: r, removeAnnotation: c, exportAnnotationComposite: m }, { user: g } = K(), b = g.name || "", x = g.attrib?.fullName || "";
886
913
  return /* @__PURE__ */ k(
887
- Ze,
914
+ tt,
888
915
  {
889
916
  scope: e,
890
- entities: n,
891
- projectName: s,
917
+ entities: s,
918
+ projectName: n,
892
919
  entityType: t,
893
920
  projectInfo: a,
894
921
  userName: b,
@@ -896,43 +923,43 @@ const In = T(ze)`
896
923
  ...p,
897
924
  ...f,
898
925
  children: [
899
- /* @__PURE__ */ i(vn, { ...f, statuses: f.statuses }),
900
- /* @__PURE__ */ i(yn, {})
926
+ /* @__PURE__ */ i(Ns, { ...f, statuses: f.statuses }),
927
+ /* @__PURE__ */ i(Es, {})
901
928
  ]
902
929
  }
903
930
  );
904
- }, es = ({
931
+ }, rn = ({
905
932
  children: e,
906
- scope: n = "dashboard",
933
+ scope: s = "dashboard",
907
934
  entities: t,
908
935
  entityType: o,
909
- projectName: s,
936
+ projectName: n,
910
937
  projectInfo: a,
911
938
  annotations: r,
912
939
  removeAnnotation: c,
913
940
  exportAnnotationComposite: m,
914
941
  ...f
915
942
  }) => {
916
- const p = { annotations: r, removeAnnotation: c, exportAnnotationComposite: m }, { user: g } = q(), b = g?.name ?? "", x = g?.attrib?.fullName ?? "", [R, j] = X(null);
943
+ const p = { annotations: r, removeAnnotation: c, exportAnnotationComposite: m }, { user: g } = K(), b = g?.name ?? "", x = g?.attrib?.fullName ?? "", [$, U] = X(null);
917
944
  return /* @__PURE__ */ i(
918
- Ze,
945
+ tt,
919
946
  {
920
- scope: n,
947
+ scope: s,
921
948
  entities: t,
922
- projectName: s,
949
+ projectName: n,
923
950
  entityType: o,
924
951
  projectInfo: a,
925
952
  userName: b,
926
953
  userFullName: x,
927
954
  ...p,
928
- editingId: R,
929
- setEditingId: j,
955
+ editingId: $,
956
+ setEditingId: U,
930
957
  ...f,
931
958
  children: e
932
959
  }
933
960
  );
934
- }, ot = (e, n) => {
935
- if (!e || Object.keys(e).length === 0 || !n?.length)
961
+ }, rt = (e, s) => {
962
+ if (!e || Object.keys(e).length === 0 || !s?.length)
936
963
  return {
937
964
  folderTypes: [],
938
965
  taskTypes: [],
@@ -941,8 +968,8 @@ const In = T(ze)`
941
968
  linkTypes: [],
942
969
  productTypes: []
943
970
  };
944
- if (n.length === 1) {
945
- const a = e[n[0]];
971
+ if (s.length === 1) {
972
+ const a = e[s[0]];
946
973
  return {
947
974
  folderTypes: a?.folderTypes || [],
948
975
  taskTypes: a?.taskTypes || [],
@@ -957,7 +984,7 @@ const In = T(ze)`
957
984
  return a.flat().forEach((c) => {
958
985
  c && c.name && (r[c.name] = c);
959
986
  }), Object.values(r);
960
- }, s = {
987
+ }, n = {
961
988
  statuses: [],
962
989
  folderTypes: [],
963
990
  taskTypes: [],
@@ -965,33 +992,33 @@ const In = T(ze)`
965
992
  linkTypes: [],
966
993
  productTypes: []
967
994
  };
968
- return n.forEach((a) => {
995
+ return s.forEach((a) => {
969
996
  const r = e[a];
970
- r && (Object.keys(s).forEach((c) => {
971
- c === "productTypes" ? r.productTypes && s[c].push(r) : Array.isArray(r[c]) && s[c].push(r[c]);
997
+ r && (Object.keys(n).forEach((c) => {
998
+ c === "productTypes" ? r.productTypes && n[c].push(r) : Array.isArray(r[c]) && n[c].push(r[c]);
972
999
  }), Object.keys(r).forEach((c) => {
973
- c in s || (t[c] = r[c]);
1000
+ c in n || (t[c] = r[c]);
974
1001
  }));
975
- }), Object.keys(s).forEach((a) => {
976
- (a === "productTypes" || s[a].length > 0) && (t[a] = o(s[a]));
1002
+ }), Object.keys(n).forEach((a) => {
1003
+ (a === "productTypes" || n[a].length > 0) && (t[a] = o(n[a]));
977
1004
  }), t;
978
- }, ts = T.div`
1005
+ }, ln = T.div`
979
1006
  display: flex;
980
1007
  align-items: center;
981
1008
  padding: 4px 8px;
982
1009
  gap: var(--base-gap-small);
983
- `, ns = T.span`
1010
+ `, cn = T.span`
984
1011
  font-weight: 600;
985
1012
  user-select: none;
986
- `, ss = T.div`
1013
+ `, dn = T.div`
987
1014
  display: flex;
988
1015
  gap: var(--base-gap-small);
989
- `, Ne = T(Z)`
1016
+ `, Pe = T(Y)`
990
1017
  background-color: unset;
991
1018
  &.hasIcon {
992
1019
  padding: 4px;
993
1020
  }
994
- `, as = T.div`
1021
+ `, un = T.div`
995
1022
  display: flex;
996
1023
  align-items: center;
997
1024
  gap: var(--base-gap-small);
@@ -1008,10 +1035,10 @@ const In = T(ze)`
1008
1035
  box-shadow: 0 0 0 1px var(--md-sys-color-primary-container);
1009
1036
  background-color: var(--md-sys-color-surface-container-lowest);
1010
1037
  }
1011
- `, os = T(wn)`
1038
+ `, pn = T(ms)`
1012
1039
  width: 28px;
1013
1040
  height: 28px;
1014
- `, is = T.input`
1041
+ `, hn = T.input`
1015
1042
  flex: 1;
1016
1043
  min-width: 0;
1017
1044
  border: none;
@@ -1024,58 +1051,58 @@ const In = T(ze)`
1024
1051
  &::placeholder {
1025
1052
  color: var(--md-sys-color-outline);
1026
1053
  }
1027
- `, rs = T(Z)`
1054
+ `, mn = T(Y)`
1028
1055
  background-color: unset;
1029
1056
  min-width: unset;
1030
1057
  &.hasIcon {
1031
1058
  padding: 2px;
1032
1059
  }
1033
- `, Pe = (e) => !!e && "key" in e, pe = (e, n) => Pe(e) ? e.key === n : !!e.conditions?.some((t) => pe(t, n)), De = (e) => {
1034
- if (Pe(e)) return String(e.value || "");
1035
- const n = e.operator === "or" ? ", " : ".";
1036
- return e.conditions?.map((t) => De(t)).join(n) || "";
1037
- }, it = (e, n, t) => {
1060
+ `, Oe = (e) => !!e && "key" in e, be = (e, s) => Oe(e) ? e.key === s : !!e.conditions?.some((t) => be(t, s)), Ae = (e) => {
1061
+ if (Oe(e)) return String(e.value || "");
1062
+ const s = e.operator === "or" ? ", " : ".";
1063
+ return e.conditions?.map((t) => Ae(t)).join(s) || "";
1064
+ }, lt = (e, s, t) => {
1038
1065
  const o = e.split(",").map((r) => r.trim()).filter(Boolean);
1039
1066
  if (o.length > 1)
1040
1067
  return {
1041
1068
  operator: "or",
1042
- conditions: o.map((r) => it(r, n, t))
1069
+ conditions: o.map((r) => lt(r, s, t))
1043
1070
  };
1044
- const s = o[0] || e.trim();
1045
- if (!s || s === "," || s === ".")
1071
+ const n = o[0] || e.trim();
1072
+ if (!n || n === "," || n === ".")
1046
1073
  return {
1047
- key: n,
1074
+ key: s,
1048
1075
  operator: t,
1049
1076
  value: ""
1050
1077
  };
1051
- const a = s.split(".").map((r) => r.trim()).filter(Boolean);
1078
+ const a = n.split(".").map((r) => r.trim()).filter(Boolean);
1052
1079
  return a.length > 1 ? {
1053
1080
  operator: "and",
1054
1081
  conditions: a.map((r) => ({
1055
- key: n,
1082
+ key: s,
1056
1083
  operator: t,
1057
1084
  value: r
1058
1085
  }))
1059
1086
  } : {
1060
- key: n,
1087
+ key: s,
1061
1088
  operator: t,
1062
1089
  value: a[0] || ""
1063
1090
  };
1064
- }, ls = ({
1091
+ }, gn = ({
1065
1092
  label: e,
1066
- filters: n,
1093
+ filters: s,
1067
1094
  currentFilter: t,
1068
1095
  onFilterChange: o,
1069
- isLoading: s
1096
+ isLoading: n
1070
1097
  }) => {
1071
- const [a, r] = X(null), [c, m] = X(""), f = ee(null), p = (d) => typeof d == "object" && d !== null && !Array.isArray(d);
1072
- H(() => {
1098
+ const [a, r] = X(null), [c, m] = X(""), f = Z(null), p = (d) => typeof d == "object" && d !== null && !Array.isArray(d);
1099
+ B(() => {
1073
1100
  a && f.current && f.current.focus();
1074
- }, [a]), H(() => {
1101
+ }, [a]), B(() => {
1075
1102
  if (a && p(t)) {
1076
1103
  if (document.activeElement === f.current) return;
1077
- const d = t.conditions?.find((u) => pe(u, a));
1078
- m(d ? De(d) : "");
1104
+ const d = t.conditions?.find((u) => be(u, a));
1105
+ m(d ? Ae(d) : "");
1079
1106
  }
1080
1107
  }, [a, t]);
1081
1108
  const g = (d, u) => {
@@ -1087,62 +1114,62 @@ const In = T(ze)`
1087
1114
  ...t,
1088
1115
  conditions: h,
1089
1116
  operator: t.operator || "and"
1090
- }, A = String(d.id), E = h.findIndex((w) => pe(w, A)), y = d.type || "boolean";
1117
+ }, j = String(d.id), E = h.findIndex((w) => be(w, j)), y = d.type || "boolean";
1091
1118
  if (y === "boolean")
1092
- E > -1 ? h.splice(E, 1) : h.push({ key: A, operator: d.operator || "eq", value: !0 });
1119
+ E > -1 ? h.splice(E, 1) : h.push({ key: j, operator: d.operator || "eq", value: !0 });
1093
1120
  else if (y === "enum") {
1094
1121
  const w = Array.isArray(u) ? u : [u];
1095
1122
  if (w.length === 0 || w.length === 1 && w[0] === void 0)
1096
1123
  E > -1 && h.splice(E, 1);
1097
1124
  else {
1098
- const O = {
1099
- key: A,
1125
+ const R = {
1126
+ key: j,
1100
1127
  operator: d.operator || "in",
1101
1128
  value: w
1102
1129
  };
1103
- E > -1 ? h[E] = O : h.push(O);
1130
+ E > -1 ? h[E] = R : h.push(R);
1104
1131
  }
1105
1132
  } else if (y === "search") {
1106
1133
  const w = typeof u == "string" ? u : "";
1107
1134
  if (!w)
1108
1135
  E > -1 && h.splice(E, 1);
1109
1136
  else {
1110
- const O = it(w, A, d.operator || "like");
1111
- E > -1 ? h[E] = O : h.push(O);
1137
+ const R = lt(w, j, d.operator || "like");
1138
+ E > -1 ? h[E] = R : h.push(R);
1112
1139
  }
1113
1140
  }
1114
1141
  o(N);
1115
1142
  }, b = (d) => {
1116
1143
  const u = String(d.id);
1117
1144
  if (a !== u && (r(u), p(t))) {
1118
- const h = t.conditions?.find((N) => pe(N, u));
1119
- m(h ? De(h) : "");
1145
+ const h = t.conditions?.find((N) => be(N, u));
1146
+ m(h ? Ae(h) : "");
1120
1147
  }
1121
1148
  }, x = (d, u) => {
1122
1149
  m(u), g(d, u);
1123
- }, R = (d) => {
1150
+ }, $ = (d) => {
1124
1151
  m(""), r(null), g(d, "");
1125
- }, j = (d) => p(t) ? t.conditions?.some((u) => pe(u, String(d.id))) : d.id === t, P = (d) => p(t) ? t.conditions?.find(
1126
- (h) => Pe(h) && h.key === String(d.id)
1152
+ }, U = (d) => p(t) ? t.conditions?.some((u) => be(u, String(d.id))) : d.id === t, A = (d) => p(t) ? t.conditions?.find(
1153
+ (h) => Oe(h) && h.key === String(d.id)
1127
1154
  )?.value || [] : [];
1128
- return /* @__PURE__ */ k(ts, { className: ie("panel-tabs", { loading: s }), children: [
1129
- /* @__PURE__ */ i(ns, { className: "panel-header-label", children: e }),
1130
- /* @__PURE__ */ i(Ge, {}),
1131
- /* @__PURE__ */ i(ss, { className: "panel-header-filters", children: n.map((d) => {
1132
- const u = j(d), h = d.type || "boolean";
1155
+ return /* @__PURE__ */ k(ln, { className: le("panel-tabs", { loading: n }), children: [
1156
+ /* @__PURE__ */ i(cn, { className: "panel-header-label", children: e }),
1157
+ /* @__PURE__ */ i(qe, {}),
1158
+ /* @__PURE__ */ i(dn, { className: "panel-header-filters", children: s.map((d) => {
1159
+ const u = U(d), h = d.type || "boolean";
1133
1160
  if (h === "enum")
1134
1161
  return /* @__PURE__ */ i(
1135
- os,
1162
+ pn,
1136
1163
  {
1137
1164
  options: d.options || [],
1138
- value: P(d),
1165
+ value: A(d),
1139
1166
  onChange: (N) => g(d, N),
1140
1167
  isEditing: !0,
1141
1168
  autoOpen: !1,
1142
1169
  align: "right",
1143
1170
  type: "list_of_strings",
1144
1171
  valueTemplate: () => /* @__PURE__ */ i(
1145
- Ne,
1172
+ Pe,
1146
1173
  {
1147
1174
  selected: u,
1148
1175
  icon: d.icon,
@@ -1158,12 +1185,12 @@ const In = T(ze)`
1158
1185
  if (h === "search") {
1159
1186
  const N = a === String(d.id);
1160
1187
  return /* @__PURE__ */ k(
1161
- as,
1188
+ un,
1162
1189
  {
1163
- className: ie("panel-filter", "panel-filter-search", { expanded: N }),
1190
+ className: le("panel-filter", "panel-filter-search", { expanded: N }),
1164
1191
  children: [
1165
1192
  /* @__PURE__ */ i(
1166
- Ne,
1193
+ Pe,
1167
1194
  {
1168
1195
  selected: u || N,
1169
1196
  onClick: () => b(d),
@@ -1172,24 +1199,24 @@ const In = T(ze)`
1172
1199
  "data-tooltip-delay": 0
1173
1200
  }
1174
1201
  ),
1175
- N && /* @__PURE__ */ k(Ie, { children: [
1202
+ N && /* @__PURE__ */ k(xe, { children: [
1176
1203
  /* @__PURE__ */ i(
1177
- is,
1204
+ hn,
1178
1205
  {
1179
1206
  ref: f,
1180
1207
  value: c,
1181
- onChange: (A) => x(d, A.target.value),
1182
- onKeyDown: (A) => {
1183
- A.key === "Escape" && R(d);
1208
+ onChange: (j) => x(d, j.target.value),
1209
+ onKeyDown: (j) => {
1210
+ j.key === "Escape" && $(d);
1184
1211
  },
1185
1212
  placeholder: d.placeholder || "Search..."
1186
1213
  }
1187
1214
  ),
1188
1215
  /* @__PURE__ */ i(
1189
- rs,
1216
+ mn,
1190
1217
  {
1191
1218
  icon: "close",
1192
- onClick: () => R(d),
1219
+ onClick: () => $(d),
1193
1220
  "data-tooltip": "Clear",
1194
1221
  "data-tooltip-delay": 0
1195
1222
  }
@@ -1201,7 +1228,7 @@ const In = T(ze)`
1201
1228
  );
1202
1229
  }
1203
1230
  return /* @__PURE__ */ i(
1204
- Ne,
1231
+ Pe,
1205
1232
  {
1206
1233
  selected: u,
1207
1234
  onClick: () => g(d),
@@ -1214,21 +1241,21 @@ const In = T(ze)`
1214
1241
  );
1215
1242
  }) })
1216
1243
  ] });
1217
- }, rt = ["done", "isDone"], cs = (e) => !!e && "key" in e, ds = (e, n) => {
1218
- const t = [], o = [], s = (a) => {
1244
+ }, ct = ["done", "isDone"], dt = (e) => !!e && "key" in e, fn = (e, s) => {
1245
+ const t = [], o = [], n = (a) => {
1219
1246
  if (!a) return;
1220
- if (cs(a)) {
1247
+ if (dt(a)) {
1221
1248
  const c = a.key;
1222
1249
  if (c === "search") {
1223
1250
  const p = String(a.value ?? "");
1224
1251
  p && o.push({ id: p, label: p });
1225
1252
  return;
1226
1253
  }
1227
- const m = n.find((p) => p.id === c);
1254
+ const m = s.find((p) => p.id === c);
1228
1255
  if (!m) return;
1229
- if (rt.includes(c)) {
1256
+ if (ct.includes(c)) {
1230
1257
  a.value !== void 0 && t.push({
1231
- id: Se(c),
1258
+ id: Ee(c),
1232
1259
  label: m.label,
1233
1260
  icon: m.icon,
1234
1261
  type: "boolean",
@@ -1240,7 +1267,7 @@ const In = T(ze)`
1240
1267
  if (m.type === "datetime") {
1241
1268
  const p = Array.isArray(a.value) ? a.value[0] : a.value;
1242
1269
  t.push({
1243
- id: Se(c),
1270
+ id: Ee(c),
1244
1271
  label: m.label,
1245
1272
  type: "datetime",
1246
1273
  icon: m.icon,
@@ -1257,7 +1284,7 @@ const In = T(ze)`
1257
1284
  }
1258
1285
  const f = Array.isArray(a.value) ? a.value : [a.value];
1259
1286
  t.push({
1260
- id: Se(c),
1287
+ id: Ee(c),
1261
1288
  label: m.label,
1262
1289
  type: m.type,
1263
1290
  icon: m.icon,
@@ -1269,33 +1296,33 @@ const In = T(ze)`
1269
1296
  });
1270
1297
  return;
1271
1298
  }
1272
- const r = Sn(a, n);
1299
+ const r = Is(a, s);
1273
1300
  if (r) {
1274
1301
  t.push(r);
1275
1302
  return;
1276
1303
  }
1277
- a.conditions?.forEach(s);
1304
+ a.conditions?.forEach(n);
1278
1305
  };
1279
- return e?.conditions?.forEach(s), o.length && t.push({ id: Qe, label: "", values: o }), t;
1280
- }, us = (e) => {
1281
- const n = [], t = [];
1306
+ return e?.conditions?.forEach(n), o.length && t.push({ id: Ke, label: "", values: o }), t;
1307
+ }, bn = (e) => {
1308
+ const s = [], t = [];
1282
1309
  return e.forEach((o) => {
1283
- const s = vt(o.id), a = (o.values || []).map((r) => r.id);
1310
+ const n = xt(o.id), a = (o.values || []).map((r) => r.id);
1284
1311
  if (a.length)
1285
- if (s === Qe)
1312
+ if (n === Ke)
1286
1313
  a.forEach(
1287
1314
  (r) => t.push({ key: "search", operator: "like", value: String(r) })
1288
1315
  );
1289
- else if (rt.includes(s)) {
1316
+ else if (ct.includes(n)) {
1290
1317
  const r = a[0] === "true";
1291
- n.push({ key: s, operator: "eq", value: r });
1318
+ s.push({ key: n, operator: "eq", value: r });
1292
1319
  } else if (o.type === "datetime") {
1293
- const r = Cn(s, o);
1294
- r && n.push(r);
1320
+ const r = Ps(n, o);
1321
+ r && s.push(r);
1295
1322
  } else
1296
- n.push({ key: s, operator: "in", value: a.map(String) });
1297
- }), t.length === 1 ? n.push(t[0]) : t.length > 1 && n.push({ operator: "or", conditions: t }), { operator: "and", conditions: n };
1298
- }, ps = T.div`
1323
+ s.push({ key: n, operator: "in", value: a.map(String) });
1324
+ }), t.length === 1 ? s.push(t[0]) : t.length > 1 && s.push({ operator: "or", conditions: t }), { operator: "and", conditions: s };
1325
+ }, ut = (e) => dt(e) ? e.key !== "search" || typeof e.value != "string" ? e : It(e.value, (s) => ({ ...e, value: s })) ?? e : { ...e, conditions: e.conditions?.map(ut) }, vn = T.div`
1299
1326
  padding: 4px 8px;
1300
1327
  padding-bottom: 0;
1301
1328
 
@@ -1303,16 +1330,16 @@ const In = T(ze)`
1303
1330
  opacity: 0.5;
1304
1331
  pointer-events: none;
1305
1332
  }
1306
- `, hs = ({
1333
+ `, yn = ({
1307
1334
  subtasksFilter: e,
1308
- setSubtasksFilter: n,
1335
+ setSubtasksFilter: s,
1309
1336
  users: t,
1310
1337
  isLoading: o,
1311
- totalCount: s = 0,
1338
+ totalCount: n = 0,
1312
1339
  doneCount: a = 0,
1313
1340
  onSearchTextChange: r
1314
1341
  }) => {
1315
- const c = D(
1342
+ const c = C(
1316
1343
  () => [
1317
1344
  {
1318
1345
  id: "isDone",
@@ -1356,38 +1383,38 @@ const In = T(ze)`
1356
1383
  // },
1357
1384
  ],
1358
1385
  [t]
1359
- ), m = D(() => ds(e, c), [e, c]), [f, p] = X(m), g = ee(null), b = Tn();
1360
- H(() => {
1386
+ ), m = C(() => fn(e, c), [e, c]), [f, p] = X(m), g = Z(null), b = Fs();
1387
+ B(() => {
1361
1388
  p(m);
1362
1389
  }, [JSON.stringify(m)]);
1363
1390
  const x = (u) => {
1364
- const h = us(u);
1365
- n(h), r?.("");
1366
- }, R = (u) => {
1391
+ const h = bn(u);
1392
+ s(h), r?.("");
1393
+ }, $ = (u) => {
1367
1394
  b.wrapFilterChange(u, f, p);
1368
- }, j = (u, h) => {
1395
+ }, U = (u, h) => {
1369
1396
  h || r?.(u);
1370
1397
  };
1371
- let P = "";
1372
- s > 0 && (P = `${a}/${s}`);
1373
- const d = D(
1374
- () => [{ id: "isDone", label: P, tooltip: "Status" }],
1375
- [P]
1398
+ let A = "";
1399
+ n > 0 && (A = `${a}/${n}`);
1400
+ const d = C(
1401
+ () => [{ id: "isDone", label: A, tooltip: "Status" }],
1402
+ [A]
1376
1403
  );
1377
- return /* @__PURE__ */ k(ps, { className: o ? "loading" : void 0, children: [
1404
+ return /* @__PURE__ */ k(vn, { className: o ? "loading" : void 0, children: [
1378
1405
  /* @__PURE__ */ i(
1379
- yt,
1406
+ St,
1380
1407
  {
1381
1408
  ref: g,
1382
1409
  compact: !0,
1383
1410
  options: c,
1384
1411
  filters: f,
1385
- onChange: R,
1412
+ onChange: $,
1386
1413
  onFinish: x,
1387
1414
  enableGlobalSearch: !0,
1388
1415
  enableMultipleSameFilters: !1,
1389
1416
  enableAutosuggestion: !1,
1390
- onSearchChange: j,
1417
+ onSearchChange: U,
1391
1418
  quickActions: d,
1392
1419
  placeholder: "Search and filter subtasks...",
1393
1420
  pt: {
@@ -1405,7 +1432,7 @@ const In = T(ze)`
1405
1432
  }
1406
1433
  ),
1407
1434
  /* @__PURE__ */ i(
1408
- kn,
1435
+ Ds,
1409
1436
  {
1410
1437
  isOpen: !!b.customRangeFilterId,
1411
1438
  header: c.find((u) => u.id === b.customRangeFilterId?.split("__")[0])?.label ?? "Custom range",
@@ -1418,42 +1445,42 @@ const In = T(ze)`
1418
1445
  }
1419
1446
  )
1420
1447
  ] });
1421
- }, ms = ({ ...e }) => {
1422
- const [n, t] = X({}), [o, s] = X(""), [a, r] = X([]), { dispatch: c } = q(), { data: m = [] } = qe({ projectName: e.projectName }), f = e.subtasks?.length || 0, p = e.subtasks?.filter((b) => b.isDone).length || 0, g = D(() => {
1423
- let b = n;
1448
+ }, kn = ({ ...e }) => {
1449
+ const [s, t] = X({}), [o, n] = X(""), [a, r] = X([]), { dispatch: c } = K(), { data: m = [] } = Je({ projectName: e.projectName }), f = e.subtasks?.length || 0, p = e.subtasks?.filter((b) => b.isDone).length || 0, g = C(() => {
1450
+ let b = s;
1424
1451
  if (o) {
1425
1452
  const x = { key: "search", operator: "like", value: o };
1426
1453
  b = {
1427
- ...n,
1428
- conditions: [...n.conditions || [], x],
1454
+ ...s,
1455
+ conditions: [...s.conditions || [], x],
1429
1456
  operator: "and"
1430
1457
  };
1431
1458
  }
1432
- return Nn(b);
1433
- }, [n, o]);
1434
- return /* @__PURE__ */ k(Ie, { children: [
1459
+ return As(ut(b));
1460
+ }, [s, o]);
1461
+ return /* @__PURE__ */ k(xe, { children: [
1435
1462
  /* @__PURE__ */ i(
1436
- ls,
1463
+ gn,
1437
1464
  {
1438
1465
  label: `Subtasks (${f})`,
1439
1466
  filters: [],
1440
- currentFilter: n,
1467
+ currentFilter: s,
1441
1468
  onFilterChange: t
1442
1469
  }
1443
1470
  ),
1444
1471
  /* @__PURE__ */ i(
1445
- hs,
1472
+ yn,
1446
1473
  {
1447
- subtasksFilter: n,
1474
+ subtasksFilter: s,
1448
1475
  setSubtasksFilter: t,
1449
1476
  users: m,
1450
1477
  totalCount: f,
1451
1478
  doneCount: p,
1452
- onSearchTextChange: s
1479
+ onSearchTextChange: n
1453
1480
  }
1454
1481
  ),
1455
1482
  /* @__PURE__ */ i(
1456
- xn,
1483
+ gs,
1457
1484
  {
1458
1485
  ...e,
1459
1486
  style: { padding: 8, height: "unset" },
@@ -1466,14 +1493,14 @@ const In = T(ze)`
1466
1493
  }
1467
1494
  )
1468
1495
  ] });
1469
- }, gs = ["product", "representation"], fs = ({
1496
+ }, wn = ["product", "representation"], xn = ({
1470
1497
  entityType: e,
1471
- entitySubTypes: n = [],
1498
+ entitySubTypes: s = [],
1472
1499
  // entities is data we already have from kanban
1473
1500
  entitiesData: t = [],
1474
1501
  // entityIds are used to get the full details data for the entities
1475
1502
  entities: o = [],
1476
- tagsOptions: s = [],
1503
+ tagsOptions: n = [],
1477
1504
  disabledStatuses: a,
1478
1505
  projectUsers: r,
1479
1506
  disabledProjectUsers: c,
@@ -1483,320 +1510,320 @@ const In = T(ze)`
1483
1510
  isSlideOut: g = !1,
1484
1511
  style: b = {},
1485
1512
  scope: x,
1486
- isCompact: R = !1,
1487
- onClose: j,
1488
- onWatchersUpdate: P,
1513
+ isCompact: $ = !1,
1514
+ onClose: U,
1515
+ onWatchersUpdate: A,
1489
1516
  onOpenViewer: d,
1490
1517
  onEntityFocus: u,
1491
1518
  onOpen: h,
1492
1519
  onUriOpen: N,
1493
1520
  // when the details panel is opened from uri
1494
1521
  // annotations
1495
- annotations: A,
1522
+ annotations: j,
1496
1523
  removeAnnotation: E,
1497
1524
  exportAnnotationComposite: y,
1498
1525
  entityListId: w,
1499
- guestCategories: O = {},
1526
+ guestCategories: R = {},
1500
1527
  entityListsContext: V,
1501
- resolveVersionJump: L
1528
+ resolveVersionJump: M
1502
1529
  }) => {
1503
1530
  const {
1504
- closeSlideOut: te,
1505
- openPip: ne,
1531
+ closeSlideOut: ee,
1532
+ openPip: te,
1506
1533
  user: se,
1507
- isGuest: ae,
1508
- entities: I,
1509
- setEntities: oe,
1510
- slideOut: J,
1511
- useSearchParams: re,
1512
- SubtasksManager: K,
1513
- useNavigate: le
1514
- } = q(), { currentTab: $, setTab: U, isFeed: ce } = tn(x), [B, be] = re(), he = ee(!1), S = I?.entityType ?? e, Y = I?.entities ?? o, ve = I?.entitySubTypes ?? n, me = I?.entities ? [] : t, Q = I?.entities ? I.entities.map((v) => v.projectName) : p;
1515
- Kt(
1516
- S ? Y.map((v) => ({ ...v, entityType: S })) : [],
1517
- g ? _e.slideOut : _e.detailsPanel
1518
- ), H(() => {
1519
- h && !he.current && (he.current = !0, h());
1520
- }, []), H(() => {
1521
- gs.includes(S) && $ !== "details" && U("details");
1522
- }, [S, $, U]), H(() => {
1523
- o.length && I && oe(null);
1524
- }, [o, I, oe]);
1525
- const de = D(
1526
- () => ot(f, Q),
1527
- [f, Q]
1528
- ), ye = D(() => tt(de), [de]);
1529
- H(() => {
1530
- $ === "files" && S !== "version" && U("feed"), $ === "subtasks" && S !== "task" && U("feed");
1531
- }, [S, $, x]);
1532
- let W = Y.length ? Y.map((v) => ({ id: v.id, projectName: v.projectName })) : (
1534
+ isGuest: ne,
1535
+ entities: P,
1536
+ setEntities: ae,
1537
+ slideOut: W,
1538
+ useSearchParams: ce,
1539
+ SubtasksManager: oe,
1540
+ useNavigate: pe
1541
+ } = K(), { currentTab: L, setTab: F, isFeed: de } = is(x), [he, ve] = ce(), ye = Z(!1), D = P?.entityType ?? e, me = P?.entities ?? o, G = P?.entitySubTypes ?? s, Se = P?.entities ? [] : t, J = P?.entities ? P.entities.map((v) => v.projectName) : p;
1542
+ es(
1543
+ D ? me.map((v) => ({ ...v, entityType: D })) : [],
1544
+ g ? He.slideOut : He.detailsPanel
1545
+ ), B(() => {
1546
+ h && !ye.current && (ye.current = !0, h());
1547
+ }, []), B(() => {
1548
+ wn.includes(D) && L !== "details" && F("details");
1549
+ }, [D, L, F]), B(() => {
1550
+ o.length && P && ae(null);
1551
+ }, [o, P, ae]);
1552
+ const ie = C(
1553
+ () => rt(f, J),
1554
+ [f, J]
1555
+ ), re = C(() => nt(ie), [ie]);
1556
+ B(() => {
1557
+ L === "files" && D !== "version" && F("feed"), L === "subtasks" && D !== "task" && F("feed");
1558
+ }, [D, L, x]);
1559
+ let z = me.length ? me.map((v) => ({ id: v.id, projectName: v.projectName })) : (
1533
1560
  // @ts-expect-error = not sure what's going on with activeEntitiesData, we should try and remove it
1534
- me.map((v) => ({ id: v.id, projectName: v.projectName }))
1561
+ Se.map((v) => ({ id: v.id, projectName: v.projectName }))
1535
1562
  );
1536
- W = W.filter((v) => v.id);
1563
+ z = z.filter((v) => v.id);
1537
1564
  const {
1538
- data: l = [],
1539
- isFetching: C,
1540
- isError: z,
1541
- originalArgs: lt
1542
- } = Ke(
1543
- { entityType: S, entities: W },
1565
+ data: _ = [],
1566
+ isFetching: Q,
1567
+ isError: ke,
1568
+ originalArgs: Ce
1569
+ } = Xe(
1570
+ { entityType: D, entities: z },
1544
1571
  {
1545
- skip: !W.length || !Dt.includes(S)
1572
+ skip: !z.length || !Ot.includes(D)
1546
1573
  }
1547
1574
  );
1548
- H(() => {
1549
- g || te();
1550
- }, [lt, g]);
1551
- const ke = ee(null);
1552
- H(() => {
1553
- I || (ke.current = null);
1554
- }, [I]), H(() => {
1555
- if (!C && (I?.source === "uri" || I?.source === "url") && I?.entities?.length && N) {
1556
- const v = I.entities[0].id;
1557
- if (ke.current === v) return;
1558
- const F = l.find((M) => M.id === v);
1559
- if (!F) return;
1560
- ke.current = v, N(F, I.source);
1575
+ B(() => {
1576
+ g || ee();
1577
+ }, [Ce, g]);
1578
+ const ge = Z(null);
1579
+ B(() => {
1580
+ P || (ge.current = null);
1581
+ }, [P]), B(() => {
1582
+ if (!Q && (P?.source === "uri" || P?.source === "url") && P?.entities?.length && N) {
1583
+ const v = P.entities[0].id;
1584
+ if (ge.current === v) return;
1585
+ const O = _.find((H) => H.id === v);
1586
+ if (!O) return;
1587
+ ge.current = v, N(O, P.source);
1561
1588
  }
1562
- }, [l, C, I, N]);
1563
- const Fe = st(f), G = Q[0], Ae = f[G] || {}, _ = l[0] || {}, ge = l[l.length - 1], we = Q[Q.length - 1], Oe = x === "inbox" && S === "version" && l.length === 1 ? Bn(l[0]) : void 0, [Re, ct] = Zn({
1564
- entity: _,
1565
- entityType: S,
1566
- projectName: G,
1567
- isLoading: C
1568
- }), { setEntityUri: dt, setUri: je } = nn();
1569
- H(() => {
1570
- if (!ge?.parents || !we) return;
1571
- const { folderPath: v, taskName: F, versionName: M, productName: Le } = Xt(
1572
- ge.parents,
1573
- S,
1574
- ge.name
1589
+ }, [_, Q, P, N]);
1590
+ const fe = ot(f), l = J[0], S = f[l] || {}, I = _[0] || {}, q = _[_.length - 1], Te = J[J.length - 1], je = x === "inbox" && D === "version" && _.length === 1 ? Ks(_[0]) : void 0, [Re, pt] = on({
1591
+ entity: I,
1592
+ entityType: D,
1593
+ projectName: l,
1594
+ isLoading: Q
1595
+ }), { setEntityUri: ht, setUri: Ve } = rs();
1596
+ B(() => {
1597
+ if (!q?.parents || !Te) return;
1598
+ const { folderPath: v, taskName: O, versionName: H, productName: _e } = ts(
1599
+ q.parents,
1600
+ D,
1601
+ q.name
1575
1602
  );
1576
- return dt({
1577
- projectName: we,
1603
+ return ht({
1604
+ projectName: Te,
1578
1605
  folderPath: v,
1579
- taskName: F,
1580
- productName: Le,
1581
- versionName: M
1606
+ taskName: O,
1607
+ productName: _e,
1608
+ versionName: H
1582
1609
  }), () => {
1583
- je("");
1610
+ Ve("");
1584
1611
  };
1585
- }, [l, Q, S]), Dn({
1586
- entityData: ge,
1587
- project: we,
1588
- activeEntityType: S,
1589
- entitiesToQuery: W
1612
+ }, [_, J, D]), js({
1613
+ entityData: q,
1614
+ project: Te,
1615
+ activeEntityType: D,
1616
+ entitiesToQuery: z
1590
1617
  });
1591
- const ut = () => {
1592
- be(
1618
+ const mt = () => {
1619
+ ve(
1593
1620
  (v) => {
1594
- const F = new URLSearchParams(v);
1595
- return F.delete("project"), F.delete("type"), F.delete("id"), F;
1621
+ const O = new URLSearchParams(v);
1622
+ return O.delete("project"), O.delete("type"), O.delete("id"), O;
1596
1623
  },
1597
1624
  { replace: !0 }
1598
1625
  );
1599
- }, xe = () => {
1600
- j?.(), oe(null), je(""), ut(), te();
1626
+ }, Ne = () => {
1627
+ U?.(), ae(null), Ve(""), mt(), ee();
1601
1628
  };
1602
- H(() => {
1603
- const v = (F) => {
1604
- if (F.key === "Escape" && j) {
1605
- const M = F.target;
1606
- if (["INPUT", "TEXTAREA", "SELECT"].includes(M.tagName) || M.isContentEditable || g === !1 && (M.closest("#viewer-dialog") || J)) return;
1607
- xe();
1629
+ B(() => {
1630
+ const v = (O) => {
1631
+ if (O.key === "Escape" && U) {
1632
+ const H = O.target;
1633
+ if (["INPUT", "TEXTAREA", "SELECT"].includes(H.tagName) || H.isContentEditable || g === !1 && (H.closest("#viewer-dialog") || W)) return;
1634
+ Ne();
1608
1635
  }
1609
1636
  };
1610
1637
  return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
1611
- }, [xe, g, J]);
1612
- const { requestPipWindow: pt } = sn(), Ve = ee(null), Ue = ee(null), ht = l.length === 1 && S !== "representation", mt = D(() => {
1613
- const v = _?.label || _?.name || "", F = _?.parents || [], M = [G];
1614
- switch (S) {
1638
+ }, [Ne, g, W]);
1639
+ const { requestPipWindow: gt } = ls(), $e = Z(null), Le = Z(null), ft = _.length === 1 && D !== "representation", bt = C(() => {
1640
+ const v = I?.label || I?.name || "", O = I?.parents || [], H = [l];
1641
+ switch (D) {
1615
1642
  case "folder":
1616
1643
  case "task":
1617
1644
  case "product":
1618
- M.push(F.at(-1), v);
1645
+ H.push(O.at(-1), v);
1619
1646
  break;
1620
1647
  case "version":
1621
- M.push(F.at(-2), F.at(-1), v);
1648
+ H.push(O.at(-2), O.at(-1), v);
1622
1649
  break;
1623
1650
  case "representation":
1624
- M.push(F.at(-3), F.at(-2), F.at(-1), v);
1651
+ H.push(O.at(-3), O.at(-2), O.at(-1), v);
1625
1652
  break;
1626
1653
  default:
1627
- M.push(v);
1654
+ H.push(v);
1628
1655
  }
1629
- return M.filter(Boolean).join(" - ");
1630
- }, [_, S, G]), gt = () => {
1631
- ne({
1632
- entityType: S,
1633
- entities: W,
1656
+ return H.filter(Boolean).join(" - ");
1657
+ }, [I, D, l]), vt = () => {
1658
+ te({
1659
+ entityType: D,
1660
+ entities: z,
1634
1661
  scope: x
1635
- }), pt(500, 500);
1636
- }, $e = () => !(Q.length > 1 || ae && (!w || !Object.prototype.hasOwnProperty.call(
1637
- O,
1662
+ }), gt(500, 500);
1663
+ }, Ue = () => !(J.length > 1 || ne && (!w || !Object.prototype.hasOwnProperty.call(
1664
+ R,
1638
1665
  se.attrib?.email || ""
1639
1666
  )));
1640
1667
  return /* @__PURE__ */ i(
1641
- on,
1668
+ ds,
1642
1669
  {
1643
- thumbnailInputRef: Ve,
1644
- versionsInputRef: Ue,
1645
- canUploadVersion: ht,
1646
- children: /* @__PURE__ */ k(Fn, { className: "details-panel", children: [
1647
- /* @__PURE__ */ k(In, { children: [
1670
+ thumbnailInputRef: $e,
1671
+ versionsInputRef: Le,
1672
+ canUploadVersion: ft,
1673
+ children: /* @__PURE__ */ k($s, { className: "details-panel", children: [
1674
+ /* @__PURE__ */ k(Rs, { children: [
1648
1675
  /* @__PURE__ */ i(
1649
- Qt,
1676
+ Yt,
1650
1677
  {
1651
1678
  segments: Re,
1652
- versions: ct,
1653
- projectName: G,
1679
+ versions: pt,
1680
+ projectName: l,
1654
1681
  hideProjectName: g,
1655
- isLoading: C || !Re.length,
1656
- entityType: S,
1682
+ isLoading: Q || !Re.length,
1683
+ entityType: D,
1657
1684
  scope: x,
1658
- entityTypeIcons: ye
1685
+ entityTypeIcons: re
1659
1686
  }
1660
1687
  ),
1661
- /* @__PURE__ */ k(Pn, { className: "right-tools", children: [
1688
+ /* @__PURE__ */ k(Vs, { className: "right-tools", children: [
1662
1689
  /* @__PURE__ */ i(
1663
- Xn,
1690
+ sn,
1664
1691
  {
1665
- entityType: S,
1666
- entityId: _?.id,
1667
- entityIds: W.map((v) => v.id).filter(Boolean),
1668
- entityLabel: mt,
1669
- projectName: G,
1670
- selectedEntities: l.filter((v) => !!v?.id).map((v) => {
1671
- const F = v.entityType || S;
1692
+ entityType: D,
1693
+ entityId: I?.id,
1694
+ entityIds: z.map((v) => v.id).filter(Boolean),
1695
+ entityLabel: bt,
1696
+ projectName: l,
1697
+ selectedEntities: _.filter((v) => !!v?.id).map((v) => {
1698
+ const O = v.entityType || D;
1672
1699
  return {
1673
1700
  entityId: v.id,
1674
- entityType: F,
1701
+ entityType: O,
1675
1702
  hasReviewables: !!v.hasReviewables,
1676
1703
  name: v.name,
1677
1704
  label: v.label,
1678
- projectName: v.projectName || G,
1679
- folderId: F === "task" ? v.folder?.id : void 0
1705
+ projectName: v.projectName || l,
1706
+ folderId: O === "task" ? v.folder?.id : void 0
1680
1707
  };
1681
1708
  }),
1682
1709
  entityListsContext: V,
1683
- onOpenPip: gt,
1710
+ onOpenPip: vt,
1684
1711
  onOpenViewer: d,
1685
- productId: _?.product?.id,
1686
- taskId: _?.task?.id,
1687
- folderId: _?.folder?.id
1712
+ productId: I?.product?.id,
1713
+ taskId: I?.task?.id,
1714
+ folderId: I?.folder?.id
1688
1715
  }
1689
1716
  ),
1690
1717
  /* @__PURE__ */ i(
1691
- Bt,
1718
+ qt,
1692
1719
  {
1693
- entities: W,
1694
- entityType: S,
1720
+ entities: z,
1721
+ entityType: D,
1695
1722
  options: r || [],
1696
- onWatchersUpdate: P && P,
1723
+ onWatchersUpdate: A && A,
1697
1724
  userName: se.name
1698
1725
  }
1699
1726
  ),
1700
- j && /* @__PURE__ */ i(
1701
- Z,
1727
+ U && /* @__PURE__ */ i(
1728
+ Y,
1702
1729
  {
1703
1730
  icon: "close",
1704
1731
  variant: "text",
1705
- onClick: xe,
1732
+ onClick: Ne,
1706
1733
  "data-shortcut": "Escape"
1707
1734
  }
1708
1735
  )
1709
1736
  ] })
1710
1737
  ] }),
1711
- Oe && /* @__PURE__ */ i(
1712
- Hn,
1738
+ je && /* @__PURE__ */ i(
1739
+ qs,
1713
1740
  {
1714
- latestVersion: Oe,
1715
- resolveVersionJump: L
1741
+ latestVersion: je,
1742
+ resolveVersionJump: M
1716
1743
  }
1717
1744
  ),
1718
1745
  /* @__PURE__ */ i(
1719
- Ln,
1746
+ zs,
1720
1747
  {
1721
- entityType: S,
1722
- entitySubTypes: ve,
1723
- entities: l,
1748
+ entityType: D,
1749
+ entitySubTypes: G,
1750
+ entities: _,
1724
1751
  users: r,
1725
1752
  disabledAssignees: c,
1726
1753
  disabledStatuses: a,
1727
- tagsOptions: s,
1728
- isFetching: C,
1729
- isCompact: R,
1730
- currentTab: $,
1731
- onTabChange: U,
1732
- projectInfo: de,
1754
+ tagsOptions: n,
1755
+ isFetching: Q,
1756
+ isCompact: $,
1757
+ currentTab: L,
1758
+ onTabChange: F,
1759
+ projectInfo: ie,
1733
1760
  onOpenViewer: (v) => d?.(v),
1734
1761
  onEntityFocus: u,
1735
- thumbnailInputRef: Ve,
1736
- versionsInputRef: Ue
1762
+ thumbnailInputRef: $e,
1763
+ versionsInputRef: Le
1737
1764
  }
1738
1765
  ),
1739
- /* @__PURE__ */ k(Ye, { projectName: G, children: [
1740
- ce && !z && /* @__PURE__ */ i(
1741
- at,
1766
+ /* @__PURE__ */ k(et, { projectName: l, children: [
1767
+ de && !ke && /* @__PURE__ */ i(
1768
+ it,
1742
1769
  {
1743
- entityType: S,
1744
- entities: l,
1770
+ entityType: D,
1771
+ entities: _,
1745
1772
  activeUsers: m || [],
1746
- projectInfo: Ae,
1747
- projectName: G,
1748
- disabled: !$e(),
1773
+ projectInfo: S,
1774
+ projectName: l,
1775
+ disabled: !Ue(),
1749
1776
  scope: x,
1750
- statuses: Fe,
1777
+ statuses: fe,
1751
1778
  readOnly: !1,
1752
1779
  entityListId: w,
1753
- annotations: A,
1780
+ annotations: j,
1754
1781
  removeAnnotation: E,
1755
1782
  exportAnnotationComposite: y,
1756
1783
  isSlideOut: g
1757
1784
  }
1758
1785
  ),
1759
- $ === "subtasks" && S === "task" && _?.id && K && /* @__PURE__ */ i(
1760
- ms,
1786
+ L === "subtasks" && D === "task" && I?.id && oe && /* @__PURE__ */ i(
1787
+ kn,
1761
1788
  {
1762
- projectName: G,
1763
- taskId: _.id,
1764
- taskName: _.name,
1765
- folderId: _.folder?.id,
1766
- subtasks: _.task?.subtasks || [],
1767
- SubtasksManager: K,
1768
- useNavigate: le,
1769
- onNotFound: () => U("feed")
1789
+ projectName: l,
1790
+ taskId: I.id,
1791
+ taskName: I.name,
1792
+ folderId: I.folder?.id,
1793
+ subtasks: I.task?.subtasks || [],
1794
+ SubtasksManager: oe,
1795
+ useNavigate: pe,
1796
+ onNotFound: () => F("feed")
1770
1797
  }
1771
1798
  ),
1772
- $ === "files" && /* @__PURE__ */ i(
1773
- Mn,
1799
+ L === "files" && /* @__PURE__ */ i(
1800
+ Qs,
1774
1801
  {
1775
- entities: l,
1802
+ entities: _,
1776
1803
  scope: x,
1777
- isLoadingVersion: C
1804
+ isLoadingVersion: Q
1778
1805
  }
1779
1806
  ),
1780
- $ === "details" && /* @__PURE__ */ i(
1781
- es,
1807
+ L === "details" && /* @__PURE__ */ i(
1808
+ rn,
1782
1809
  {
1783
- entityType: S,
1784
- entities: l,
1810
+ entityType: D,
1811
+ entities: _,
1785
1812
  activeUsers: m || [],
1786
- projectInfo: Ae,
1787
- projectName: G,
1788
- disabled: !$e(),
1813
+ projectInfo: S,
1814
+ projectName: l,
1815
+ disabled: !Ue(),
1789
1816
  scope: x,
1790
- statuses: Fe,
1817
+ statuses: fe,
1791
1818
  readOnly: !1,
1792
- annotations: A,
1819
+ annotations: j,
1793
1820
  removeAnnotation: E,
1794
1821
  exportAnnotationComposite: y,
1795
1822
  children: /* @__PURE__ */ i(
1796
- Wt,
1823
+ Kt,
1797
1824
  {
1798
- entities: l,
1799
- isLoading: C
1825
+ entities: _,
1826
+ isLoading: Q
1800
1827
  }
1801
1828
  )
1802
1829
  }
@@ -1805,14 +1832,14 @@ const In = T(ze)`
1805
1832
  ] })
1806
1833
  }
1807
1834
  );
1808
- }, bs = ({
1835
+ }, Sn = ({
1809
1836
  isOpen: e,
1810
- entityType: n,
1837
+ entityType: s,
1811
1838
  ...t
1812
1839
  }) => {
1813
- const { entities: o } = q();
1814
- return !e && !o || !n && !o ? null : /* @__PURE__ */ i(fs, { ...t, entityType: n || o?.entityType });
1815
- }, vs = St`
1840
+ const { entities: o } = K();
1841
+ return !e && !o || !s && !o ? null : /* @__PURE__ */ i(xn, { ...t, entityType: s || o?.entityType });
1842
+ }, Cn = Et`
1816
1843
  from {
1817
1844
  translate: 0 0;
1818
1845
  }
@@ -1820,7 +1847,7 @@ to {
1820
1847
  translate: calc(-100% - 8px) 0;
1821
1848
 
1822
1849
  }
1823
- `, ys = T.div`
1850
+ `, Tn = T.div`
1824
1851
  position: absolute;
1825
1852
  left: 0;
1826
1853
  top: 0;
@@ -1829,14 +1856,14 @@ to {
1829
1856
  width: 100%;
1830
1857
  max-width: 533px;
1831
1858
 
1832
- animation: ${vs} 0.2s ease forwards;
1833
- `, ba = ({ projectsInfo: e, scope: n }) => {
1834
- const { slideOut: t, onOpenViewer: o } = q(), { entityType: s, entityId: a, projectName: r } = t || {}, c = !!s && !!a && !!r, { data: m } = qe({ projectName: r }, { skip: !r }), f = e[r || ""] || {}, { tags: p = [] } = f, { closeSlideOut: g } = q(), b = () => g(), x = (R) => o?.(R);
1835
- return c ? /* @__PURE__ */ i(ys, { children: /* @__PURE__ */ i(
1836
- bs,
1859
+ animation: ${Cn} 0.2s ease forwards;
1860
+ `, Ca = ({ projectsInfo: e, scope: s }) => {
1861
+ const { slideOut: t, onOpenViewer: o } = K(), { entityType: n, entityId: a, projectName: r } = t || {}, c = !!n && !!a && !!r, { data: m } = Je({ projectName: r }, { skip: !r }), f = e[r || ""] || {}, { tags: p = [] } = f, { closeSlideOut: g } = K(), b = () => g(), x = ($) => o?.($);
1862
+ return c ? /* @__PURE__ */ i(Tn, { children: /* @__PURE__ */ i(
1863
+ Sn,
1837
1864
  {
1838
1865
  isOpen: !0,
1839
- entityType: s,
1866
+ entityType: n,
1840
1867
  entitySubTypes: [],
1841
1868
  entities: [{ id: a, projectName: r }],
1842
1869
  projectsInfo: { [r]: f },
@@ -1845,26 +1872,26 @@ to {
1845
1872
  projectUsers: m,
1846
1873
  activeProjectUsers: m,
1847
1874
  isSlideOut: !0,
1848
- scope: n,
1875
+ scope: s,
1849
1876
  onClose: b,
1850
1877
  onOpenViewer: x
1851
1878
  }
1852
1879
  ) }) : null;
1853
1880
  };
1854
- T(En)`
1881
+ T(Os)`
1855
1882
  .p-dialog-header-icons {
1856
1883
  display: none;
1857
1884
  }
1858
1885
  .p-dialog-content {
1859
1886
  }
1860
1887
  `;
1861
- const ks = T.div`
1888
+ const Nn = T.div`
1862
1889
  display: flex;
1863
1890
  flex-direction: column;
1864
1891
  margin: -8px;
1865
1892
  width: calc(100% + 16px);
1866
1893
  height: calc(100% + 16px);
1867
- `, ws = T.header`
1894
+ `, En = T.header`
1868
1895
  display: flex;
1869
1896
  align-items: flex-start;
1870
1897
  gap: var(--base-gap-large);
@@ -1876,7 +1903,7 @@ const ks = T.div`
1876
1903
  display: none;
1877
1904
  }
1878
1905
  }
1879
- `, xs = T.div`
1906
+ `, Dn = T.div`
1880
1907
  display: flex;
1881
1908
  flex-direction: column;
1882
1909
  height: 100%;
@@ -1913,12 +1940,12 @@ const ks = T.div`
1913
1940
  align-items: center;
1914
1941
  gap: var(--base-gap-medium);
1915
1942
  }
1916
- `, Ss = T.div`
1943
+ `, In = T.div`
1917
1944
  display: flex;
1918
1945
  justify-content: space-between;
1919
1946
  padding: 8px;
1920
1947
  padding-top: 0;
1921
- `, Cs = T.div`
1948
+ `, Pn = T.div`
1922
1949
  border-top: solid 1px var(--md-sys-color-outline-variant);
1923
1950
  height: 100%;
1924
1951
  overflow: hidden;
@@ -1937,7 +1964,7 @@ const ks = T.div`
1937
1964
  display: none;
1938
1965
  }
1939
1966
  }
1940
- `, Ts = T.div`
1967
+ `, Fn = T.div`
1941
1968
  display: flex;
1942
1969
  align-items: center;
1943
1970
  gap: var(--base-gap-small);
@@ -1948,84 +1975,84 @@ const ks = T.div`
1948
1975
  .icon {
1949
1976
  font-variation-settings: 'FILL' 1;
1950
1977
  }
1951
- `, va = () => {
1952
- const { pip: e } = q(), n = e?.entityType, t = e?.entities || [], o = e?.scope || "", s = t.length > 0 && !!n, a = t.map((y) => y.projectName), { data: r = [] } = It({ projects: a }, { skip: !s }), { data: c = {}, isFetching: m } = Pt(
1978
+ `, Ta = () => {
1979
+ const { pip: e } = K(), s = e?.entityType, t = e?.entities || [], o = e?.scope || "", n = t.length > 0 && !!s, a = t.map((y) => y.projectName), { data: r = [] } = jt({ projects: a }, { skip: !n }), { data: c = {}, isFetching: m } = Rt(
1953
1980
  {
1954
1981
  projects: a
1955
1982
  },
1956
- { skip: !s }
1957
- ), f = D(
1958
- () => st(c, a),
1983
+ { skip: !n }
1984
+ ), f = C(
1985
+ () => ot(c, a),
1959
1986
  [c, a]
1960
- ), { data: p = [], isFetching: g } = Ke(
1987
+ ), { data: p = [], isFetching: g } = Xe(
1961
1988
  // @ts-expect-error
1962
- { entityType: n, entities: t },
1989
+ { entityType: s, entities: t },
1963
1990
  {
1964
- skip: !s || m
1991
+ skip: !n || m
1965
1992
  }
1966
- ), b = D(
1967
- () => ot(c, a),
1993
+ ), b = C(
1994
+ () => rt(c, a),
1968
1995
  [c, a]
1969
- ), x = D(
1996
+ ), x = C(
1970
1997
  () => ({
1971
1998
  task: b.taskTypes.filter((y) => !!y.icon).reduce((y, w) => ({ ...y, [w.name]: w.icon }), {}),
1972
1999
  folder: b.folderTypes.filter((y) => !!y.icon).reduce((y, w) => ({ ...y, [w.name]: w.icon }), {}),
1973
2000
  product: b.productTypes.filter((y) => !!y.icon).reduce((y, w) => ({ ...y, [w.name]: w.icon }), {})
1974
2001
  }),
1975
2002
  [b]
1976
- ), R = D(
1977
- () => n ? et(p, n, x) : [],
1978
- [p, n]
1979
- ), j = D(() => r.filter((y) => p.some((w) => w?.task?.assignees?.includes(y.name))).map((y) => ({ ...y, avatarUrl: `/api/users/${y.name}/avatar` })), [r, t]), P = p[0];
1980
- if (!p.length || !P) return null;
2003
+ ), $ = C(
2004
+ () => s ? st(p, s, x) : [],
2005
+ [p, s]
2006
+ ), U = C(() => r.filter((y) => p.some((w) => w?.task?.assignees?.includes(y.name))).map((y) => ({ ...y, avatarUrl: `/api/users/${y.name}/avatar` })), [r, t]), A = p[0];
2007
+ if (!p.length || !A) return null;
1981
2008
  if (g) return /* @__PURE__ */ i("div", { children: "Loading..." });
1982
- const d = P?.projectName, N = p.some((y) => y?.status !== P?.status) ? {
2009
+ const d = A?.projectName, N = p.some((y) => y?.status !== A?.status) ? {
1983
2010
  icon: "question_mark",
1984
2011
  color: "var(--md-sys-color-surface-container-highest)",
1985
2012
  name: "Mixed statuses"
1986
- } : f.find((y) => y.name === P?.status) || {
2013
+ } : f.find((y) => y.name === A?.status) || {
1987
2014
  icon: "",
1988
2015
  color: "",
1989
2016
  name: "None"
1990
2017
  };
1991
- if (!n) return null;
1992
- const { title: A, subTitle: E } = nt(p, n);
1993
- return /* @__PURE__ */ i(an, { children: /* @__PURE__ */ i(Ye, { projectName: d, children: /* @__PURE__ */ k(ks, { children: [
1994
- /* @__PURE__ */ k(ws, { children: [
1995
- /* @__PURE__ */ i(Xe, { thumbnails: R }),
1996
- /* @__PURE__ */ k(xs, { children: [
1997
- /* @__PURE__ */ i("h2", { children: A }),
2018
+ if (!s) return null;
2019
+ const { title: j, subTitle: E } = at(p, s);
2020
+ return /* @__PURE__ */ i(cs, { children: /* @__PURE__ */ i(et, { projectName: d, children: /* @__PURE__ */ k(Nn, { children: [
2021
+ /* @__PURE__ */ k(En, { children: [
2022
+ /* @__PURE__ */ i(Ye, { thumbnails: $ }),
2023
+ /* @__PURE__ */ k(Dn, { children: [
2024
+ /* @__PURE__ */ i("h2", { children: j }),
1998
2025
  /* @__PURE__ */ k("div", { className: "sub-title", children: [
1999
2026
  /* @__PURE__ */ k("span", { children: [
2000
- Je(n),
2027
+ Ze(s),
2001
2028
  " - "
2002
2029
  ] }),
2003
2030
  /* @__PURE__ */ i("h3", { children: E })
2004
2031
  ] })
2005
2032
  ] })
2006
2033
  ] }),
2007
- /* @__PURE__ */ k(Ss, { children: [
2034
+ /* @__PURE__ */ k(In, { children: [
2008
2035
  /* @__PURE__ */ k(
2009
- Ts,
2036
+ Fn,
2010
2037
  {
2011
2038
  style: {
2012
2039
  backgroundColor: N?.color,
2013
- color: Ee(N?.color)
2040
+ color: Fe(N?.color)
2014
2041
  },
2015
2042
  children: [
2016
- /* @__PURE__ */ i(fe, { icon: N.icon || "question_mark", style: { color: "inherit" } }),
2043
+ /* @__PURE__ */ i(we, { icon: N.icon || "question_mark", style: { color: "inherit" } }),
2017
2044
  /* @__PURE__ */ i("span", { className: "label", children: N?.name })
2018
2045
  ]
2019
2046
  }
2020
2047
  ),
2021
- /* @__PURE__ */ i(kt, { users: j, style: { pointerEvents: "none" } })
2048
+ /* @__PURE__ */ i(Ct, { users: U, style: { pointerEvents: "none" } })
2022
2049
  ] }),
2023
- /* @__PURE__ */ i(Cs, { children: /* @__PURE__ */ i(
2024
- at,
2050
+ /* @__PURE__ */ i(Pn, { children: /* @__PURE__ */ i(
2051
+ it,
2025
2052
  {
2026
- entityType: n,
2053
+ entityType: s,
2027
2054
  entities: p,
2028
- thumbnailHash: P?.thumbnailHash,
2055
+ thumbnailHash: A?.thumbnailHash,
2029
2056
  activeUsers: [],
2030
2057
  projectInfo: c[d],
2031
2058
  projectName: d,
@@ -2038,23 +2065,23 @@ const ks = T.div`
2038
2065
  ] }) }) });
2039
2066
  };
2040
2067
  export {
2041
- Mt as AssigneeSelect,
2042
- wa as CloseButton,
2043
- Vt as Content,
2044
- xa as ContentRow,
2045
- bs as DetailsPanel,
2046
- va as DetailsPanelFloating,
2047
- ba as DetailsPanelSlideOut,
2048
- Sa as Footer,
2049
- Rt as Grid,
2050
- jt as Header,
2051
- Ot as HeaderContainer,
2052
- Ca as LabelWrapper,
2053
- Ht as PriorityEnumDropdown,
2054
- Lt as ReadOnlyTags,
2055
- _t as StatusSelect,
2056
- $t as TagsSelect,
2057
- Ta as ThumbnailWrapper,
2058
- Ut as Title,
2059
- gs as entitiesWithoutFeed
2068
+ Gt as AssigneeSelect,
2069
+ Da as CloseButton,
2070
+ Mt as Content,
2071
+ Ia as ContentRow,
2072
+ Sn as DetailsPanel,
2073
+ Ta as DetailsPanelFloating,
2074
+ Ca as DetailsPanelSlideOut,
2075
+ Pa as Footer,
2076
+ Ut as Grid,
2077
+ _t as Header,
2078
+ Lt as HeaderContainer,
2079
+ Fa as LabelWrapper,
2080
+ Qt as PriorityEnumDropdown,
2081
+ Wt as ReadOnlyTags,
2082
+ zt as StatusSelect,
2083
+ Bt as TagsSelect,
2084
+ Aa as ThumbnailWrapper,
2085
+ Ht as Title,
2086
+ wn as entitiesWithoutFeed
2060
2087
  };