@ynput/ayon-frontend-shared 0.8.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/DetailsPanel.es.js +39 -39
  2. package/dist/ListTable.es.js +738 -651
  3. package/dist/NewEntity.es.js +4 -2
  4. package/dist/ProjectTreeTable.es.js +4208 -4185
  5. package/dist/ProjectsTable.es.js +5 -4
  6. package/dist/Slicer.es.js +327 -294
  7. package/dist/Views.es.js +725 -713
  8. package/dist/chunks/ColumnDropIndicator.es.js +33 -27
  9. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +44 -38
  10. package/dist/chunks/EntityPickerDialog.es.js +19 -19
  11. package/dist/chunks/Feed.es.js +112 -110
  12. package/dist/chunks/FilmstripEntityCard.es.js +2 -2
  13. package/dist/chunks/GroupSettingsFallback.es.js +3 -2
  14. package/dist/chunks/MetaWidget.es.js +828 -809
  15. package/dist/chunks/NewEntityContextInstance.es.js +6 -5
  16. package/dist/chunks/ReviewablesSelector.es.js +76 -76
  17. package/dist/chunks/SimpleTable.es.js +151 -149
  18. package/dist/chunks/Slicer.es.js +637 -617
  19. package/dist/chunks/TableExportContextInstance.es.js +415 -471
  20. package/dist/chunks/ThumbnailSimple.es.js +11 -11
  21. package/dist/chunks/Watchers.es.js +46 -46
  22. package/dist/chunks/getUris.es.js +1069 -1057
  23. package/dist/chunks/searchTerms.es.js +617 -581
  24. package/dist/chunks/useCreateContextMenu.es.js +15 -13
  25. package/dist/chunks/useLocalStorage.es.js +78 -0
  26. package/dist/components.es.js +916 -884
  27. package/dist/context.es.js +348 -337
  28. package/dist/hooks.es.js +218 -187
  29. package/dist/index.es.js +11 -10
  30. package/dist/types/Actions.d.ts +17 -16
  31. package/dist/types/ContextMenu.d.ts +18 -17
  32. package/dist/types/DetailsPanel.d.ts +17 -16
  33. package/dist/types/EntityPickerDialog.d.ts +17 -16
  34. package/dist/types/Feed.d.ts +18 -17
  35. package/dist/types/ListTable.d.ts +28 -18
  36. package/dist/types/NewEntity.d.ts +19 -16
  37. package/dist/types/ProjectTreeTable.d.ts +62 -19
  38. package/dist/types/ProjectsTable.d.ts +18 -17
  39. package/dist/types/RepresentationsList.d.ts +17 -16
  40. package/dist/types/SimpleTable.d.ts +18 -17
  41. package/dist/types/Slicer.d.ts +24 -17
  42. package/dist/types/Views.d.ts +23 -17
  43. package/dist/types/api.d.ts +18 -17
  44. package/dist/types/components.d.ts +64 -18
  45. package/dist/types/context.d.ts +28 -18
  46. package/dist/types/hooks.d.ts +20 -17
  47. package/dist/types/index.d.ts +17 -16
  48. package/dist/types/util.d.ts +38 -16
  49. package/dist/util.es.js +116 -113
  50. package/package.json +2 -2
@@ -1,13 +1,13 @@
1
- import { aj as rs, aU as he, aO as P, ak as Ne, ab as O, bB as Fs, aI as R, aE as yt, bv as F, az as le, a as _s, bs as Rs, aQ as Gs, aJ as M, al as Le, an as Cs, ap as Ns, aq as Qs, as as Ms, bo as Vs, au as Os, aK as Ds, aM as $s, bj as as, aR as xs, aT as Us, aV as X, aY as Bs, aZ as rt, a_ as qs, af as de, aA as Hs, bk as Ws, bl as zs, b0 as Ks } from "./searchTerms.es.js";
1
+ import { aj as as, aU as he, aO as P, ak as Ne, ab as O, bD as _s, aI as R, aE as yt, bv as F, az as le, a as Rs, bs as Gs, aQ as Cs, aJ as M, al as Le, an as Ns, ap as Qs, aq as Ms, as as Vs, bo as Os, au as Ds, aK as $s, aM as xs, bj as os, aR as Us, aT as Bs, aV as X, aY as qs, aZ as rt, a_ as Hs, af as de, aA as Ws, bk as zs, bl as Ks, b0 as Js } from "./searchTerms.es.js";
2
2
  import "lodash";
3
3
  import "primereact/confirmdialog";
4
- import { toast as os } from "react-toastify";
5
- import { v4 as Js } from "uuid";
6
- import { R as Ys, D as Zs, k as H, f as D, j as fe, c as Ve, a as re, w as K, i as Xs, g as cs } from "./realtimeUpdatesUtils.es.js";
7
- import { useMemo as en } from "react";
4
+ import { toast as cs } from "react-toastify";
5
+ import { v4 as Ys } from "uuid";
6
+ import { R as Zs, D as Xs, k as H, f as $, j as fe, c as Ve, a as re, w as K, i as en, g as ds } from "./realtimeUpdatesUtils.es.js";
7
+ import { useMemo as tn } from "react";
8
8
  import "axios";
9
- import { current as tn } from "@reduxjs/toolkit";
10
- const Oe = rs.injectEndpoints({
9
+ import { current as sn } from "@reduxjs/toolkit";
10
+ const Oe = as.injectEndpoints({
11
11
  endpoints: (t) => ({
12
12
  getProjectsAccess: t.query({
13
13
  async queryFn({ projects: e = [] }, { dispatch: s, forced: n }) {
@@ -66,7 +66,7 @@ const {
66
66
  useGetAccessGroupQuery: Br,
67
67
  useGetAccessGroupSchemaQuery: qr,
68
68
  useGetProjectsAccessQuery: Hr
69
- } = Oe, sn = Oe.enhanceEndpoints({
69
+ } = Oe, nn = Oe.enhanceEndpoints({
70
70
  endpoints: {
71
71
  setProjectsAccess: {
72
72
  async onQueryStarted({ payload: t }, { dispatch: e, queryFulfilled: s }) {
@@ -80,13 +80,13 @@ const {
80
80
  (r) => {
81
81
  let a = {};
82
82
  for (const c of Object.keys(t))
83
- for (const d of Object.keys(t[c]))
83
+ for (const u of Object.keys(t[c]))
84
84
  a = {
85
85
  ...a,
86
- [d]: {
87
- ...r[d] || {},
88
- ...a[d] || {},
89
- [c]: t[c][d]
86
+ [u]: {
87
+ ...r[u] || {},
88
+ ...a[u] || {},
89
+ [c]: t[c][u]
90
90
  }
91
91
  };
92
92
  return { ...r, ...a };
@@ -121,12 +121,12 @@ const {
121
121
  useSetProjectsAccessMutation: Wr,
122
122
  useSaveAccessGroupMutation: zr,
123
123
  useDeleteAccessGroupMutation: Kr
124
- } = sn, nn = Ne.enhanceEndpoints({
124
+ } = nn, rn = Ne.enhanceEndpoints({
125
125
  endpoints: {
126
126
  executeAction: {},
127
127
  listAvailableActionsForContext: {}
128
128
  }
129
- }), rn = nn.injectEndpoints({
129
+ }), an = rn.injectEndpoints({
130
130
  endpoints: (t) => ({
131
131
  getActionsFromContext: t.query({
132
132
  queryFn: async (e, { dispatch: s }) => {
@@ -163,15 +163,15 @@ const {
163
163
  useExecuteActionMutation: Zr,
164
164
  useGetActionConfigQuery: Xr,
165
165
  useSetActionConfigMutation: ea
166
- } = rn, an = (t, e) => e.split(".").reduce((s, n) => s && s[n] !== void 0 ? s[n] : void 0, t), on = (t, e) => {
166
+ } = an, on = (t, e) => e.split(".").reduce((s, n) => s && s[n] !== void 0 ? s[n] : void 0, t), cn = (t, e) => {
167
167
  const s = e.split("."), n = s.pop(), i = s.reduce((r, a) => r && r[a] !== void 0 ? r[a] : void 0, t);
168
168
  i && n && delete i[n];
169
169
  };
170
- function cn(t, e) {
170
+ function dn(t, e) {
171
171
  const s = { ...t };
172
172
  for (const [n, i] of Object.entries(e)) {
173
- const r = an(s, n);
174
- r !== void 0 && (s[i] = r, on(s, n));
173
+ const r = on(s, n);
174
+ r !== void 0 && (s[i] = r, cn(s, n));
175
175
  }
176
176
  return s;
177
177
  }
@@ -181,7 +181,7 @@ const Tt = (t = [], e) => {
181
181
  const i = n.node;
182
182
  if (!i)
183
183
  return;
184
- const r = i, c = cn(
184
+ const r = i, c = dn(
185
185
  r,
186
186
  {
187
187
  "author.name": "authorName",
@@ -197,7 +197,7 @@ const Tt = (t = [], e) => {
197
197
  }
198
198
  s.push(c);
199
199
  }), { activities: s, pageInfo: e };
200
- }, dn = (t) => {
200
+ }, un = (t) => {
201
201
  const {
202
202
  id: e,
203
203
  label: s,
@@ -206,8 +206,8 @@ const Tt = (t = [], e) => {
206
206
  thumbnailId: r,
207
207
  thumbnailHash: a,
208
208
  assignees: c,
209
- taskType: d,
210
- updatedAt: u,
209
+ taskType: u,
210
+ updatedAt: d,
211
211
  folder: o
212
212
  } = t || {};
213
213
  return {
@@ -219,12 +219,12 @@ const Tt = (t = [], e) => {
219
219
  status: i,
220
220
  thumbnailId: r,
221
221
  thumbnailHash: a,
222
- updatedAt: u,
223
- taskType: d,
224
- users: c?.map((p) => ({ name: p, avatarUrl: `/api/users/${p}/avatar` })) || [],
222
+ updatedAt: d,
223
+ taskType: u,
224
+ users: c?.map((l) => ({ name: l, avatarUrl: `/api/users/${l}/avatar` })) || [],
225
225
  path: o?.path.split("/").splice(-2, 1).join("")
226
226
  };
227
- }, un = (t) => {
227
+ }, ln = (t) => {
228
228
  const { id: e, name: s, status: n, thumbnailId: i, author: r, updatedAt: a, product: c } = t;
229
229
  return {
230
230
  id: e,
@@ -239,23 +239,23 @@ const Tt = (t = [], e) => {
239
239
  productType: c?.productType,
240
240
  path: c?.folder?.path?.split("/").pop()
241
241
  };
242
- }, ln = (t) => {
243
- const { id: e, name: s, label: n, status: i, thumbnailId: r, thumbnailHash: a, updatedAt: c, folderType: d, parents: u } = t || {};
242
+ }, pn = (t) => {
243
+ const { id: e, name: s, label: n, status: i, thumbnailId: r, thumbnailHash: a, updatedAt: c, folderType: u, parents: d } = t || {};
244
244
  return {
245
245
  id: e,
246
246
  name: s,
247
247
  title: n || s,
248
248
  type: "folder",
249
- subTitle: u?.[u.length - 1] || "",
249
+ subTitle: d?.[d.length - 1] || "",
250
250
  status: i,
251
251
  thumbnailId: r,
252
252
  thumbnailHash: a,
253
253
  updatedAt: c,
254
- folderType: d,
254
+ folderType: u,
255
255
  users: [],
256
- path: u?.[u.length - 2]
256
+ path: d?.[d.length - 2]
257
257
  };
258
- }, pn = (t) => {
258
+ }, fn = (t) => {
259
259
  const { id: e, name: s, status: n, thumbnailId: i, thumbnailHash: r, updatedAt: a, task: c } = t || {};
260
260
  return {
261
261
  id: e,
@@ -271,64 +271,64 @@ const Tt = (t = [], e) => {
271
271
  users: [],
272
272
  path: c?.folder?.path?.split("/").pop()
273
273
  };
274
- }, fn = (t, e) => {
274
+ }, yn = (t, e) => {
275
275
  switch (e) {
276
276
  case "task":
277
- return dn(t.task);
277
+ return un(t.task);
278
278
  case "version":
279
- return un(t.version);
279
+ return ln(t.version);
280
280
  case "folder":
281
- return ln(t.folder);
281
+ return pn(t.folder);
282
282
  case "workfile":
283
- return pn(t.workfile);
283
+ return fn(t.workfile);
284
284
  default:
285
285
  return {};
286
286
  }
287
- }, yn = (t) => {
287
+ }, gn = (t) => {
288
288
  const e = t?.project?.activities?.edges?.map((a) => a?.node), s = e.map((a) => a.body), n = e.map((a) => a.activityId), i = s.reduce((a, c) => {
289
289
  if (!c) return a;
290
- const d = c.match(/\*\s\[\s\]/g);
291
- return a + (d ? d.length : 0);
290
+ const u = c.match(/\*\s\[\s\]/g);
291
+ return a + (u ? u.length : 0);
292
292
  }, 0), r = s.reduce((a, c) => {
293
293
  if (!c) return a;
294
- const d = c.match(/\*\s\[x\]/g);
295
- return a + (d ? d.length : 0);
294
+ const u = c.match(/\*\s\[x\]/g);
295
+ return a + (u ? u.length : 0);
296
296
  }, 0);
297
297
  return { total: i + r, checked: r, unChecked: i, ids: n };
298
- }, gn = (t, e = "task", s = "task") => t?.length ? [
298
+ }, hn = (t, e = "task", s = "task") => t?.length ? [
299
299
  ...t.map(({ id: n }) => ({ type: e, id: n })),
300
300
  { type: e, id: s.toUpperCase() + "S" },
301
301
  {
302
302
  type: `kanBan${s.charAt(0).toUpperCase() + s.slice(1)}`,
303
303
  id: s.toUpperCase() + "S"
304
304
  }
305
- ] : [{ type: e, id: s.toUpperCase() + "S" }], ds = (t) => {
305
+ ] : [{ type: e, id: s.toUpperCase() + "S" }], us = (t) => {
306
306
  if (typeof t == "string") return t;
307
307
  try {
308
308
  return JSON.stringify(t) ?? "";
309
309
  } catch {
310
310
  return "";
311
311
  }
312
- }, us = (t, e, s) => {
312
+ }, ls = (t, e, s) => {
313
313
  if (!t)
314
314
  return [{ type: "activity", id: "LIST" }];
315
- const { entityIds: n, activityTypes: i, filter: r } = s, a = (o) => (Array.isArray(o) ? o : [o]).filter(Boolean), c = a(n), d = a(i), u = t.pages ? t.pages.flatMap((o) => o.activities) : t.activities || [];
315
+ const { entityIds: n, activityTypes: i, filter: r } = s, a = (o) => (Array.isArray(o) ? o : [o]).filter(Boolean), c = a(n), u = a(i), d = t.pages ? t.pages.flatMap((o) => o.activities) : t.activities || [];
316
316
  return [
317
317
  // Individual Activity Tags
318
- ...u.map((o) => ({ type: "activity", id: o.activityId })),
318
+ ...d.map((o) => ({ type: "activity", id: o.activityId })),
319
319
  { type: "activity", id: "LIST" },
320
320
  // Base Entity Activity Tags
321
321
  ...c.map((o) => ({ type: "entityActivities", id: o })),
322
322
  { type: "entityActivities", id: "LIST" },
323
323
  // Activity Type Tags
324
- ...d.map((o) => ({ type: "entityActivities", id: o })),
324
+ ...u.map((o) => ({ type: "entityActivities", id: o })),
325
325
  // Filtered Entity Activity Tags
326
326
  ...c.map((o) => ({
327
327
  type: "entityActivities",
328
- id: `${o}-${ds(r)}`
328
+ id: `${o}-${us(r)}`
329
329
  })),
330
330
  // Published Version Tags
331
- ...u.filter((o) => o.activityType === "version.publish").map((o) => ({
331
+ ...d.filter((o) => o.activityType === "version.publish").map((o) => ({
332
332
  type: "entityActivities",
333
333
  id: `version.publish-${o.origin.id}`
334
334
  }))
@@ -367,7 +367,7 @@ const Tt = (t = [], e) => {
367
367
  }), s ? Array.from(new Set(e)) : se.activity;
368
368
  }
369
369
  return se.activity;
370
- }, hn = (t) => {
370
+ }, mn = (t) => {
371
371
  switch (t) {
372
372
  case "task":
373
373
  return `
@@ -411,7 +411,7 @@ const Tt = (t = [], e) => {
411
411
  default:
412
412
  return "";
413
413
  }
414
- }, mn = (t) => `
414
+ }, vn = (t) => `
415
415
  query EntityTooltip($projectName: String!, $entityId: String!) {
416
416
  project(name: $projectName) {
417
417
  ${t}(id: $entityId) {
@@ -421,15 +421,15 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
421
421
  thumbnailId
422
422
  updatedAt
423
423
  thumbnailHash
424
- ${hn(t)}
424
+ ${mn(t)}
425
425
  }
426
426
  }
427
427
  }
428
- `, vn = (t) => t.replace(/_([a-z0-9])/g, (e, s) => s.toUpperCase()), kt = {
428
+ `, bn = (t) => t.replace(/_([a-z0-9])/g, (e, s) => s.toUpperCase()), kt = {
429
429
  task_type: "subType",
430
430
  folder_type: "subType",
431
431
  product_type: "subType"
432
- }, ye = (t) => t in kt ? kt[t] : t.startsWith("project_attributes_") ? "attrib_" + t.slice(19) : t.startsWith("inherited_attributes_") ? "attrib_" + t.slice(21) : t.startsWith("attrib_") ? t : vn(t), bn = (t) => {
432
+ }, ye = (t) => t in kt ? kt[t] : t.startsWith("project_attributes_") ? "attrib_" + t.slice(19) : t.startsWith("inherited_attributes_") ? "attrib_" + t.slice(21) : t.startsWith("attrib_") ? t : bn(t), In = (t) => {
433
433
  if (Array.isArray(t)) return t;
434
434
  if (typeof t == "string") {
435
435
  const e = t.trim();
@@ -441,7 +441,7 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
441
441
  }
442
442
  }
443
443
  return [t];
444
- }, In = (t) => {
444
+ }, Tn = (t) => {
445
445
  if (t == null) return;
446
446
  let e = t;
447
447
  if (typeof e == "string")
@@ -454,7 +454,7 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
454
454
  const s = /* @__PURE__ */ new Map();
455
455
  for (const n of e) {
456
456
  if (!n || n.value == null) continue;
457
- const i = bn(n.value);
457
+ const i = In(n.value);
458
458
  for (const r of i) {
459
459
  const a = String(r), c = s.get(a);
460
460
  s.set(a, { ...n, value: a, count: (c?.count ?? 0) + (Number(n.count) || 0) });
@@ -467,27 +467,27 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
467
467
  value: s,
468
468
  count: Number(n) || 0
469
469
  }));
470
- }, me = (t, e) => t == null && e == null ? void 0 : (t ?? 0) + (e ?? 0), Tn = (t, e) => t == null ? e ?? void 0 : e == null || t < e ? t : e, kn = (t, e) => t == null ? e ?? void 0 : e == null || t > e ? t : e, Pe = (t, e) => t != null && e != null && t + e > 0 ? Math.round(t / (t + e) * 1e4) / 100 : void 0, wn = (t, e) => {
470
+ }, me = (t, e) => t == null && e == null ? void 0 : (t ?? 0) + (e ?? 0), kn = (t, e) => t == null ? e ?? void 0 : e == null || t < e ? t : e, wn = (t, e) => t == null ? e ?? void 0 : e == null || t > e ? t : e, Pe = (t, e) => t != null && e != null && t + e > 0 ? Math.round(t / (t + e) * 1e4) / 100 : void 0, An = (t, e) => {
471
471
  const s = me(t.valueFilledCount, e.valueFilledCount), n = me(t.valueNotFilledCount, e.valueNotFilledCount), i = me(t.checkedCount, e.checkedCount), r = me(t.notCheckedCount, e.notCheckedCount);
472
472
  let a;
473
473
  if (t.avg != null && e.avg != null) {
474
- const d = t.valueFilledCount, u = e.valueFilledCount;
475
- a = d != null && u != null && d + u > 0 ? (t.avg * d + e.avg * u) / (d + u) : (t.avg + e.avg) / 2, a = Math.round(a * 100) / 100;
474
+ const u = t.valueFilledCount, d = e.valueFilledCount;
475
+ a = u != null && d != null && u + d > 0 ? (t.avg * u + e.avg * d) / (u + d) : (t.avg + e.avg) / 2, a = Math.round(a * 100) / 100;
476
476
  } else
477
477
  a = t.avg ?? e.avg ?? void 0;
478
478
  let c;
479
479
  if (t.distribution?.length || e.distribution?.length) {
480
- const d = /* @__PURE__ */ new Map();
481
- for (const u of [...t.distribution ?? [], ...e.distribution ?? []]) {
482
- const o = d.get(u.value);
483
- d.set(u.value, o ? { ...o, count: o.count + u.count } : { ...u });
480
+ const u = /* @__PURE__ */ new Map();
481
+ for (const d of [...t.distribution ?? [], ...e.distribution ?? []]) {
482
+ const o = u.get(d.value);
483
+ u.set(d.value, o ? { ...o, count: o.count + d.count } : { ...d });
484
484
  }
485
- c = [...d.values()];
485
+ c = [...u.values()];
486
486
  }
487
487
  return {
488
488
  columnName: t.columnName,
489
- min: Tn(t.min, e.min),
490
- max: kn(t.max, e.max),
489
+ min: kn(t.min, e.min),
490
+ max: wn(t.max, e.max),
491
491
  avg: a,
492
492
  sum: me(t.sum, e.sum),
493
493
  valueFilledCount: s,
@@ -505,7 +505,7 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
505
505
  }, we = (t) => t.map((e) => ({
506
506
  ...e,
507
507
  columnName: ye(e.columnName),
508
- distribution: In(e.distribution)
508
+ distribution: Tn(e.distribution)
509
509
  })), Ae = (t = [], e = []) => {
510
510
  const s = /* @__PURE__ */ new Map();
511
511
  for (const n of e) s.set(ye(n.columnName), { ...n });
@@ -525,11 +525,11 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
525
525
  const n = new Map(s);
526
526
  for (const i of e) {
527
527
  const r = ye(i.columnName), a = s.get(r);
528
- n.set(r, a ? wn(a, i) : i);
528
+ n.set(r, a ? An(a, i) : i);
529
529
  }
530
530
  return [...n.values()];
531
- }, ls = [Ys, Zs], gt = (t, e, s) => {
532
- if (ls.includes(e))
531
+ }, ps = [Zs, Xs], gt = (t, e, s) => {
532
+ if (ps.includes(e))
533
533
  return !0;
534
534
  if (t[e] !== void 0 && t[e] !== null)
535
535
  return t[e];
@@ -552,8 +552,8 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
552
552
  return s[r];
553
553
  }
554
554
  return !1;
555
- }, An = (t, e) => e.filter(
556
- (n) => !ls.includes(n) && t[n]
555
+ }, En = (t, e) => e.filter(
556
+ (n) => !ps.includes(n) && t[n]
557
557
  ).length === 0 && e.includes("name") ? {
558
558
  ...t,
559
559
  name: !0
@@ -561,14 +561,14 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
561
561
  const i = { ...t };
562
562
  for (const r of e)
563
563
  i[r] === void 0 && (i[r] = n[r] ?? gt({}, r, s));
564
- return An(i, e);
564
+ return En(i, e);
565
565
  }, wt = (t) => {
566
566
  const e = t?.targets;
567
567
  return Array.isArray(e) ? e : e ? [e] : [];
568
568
  }, at = (t, e, s) => {
569
569
  const n = e?.[t], i = s?.[t];
570
570
  return n === "none" || i === "none" ? !1 : n != null || i != null;
571
- }, En = (t, e, s, n) => {
571
+ }, Sn = (t, e, s, n) => {
572
572
  const i = /* @__PURE__ */ new Set([
573
573
  ...Object.keys(t ?? {}),
574
574
  ...Object.keys(e ?? {})
@@ -577,19 +577,19 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
577
577
  if (!(s && !gt(s, r, n)) && at(r, t, e))
578
578
  return !0;
579
579
  return !1;
580
- }, ra = (t, e, s, n) => e?.name === "none" && !En(t, e, s, n), Ee = (t, e) => {
580
+ }, ra = (t, e, s, n) => e?.name === "none" && !Sn(t, e, s, n), Ee = (t, e) => {
581
581
  if (!t) return !1;
582
582
  if (!e) return !0;
583
583
  const s = new Set(wt(e).map((n) => n.field));
584
584
  return wt(t).some((n) => !s.has(n.field));
585
- }, qe = [O.Filled, O.NotFilled], Sn = [
585
+ }, qe = [O.Filled, O.NotFilled], At = [
586
586
  O.Min,
587
587
  O.Max,
588
588
  O.Avg,
589
589
  O.Sum,
590
590
  O.Filled,
591
591
  O.NotFilled
592
- ], Z = [
592
+ ], J = [
593
593
  O.Filled,
594
594
  O.NotFilled,
595
595
  O.Distribution
@@ -597,7 +597,7 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
597
597
  folder: "folder_type",
598
598
  task: "task_type",
599
599
  product: "product_type",
600
- version: null
600
+ version: "product_type"
601
601
  }, aa = ({
602
602
  entity: t,
603
603
  attribs: e,
@@ -607,21 +607,21 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
607
607
  columnSummaryScopes: r,
608
608
  extraFields: a = []
609
609
  }) => {
610
- const c = (y) => gt(s, y, n), d = (y) => c(y) && at(y, i, r), u = [];
611
- t === "version" ? u.push({ field: "status", aggregations: d("status") ? Z : qe }) : (u.push({ field: "name", aggregations: qe }), d("status") && u.push({ field: "status", aggregations: Z })), d("tags") && u.push({ field: "tags", aggregations: Z }), t === "task" && d("assignees") && u.push({ field: "assignees", aggregations: Z });
612
- const o = r?.name ?? "all", l = ["folder", "product"].includes(t) ? o === "all" || o === "primary" : o === "all" || o === "secondary", p = i?.name === "breakdown" && at("name", i, r) && l, f = Ln[t];
613
- f && (d("subType") || p) && u.push({ field: f, aggregations: Z });
610
+ const c = (y) => gt(s, y, n), u = (y) => c(y) && at(y, i, r), d = [];
611
+ t === "version" ? d.push({ field: "status", aggregations: u("status") ? J : qe }) : (d.push({ field: "name", aggregations: qe }), u("status") && d.push({ field: "status", aggregations: J })), u("tags") && d.push({ field: "tags", aggregations: J }), t === "task" && u("assignees") && d.push({ field: "assignees", aggregations: J }), t === "version" && (u("version") && d.push({ field: "version", aggregations: At }), u("author") && d.push({ field: "author", aggregations: J }));
612
+ const o = r?.name ?? "all", p = ["folder", "product"].includes(t) ? o === "all" || o === "primary" : o === "all" || o === "secondary", l = i?.name === "breakdown" && at("name", i, r) && p, f = Ln[t];
613
+ (u("subType") || l) && d.push({ field: f, aggregations: J });
614
614
  for (const y of a)
615
- u.push({ field: y, aggregations: Z });
615
+ d.push({ field: y, aggregations: J });
616
616
  for (const y of e) {
617
- if (y.scope && !y.scope.includes(t) || !d(`attrib_${y.name}`)) continue;
617
+ if (y.scope && !y.scope.includes(t) || !u(`attrib_${y.name}`)) continue;
618
618
  let h = `attrib.${y.name}`;
619
619
  ["folder", "task"].includes(t) && (h = `inherited_attributes.${y.name}`);
620
620
  const g = y.data?.type;
621
- g === "integer" || g === "float" ? u.push({ field: h, aggregations: Sn }) : g === "string" ? u.push({ field: h, aggregations: Fs(y.data) ? Z : qe }) : (g === "list_of_strings" || g === "list_of_integers") && u.push({ field: h, aggregations: Z });
621
+ g === "integer" || g === "float" ? d.push({ field: h, aggregations: At }) : g === "string" ? d.push({ field: h, aggregations: _s(y.data) ? J : qe }) : (g === "list_of_strings" || g === "list_of_integers") && d.push({ field: h, aggregations: J });
622
622
  }
623
- return u;
624
- }, At = [
623
+ return d;
624
+ }, Et = [
625
625
  O.Distribution,
626
626
  O.Filled,
627
627
  O.NotFilled
@@ -634,13 +634,14 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
634
634
  status: "status",
635
635
  tags: "tags",
636
636
  author: "author",
637
- productType: "product_type"
637
+ productType: "product_type",
638
+ folderId: "folder_id"
638
639
  }, oa = (t, e) => {
639
640
  const n = (e === "version" || e === "product" ? jn : Pn)[t.id];
640
- if (n) return { field: n, aggregations: At };
641
+ if (n) return { field: n, aggregations: Et };
641
642
  if (t.id.startsWith("attrib.")) {
642
643
  const i = t.id.slice(7);
643
- return { field: e === "task" || e === "folder" ? `inherited_attributes.${i}` : `attrib.${i}`, aggregations: At };
644
+ return { field: e === "task" || e === "folder" ? `inherited_attributes.${i}` : `attrib.${i}`, aggregations: Et };
644
645
  }
645
646
  return null;
646
647
  }, Fn = (t) => {
@@ -649,16 +650,16 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
649
650
  }, ca = (t, e) => {
650
651
  const s = /* @__PURE__ */ new Map(), n = { count: 0, percentage: 0 };
651
652
  if (!e) return { counts: s, total: 0, ungrouped: n, complete: !1 };
652
- const i = Fn(e.field), r = t.find((f) => f.columnName === i), a = r?.distribution || [], c = r?.valueNotFilledCount ?? 0, d = r?.valueFilledCount ?? 0, u = !!r && (a.length > 0 || d === 0), o = a.reduce((f, y) => f + (y.count || 0), 0), l = d ? d + c : o + c;
653
+ const i = Fn(e.field), r = t.find((f) => f.columnName === i), a = r?.distribution || [], c = r?.valueNotFilledCount ?? 0, u = r?.valueFilledCount ?? 0, d = !!r && (a.length > 0 || u === 0), o = a.reduce((f, y) => f + (y.count || 0), 0), p = u ? u + c : o + c;
653
654
  for (const f of a) {
654
- const y = f.count || 0, h = l > 0 ? Math.round(y / l * 100) : 0;
655
+ const y = f.count || 0, h = p > 0 ? Math.round(y / p * 100) : 0;
655
656
  s.set(String(f.value), { count: y, percentage: h });
656
657
  }
657
- const p = {
658
+ const l = {
658
659
  count: c,
659
- percentage: o > 0 && c > 0 ? Math.round(c / l * 100) : void 0
660
+ percentage: o > 0 && c > 0 ? Math.round(c / p * 100) : void 0
660
661
  };
661
- return { counts: s, total: l, ungrouped: p, complete: u };
662
+ return { counts: s, total: p, ungrouped: l, complete: d };
662
663
  }, ee = 10, G = (t) => {
663
664
  if (!t) return {};
664
665
  try {
@@ -667,7 +668,7 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
667
668
  } catch {
668
669
  return {};
669
670
  }
670
- }, da = G, Et = (t) => {
671
+ }, da = G, St = (t) => {
671
672
  if (!t.project)
672
673
  return [];
673
674
  const e = [];
@@ -701,14 +702,14 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
701
702
  GetTasksByParent: {
702
703
  transformResponse: (t) => ({
703
704
  pageInfo: t?.project?.tasks?.pageInfo ?? { hasNextPage: !1, endCursor: null },
704
- tasks: Et(t)
705
+ tasks: St(t)
705
706
  }),
706
707
  providesTags: (t, e, { parentIds: s, projectName: n }) => Ie(t?.tasks || [], n, s),
707
708
  keepUnusedDataFor: ee
708
709
  },
709
710
  GetTasksList: {
710
711
  transformResponse: (t) => ({
711
- tasks: Et(t),
712
+ tasks: St(t),
712
713
  pageInfo: t.project.tasks.pageInfo
713
714
  }),
714
715
  providesTags: (t, e, { projectName: s }) => Ie(t?.tasks || [], s),
@@ -739,7 +740,7 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
739
740
  }
740
741
  }), He = 100, Te = {}, We = (t, e, s, n, i) => JSON.stringify({ projectName: t, filter: e, folderFilter: s, search: n, showComments: i }), Rn = (t, e) => {
741
742
  Te[t] || (Te[t] = /* @__PURE__ */ new Set()), e.forEach((s) => Te[t].add(s));
742
- }, St = (t) => Te[t] || /* @__PURE__ */ new Set(), x = ae.injectEndpoints({
743
+ }, Lt = (t) => Te[t] || /* @__PURE__ */ new Set(), D = ae.injectEndpoints({
743
744
  endpoints: (t) => ({
744
745
  // Each project has one cache for all the tasks of the expanded folders
745
746
  // Changing the expanded folders will trigger a refetch but not a new cache
@@ -747,11 +748,11 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
747
748
  // When new folders are expanded, the new tasks are fetched and we use the cache for the rest
748
749
  // This also solves the pagination issue of getting all tasks in one query, splitting it up in multiple queries to avoid pagination limits
749
750
  getOverviewTasksByFolders: t.query({
750
- async queryFn({ projectName: e, parentIds: s, filter: n, folderFilter: i, search: r, showComments: a }, { dispatch: c, getState: d, forced: u }) {
751
+ async queryFn({ projectName: e, parentIds: s, filter: n, folderFilter: i, search: r, showComments: a }, { dispatch: c, getState: u, forced: d }) {
751
752
  try {
752
- const o = d(), l = { projectName: e, filter: n, folderFilter: i, search: r, showComments: a }, f = x.endpoints.getOverviewTasksByFolders.select(
753
- l
754
- )(o)?.data || [], y = We(e, n, i, r, a), h = St(y), g = u ? s : s.filter((A) => !h.has(A));
753
+ const o = u(), p = { projectName: e, filter: n, folderFilter: i, search: r, showComments: a }, f = D.endpoints.getOverviewTasksByFolders.select(
754
+ p
755
+ )(o)?.data || [], y = We(e, n, i, r, a), h = Lt(y), g = d ? s : s.filter((A) => !h.has(A));
755
756
  if (g.length === 0)
756
757
  return { data: f };
757
758
  const m = [], b = 100, v = 20, T = 10, k = 1e3, I = b * v;
@@ -783,8 +784,8 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
783
784
  )
784
785
  );
785
786
  if (C.error) throw C.error;
786
- const W = C.data, $ = W?.tasks || [];
787
- m.push(...$);
787
+ const W = C.data, x = W?.tasks || [];
788
+ m.push(...x);
788
789
  const N = W?.pageInfo;
789
790
  S = N?.hasNextPage || !1, j = N?.endCursor || void 0;
790
791
  }
@@ -807,14 +808,14 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
807
808
  return JSON.stringify(e) !== JSON.stringify(s);
808
809
  },
809
810
  providesTags: (e, s, { parentIds: n, projectName: i }) => Ie(e, i, n),
810
- async onCacheEntryAdded({ projectName: e, parentIds: s, filter: n, folderFilter: i, search: r, showComments: a }, { cacheDataLoaded: c, cacheEntryRemoved: d, updateCachedData: u, dispatch: o, getCacheEntry: l }) {
811
- let p;
812
- const y = D(
811
+ async onCacheEntryAdded({ projectName: e, parentIds: s, filter: n, folderFilter: i, search: r, showComments: a }, { cacheDataLoaded: c, cacheEntryRemoved: u, updateCachedData: d, dispatch: o, getCacheEntry: p }) {
812
+ let l;
813
+ const y = $(
813
814
  async (m, b) => {
814
- const v = St(
815
+ const v = Lt(
815
816
  We(e, n, i, r, a)
816
817
  ), T = new Set(
817
- l().data?.map((E) => E.id) || []
818
+ p().data?.map((E) => E.id) || []
818
819
  ), k = /* @__PURE__ */ new Set(), I = [];
819
820
  m.filter((E) => E.project === e).filter((E) => v.has(E.summary?.parentId)).forEach((E) => {
820
821
  const A = E.summary?.entityId;
@@ -829,7 +830,7 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
829
830
  field: S.field,
830
831
  value: S.value
831
832
  }) : k.add(A);
832
- }), I.length && u((E) => {
833
+ }), I.length && d((E) => {
833
834
  I.forEach(({ taskId: A, field: L, value: S }) => {
834
835
  const j = E.find((_) => _.id === A);
835
836
  j && Object.assign(j, { [L === "type" ? "taskType" : L]: S });
@@ -851,7 +852,7 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
851
852
  ).unwrap()).tasks || [];
852
853
  if (!b()) return;
853
854
  const L = new Map(A.map((S) => [S.id, S]));
854
- u((S) => {
855
+ d((S) => {
855
856
  for (const j of A) {
856
857
  const _ = S.findIndex((C) => C.id === j.id);
857
858
  _ > -1 ? S[_] = j : S.push(j);
@@ -872,7 +873,7 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
872
873
  try {
873
874
  await c, h = H(
874
875
  (b) => {
875
- u((v) => {
876
+ d((v) => {
876
877
  b.forEach((T) => {
877
878
  if (T.summary.entityType === "task" && T.summary.thumbnailHash) {
878
879
  const k = v.findIndex((I) => I.id === T.summary.entityId);
@@ -887,12 +888,12 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
887
888
  const T = v?.summary?.entityId, k = v?.summary?.parentId;
888
889
  !T || !k || y.add({ ...v, topic: b });
889
890
  };
890
- p = F.subscribe("entity.task", m);
891
+ l = F.subscribe("entity.task", m);
891
892
  } catch {
892
893
  }
893
- await d, y.clear();
894
+ await u, y.clear();
894
895
  const g = We(e, n, i, r, a);
895
- delete Te[g], p && F.unsubscribe(p), h && h();
896
+ delete Te[g], l && F.unsubscribe(l), h && h();
896
897
  },
897
898
  keepUnusedDataFor: ee
898
899
  }),
@@ -936,24 +937,24 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
936
937
  filter: r,
937
938
  folderFilter: a,
938
939
  search: c,
939
- folderIds: d,
940
- taskIds: u,
940
+ folderIds: u,
941
+ taskIds: d,
941
942
  sortBy: o,
942
- desc: l,
943
- showComments: p,
943
+ desc: p,
944
+ showComments: l,
944
945
  includeFolderChildren: f
945
946
  } = e, { cursor: y } = s, h = {
946
947
  projectName: i,
947
948
  filter: r,
948
949
  folderFilter: a,
949
950
  search: c,
950
- folderIds: d,
951
- taskIds: u,
952
- showComments: !!p,
951
+ folderIds: u,
952
+ taskIds: d,
953
+ showComments: !!l,
953
954
  includeFolderChildren: f !== !1
954
955
  // default to true
955
956
  };
956
- o ? (h.sortBy = o, l ? (h.before = y || void 0, h.last = He) : (h.after = y || void 0, h.first = He)) : (h.after = y || void 0, h.first = He);
957
+ o ? (h.sortBy = o, p ? (h.before = y || void 0, h.last = He) : (h.after = y || void 0, h.first = He)) : (h.after = y || void 0, h.first = He);
957
958
  const g = await n.dispatch(
958
959
  ae.endpoints.GetTasksList.initiate(h, { forceRefetch: !0 })
959
960
  );
@@ -977,14 +978,14 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
977
978
  providesTags: (e, s, { projectName: n }) => Ie(e?.pages.flatMap((i) => i.tasks) || [], n),
978
979
  async onCacheEntryAdded(e, { cacheDataLoaded: s, cacheEntryRemoved: n, updateCachedData: i, dispatch: r, getCacheEntry: a }) {
979
980
  let c;
980
- const u = D(
981
- async (l, p) => {
981
+ const d = $(
982
+ async (p, l) => {
982
983
  const f = new Set(
983
984
  (a().data?.pages || []).flatMap(
984
985
  (m) => m.tasks.map((b) => b.id)
985
986
  )
986
987
  ), y = /* @__PURE__ */ new Set(), h = [];
987
- l.filter((m) => m.project === e.projectName).forEach((m) => {
988
+ p.filter((m) => m.project === e.projectName).forEach((m) => {
988
989
  const b = m.summary?.entityId;
989
990
  if (!b || !f.has(b)) return;
990
991
  const v = m.topic?.split(".")[2]?.replace("_changed", ""), T = fe(
@@ -1023,7 +1024,7 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1023
1024
  { forceRefetch: !0 }
1024
1025
  )
1025
1026
  ).unwrap()).tasks || [];
1026
- if (!p()) return;
1027
+ if (!l()) return;
1027
1028
  const v = new Map(b.map((T) => [T.id, T]));
1028
1029
  i((T) => {
1029
1030
  for (const k of b) {
@@ -1059,14 +1060,14 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1059
1060
  console.error("Realtime infinite tasks batch update failed", m);
1060
1061
  }
1061
1062
  },
1062
- (l) => `${l.project}:${l.summary?.entityId}:${l.topic}`
1063
+ (p) => `${p.project}:${p.summary?.entityId}:${p.topic}`
1063
1064
  );
1064
1065
  let o;
1065
1066
  try {
1066
1067
  await s, o = H(
1067
- (p) => {
1068
+ (l) => {
1068
1069
  i((f) => {
1069
- p.forEach((y) => {
1070
+ l.forEach((y) => {
1070
1071
  if (y.summary.entityType === "task" && y.summary.thumbnailHash)
1071
1072
  for (const h of f.pages) {
1072
1073
  const g = h.tasks.findIndex((m) => m.id === y.summary.entityId);
@@ -1080,13 +1081,13 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1080
1081
  },
1081
1082
  ["task"]
1082
1083
  );
1083
- const l = (p, f) => {
1084
- f?.summary?.entityId && u.add({ ...f, topic: p });
1084
+ const p = (l, f) => {
1085
+ f?.summary?.entityId && d.add({ ...f, topic: l });
1085
1086
  };
1086
- c = F.subscribe("entity.task", l);
1087
+ c = F.subscribe("entity.task", p);
1087
1088
  } catch {
1088
1089
  }
1089
- await n, u.clear(), c && F.unsubscribe(c), o && o();
1090
+ await n, d.clear(), c && F.unsubscribe(c), o && o();
1090
1091
  },
1091
1092
  keepUnusedDataFor: ee
1092
1093
  }),
@@ -1099,18 +1100,18 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1099
1100
  folderIds: r,
1100
1101
  desc: a,
1101
1102
  sortBy: c,
1102
- groupCount: d,
1103
- showComments: u
1103
+ groupCount: u,
1104
+ showComments: d
1104
1105
  }, o) => {
1105
1106
  try {
1106
- let l = [];
1107
- const p = /* @__PURE__ */ new Set(["folderType"]);
1107
+ let p = [];
1108
+ const l = /* @__PURE__ */ new Set(["folderType"]);
1108
1109
  for (const h of s) {
1109
- const g = d || h.count || 500;
1110
+ const g = u || h.count || 500;
1110
1111
  let m = h.filter, b = i;
1111
1112
  if (h.filter)
1112
1113
  try {
1113
- const k = JSON.parse(h.filter), I = k.conditions || [], w = I.filter((A) => !p.has(A.key)), E = I.filter((A) => p.has(A.key));
1114
+ const k = JSON.parse(h.filter), I = k.conditions || [], w = I.filter((A) => !l.has(A.key)), E = I.filter((A) => l.has(A.key));
1114
1115
  if (E.length > 0) {
1115
1116
  m = w.length ? JSON.stringify({ ...k, conditions: w }) : void 0;
1116
1117
  const A = i ? JSON.parse(i) : null, S = [...A && Array.isArray(A.conditions) ? A.conditions : [], ...E];
@@ -1127,7 +1128,7 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1127
1128
  search: n,
1128
1129
  folderIds: r,
1129
1130
  sortBy: c,
1130
- showComments: !!u,
1131
+ showComments: !!d,
1131
1132
  // @ts-expect-error - we know group does not exist on query variables but we need it for later
1132
1133
  group: h.value
1133
1134
  };
@@ -1135,9 +1136,9 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1135
1136
  const T = o.dispatch(
1136
1137
  ae.endpoints.GetTasksList.initiate(v, { forceRefetch: !0 })
1137
1138
  );
1138
- l.push(T);
1139
+ p.push(T);
1139
1140
  }
1140
- const f = await Promise.all(l), y = [];
1141
+ const f = await Promise.all(p), y = [];
1141
1142
  for (const h of f) {
1142
1143
  if (h.error) throw h.error;
1143
1144
  const g = h.originalArgs?.group, m = h.data?.pageInfo?.hasNextPage || h.data?.pageInfo?.hasPreviousPage || !1, b = h.data?.tasks.map((v, T, k) => ({
@@ -1157,8 +1158,8 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1157
1158
  tasks: y
1158
1159
  }
1159
1160
  };
1160
- } catch (l) {
1161
- return console.error("ERROR [getGroupedTasksList]:", l, l.data?.detail), { error: P(l) };
1161
+ } catch (p) {
1162
+ return console.error("ERROR [getGroupedTasksList]:", p, p.data?.detail), { error: P(p) };
1162
1163
  }
1163
1164
  },
1164
1165
  providesTags: (e, s, { projectName: n }) => Ie(e?.tasks, n),
@@ -1174,22 +1175,22 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1174
1175
  useGetGroupedTasksListQuery: ga,
1175
1176
  useGetFolderColumnStatsQuery: ha,
1176
1177
  useGetTaskColumnStatsQuery: ma
1177
- } = x, ne = 10, Lt = (t) => {
1178
+ } = D, ne = 10, Pt = (t) => {
1178
1179
  if (!t) return {};
1179
1180
  try {
1180
1181
  return typeof t != "string" ? t ?? {} : JSON.parse(t);
1181
1182
  } catch (e) {
1182
1183
  return console.warn("Failed to parse entity list data field:", e, t), {};
1183
1184
  }
1184
- }, Pt = 1e4, ze = 100, je = R.enhanceEndpoints({
1185
+ }, jt = 1e4, ze = 100, je = R.enhanceEndpoints({
1185
1186
  endpoints: {
1186
1187
  GetLists: {
1187
1188
  transformResponse: (t) => ({
1188
1189
  // @ts-expect-error - entityType is string
1189
1190
  lists: t.project.entityLists.edges.map((e) => ({
1190
1191
  ...e.node,
1191
- data: Lt(e.node.data),
1192
- attrib: Lt(e.node.allAttrib)
1192
+ data: Pt(e.node.data),
1193
+ attrib: Pt(e.node.allAttrib)
1193
1194
  })),
1194
1195
  pageInfo: t.project.entityLists.pageInfo
1195
1196
  }),
@@ -1203,13 +1204,13 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1203
1204
  return {
1204
1205
  items: t.project.entityLists.edges.flatMap(
1205
1206
  (s) => s.node.items.edges.map(({ node: n, itemAttrib: i, entityAttrib: r, ...a }) => {
1206
- const c = i || {}, d = Object.fromEntries(
1207
- a.ownItemAttrib.filter((u) => u in c).map((u) => [u, c[u]])
1207
+ const c = i || {}, u = Object.fromEntries(
1208
+ a.ownItemAttrib.filter((d) => d in c).map((d) => [d, c[d]])
1208
1209
  );
1209
1210
  return {
1210
1211
  ...n,
1211
1212
  ...a,
1212
- listAttrib: d,
1213
+ listAttrib: u,
1213
1214
  entityAttrib: r || {}
1214
1215
  };
1215
1216
  })
@@ -1254,7 +1255,7 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1254
1255
  try {
1255
1256
  const { cursor: i } = s, r = {
1256
1257
  ...e,
1257
- first: Pt,
1258
+ first: jt,
1258
1259
  after: i || void 0
1259
1260
  }, a = await n.dispatch(
1260
1261
  je.endpoints.GetLists.initiate(r, { forceRefetch: !0 })
@@ -1292,11 +1293,11 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1292
1293
  "entity_list.deleted"
1293
1294
  ]);
1294
1295
  let a;
1295
- const c = D(
1296
- (d) => {
1297
- i((u) => {
1298
- d.forEach(({ topic: o, message: l }) => {
1299
- const p = l.summary, f = p.id;
1296
+ const c = $(
1297
+ (u) => {
1298
+ i((d) => {
1299
+ u.forEach(({ topic: o, message: p }) => {
1300
+ const l = p.summary, f = l.id;
1300
1301
  if (!f) return;
1301
1302
  const y = (h) => ({
1302
1303
  projectName: e,
@@ -1309,40 +1310,40 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1309
1310
  access: "",
1310
1311
  accessLevel: 30,
1311
1312
  ...h || {},
1312
- id: p.id,
1313
- label: p.label,
1314
- entityType: p.entity_type,
1315
- entityListType: p.entity_list_type,
1316
- count: p.count,
1317
- entityListFolderId: p.entity_list_folder_id ?? null,
1313
+ id: l.id,
1314
+ label: l.label,
1315
+ entityType: l.entity_type,
1316
+ entityListType: l.entity_list_type,
1317
+ count: l.count,
1318
+ entityListFolderId: l.entity_list_folder_id ?? null,
1318
1319
  // the event's own timestamps have no timezone, so the client clock is the closer estimate
1319
1320
  updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
1320
1321
  owner: h?.owner || ""
1321
1322
  // mainly to shut up typescript
1322
1323
  });
1323
1324
  if (o === "entity_list.changed") {
1324
- const h = u.pages.flatMap((g) => g.lists).find((g) => g.id === f);
1325
+ const h = d.pages.flatMap((g) => g.lists).find((g) => g.id === f);
1325
1326
  if (!h) return;
1326
1327
  Object.assign(h, y(h));
1327
1328
  } else if (o === "entity_list.created") {
1328
- const h = u.pages.some(
1329
+ const h = d.pages.some(
1329
1330
  (g) => g.lists.some((m) => m.id === f)
1330
1331
  );
1331
- u.pages.length !== 0 && !h && u.pages[0].lists.unshift(y());
1332
- } else o === "entity_list.deleted" && u.pages.forEach((h) => {
1332
+ d.pages.length !== 0 && !h && d.pages[0].lists.unshift(y());
1333
+ } else o === "entity_list.deleted" && d.pages.forEach((h) => {
1333
1334
  h.lists = h.lists.filter((g) => g.id !== f);
1334
1335
  });
1335
1336
  });
1336
1337
  });
1337
1338
  },
1338
- ({ topic: d, message: u }) => `${d}:${u.summary?.id ?? ""}`
1339
+ ({ topic: u, message: d }) => `${u}:${d.summary?.id ?? ""}`
1339
1340
  );
1340
1341
  try {
1341
1342
  await s;
1342
- const d = (u, o) => {
1343
- !r.has(u) || !o?.summary?.id || c.add({ topic: u, message: o });
1343
+ const u = (d, o) => {
1344
+ !r.has(d) || !o?.summary?.id || c.add({ topic: d, message: o });
1344
1345
  };
1345
- a = F.subscribe("entity_list", d);
1346
+ a = F.subscribe("entity_list", u);
1346
1347
  } catch {
1347
1348
  }
1348
1349
  await n, F.unsubscribe(a), c.clear();
@@ -1362,19 +1363,19 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1362
1363
  },
1363
1364
  queryFn: async ({ queryArg: e, pageParam: s }, n) => {
1364
1365
  try {
1365
- const { sortBy: i, desc: r, ...a } = e, { cursor: c } = s, d = {
1366
+ const { sortBy: i, desc: r, ...a } = e, { cursor: c } = s, u = {
1366
1367
  ...a,
1367
1368
  first: ze,
1368
1369
  after: c || void 0
1369
1370
  };
1370
- d.after = c || void 0, d.first = ze, i && (d.sortBy = i, r && (d.before = c || void 0, d.after = void 0, d.last = ze, d.first = void 0));
1371
- const u = await n.dispatch(
1372
- je.endpoints.GetListItems.initiate(d, {
1371
+ u.after = c || void 0, u.first = ze, i && (u.sortBy = i, r && (u.before = c || void 0, u.after = void 0, u.last = ze, u.first = void 0));
1372
+ const d = await n.dispatch(
1373
+ je.endpoints.GetListItems.initiate(u, {
1373
1374
  forceRefetch: !0
1374
1375
  })
1375
1376
  );
1376
- return u.error ? { error: P(u.error) } : {
1377
- data: u.data || {
1377
+ return d.error ? { error: P(d.error) } : {
1378
+ data: d.data || {
1378
1379
  items: [],
1379
1380
  pageInfo: {
1380
1381
  hasNextPage: !1,
@@ -1405,18 +1406,18 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1405
1406
  ],
1406
1407
  async onCacheEntryAdded(e, { cacheDataLoaded: s, cacheEntryRemoved: n, dispatch: i, updateCachedData: r }) {
1407
1408
  let a, c;
1408
- const d = D(
1409
+ const u = $(
1409
1410
  (o) => {
1410
1411
  i(
1411
- R.util.invalidateTags(o.map(({ id: l }) => ({ type: "entityListItem", id: l })))
1412
+ R.util.invalidateTags(o.map(({ id: p }) => ({ type: "entityListItem", id: p })))
1412
1413
  );
1413
1414
  },
1414
1415
  ({ id: o }) => o
1415
1416
  );
1416
- let u;
1417
+ let d;
1417
1418
  try {
1418
1419
  const f = (await s).data.pages.flatMap((b) => b.items)[0]?.entityType;
1419
- u = H(
1420
+ d = H(
1420
1421
  (b) => {
1421
1422
  r((v) => {
1422
1423
  v?.pages && b.forEach((T) => {
@@ -1432,16 +1433,16 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1432
1433
  const y = "entity_list.changed", h = `entity.${f}`, g = (b, v) => {
1433
1434
  if (b !== y) return;
1434
1435
  const k = v.summary.id;
1435
- k && d.add({ id: k });
1436
+ k && u.add({ id: k });
1436
1437
  }, m = (b, v) => {
1437
1438
  if (!b.startsWith(h)) return;
1438
1439
  const k = v.summary.entityId;
1439
- k && d.add({ id: k });
1440
+ k && u.add({ id: k });
1440
1441
  };
1441
1442
  a = F.subscribe(y, g), f && (c = F.subscribe(h, m));
1442
1443
  } catch {
1443
1444
  }
1444
- await n, F.unsubscribe(a), F.unsubscribe(c), u && u(), d.clear();
1445
+ await n, F.unsubscribe(a), F.unsubscribe(c), d && d(), u.clear();
1445
1446
  },
1446
1447
  keepUnusedDataFor: ne
1447
1448
  }),
@@ -1460,7 +1461,7 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1460
1461
  try {
1461
1462
  const { cursor: i } = s, r = {
1462
1463
  ...e,
1463
- first: Pt,
1464
+ first: jt,
1464
1465
  after: i || void 0
1465
1466
  }, a = await n.dispatch(
1466
1467
  je.endpoints.GetListsItemsForReviewSession.initiate(r, {
@@ -1516,7 +1517,7 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1516
1517
  useLazyGetListsItemsForReviewSessionQuery: Ta,
1517
1518
  useGetListItemsQuery: ka,
1518
1519
  useLazyGetListItemsQuery: wa
1519
- } = U, { useGetEntityListQuery: Aa } = Gn, jt = (t, e) => {
1520
+ } = U, { useGetEntityListQuery: Aa } = Gn, Ft = (t, e) => {
1520
1521
  if (!e) return;
1521
1522
  const s = { ...t.listAttrib };
1522
1523
  for (const [n, i] of Object.entries(e))
@@ -1533,11 +1534,11 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1533
1534
  updateEntityList: {
1534
1535
  async onQueryStarted({ entityListId: t, entityListPatchModel: e }, { dispatch: s, queryFulfilled: n, getState: i }) {
1535
1536
  const r = i(), a = [{ type: "entityList", id: t }], c = U.util.selectInvalidatedBy(r, a).filter((o) => o.endpointName === "getListsInfinite");
1536
- let d = [];
1537
+ let u = [];
1537
1538
  for (const o of c) {
1538
- const l = s(
1539
- U.util.updateQueryData("getListsInfinite", o.originalArgs, (p) => {
1540
- for (const f of p.pages) {
1539
+ const p = s(
1540
+ U.util.updateQueryData("getListsInfinite", o.originalArgs, (l) => {
1541
+ for (const f of l.pages) {
1541
1542
  const y = f.lists.findIndex((h) => h.id === t);
1542
1543
  if (y !== -1) {
1543
1544
  const h = f.lists[y];
@@ -1547,26 +1548,26 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1547
1548
  }
1548
1549
  })
1549
1550
  );
1550
- d.push(l);
1551
+ u.push(p);
1551
1552
  }
1552
- const u = le.util.selectInvalidatedBy(r, a).filter(
1553
+ const d = le.util.selectInvalidatedBy(r, a).filter(
1553
1554
  (o) => o.endpointName === "getEntityList" && o.originalArgs.entityListId === t
1554
1555
  );
1555
- for (const o of u) {
1556
- const l = s(
1557
- le.util.updateQueryData("getEntityList", o.originalArgs, (p) => {
1558
- Object.assign(p, {
1559
- ...p,
1556
+ for (const o of d) {
1557
+ const p = s(
1558
+ le.util.updateQueryData("getEntityList", o.originalArgs, (l) => {
1559
+ Object.assign(l, {
1560
+ ...l,
1560
1561
  ...e
1561
1562
  });
1562
1563
  })
1563
1564
  );
1564
- d.push(l);
1565
+ u.push(p);
1565
1566
  }
1566
1567
  try {
1567
1568
  await n;
1568
1569
  } catch {
1569
- d.forEach((o) => {
1570
+ u.forEach((o) => {
1570
1571
  o.undo();
1571
1572
  });
1572
1573
  }
@@ -1582,18 +1583,18 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1582
1583
  // LIST ITEM MUTATIONS
1583
1584
  updateEntityListItems: {
1584
1585
  async onQueryStarted({ listId: t, entityListMultiPatchModel: e }, { dispatch: s, queryFulfilled: n, getState: i }) {
1585
- const r = i(), a = [{ type: "entityListItem", id: t }], c = U.util.selectInvalidatedBy(r, a).filter((u) => u.endpointName === "getListItemsInfinite");
1586
- let d = [];
1586
+ const r = i(), a = [{ type: "entityListItem", id: t }], c = U.util.selectInvalidatedBy(r, a).filter((d) => d.endpointName === "getListItemsInfinite");
1587
+ let u = [];
1587
1588
  if (!e.items || e.items.length === 0) {
1588
1589
  await n;
1589
1590
  return;
1590
1591
  }
1591
- for (const u of c) {
1592
- if (u.originalArgs.listId !== t) continue;
1592
+ for (const d of c) {
1593
+ if (d.originalArgs.listId !== t) continue;
1593
1594
  const o = s(
1594
- U.util.updateQueryData("getListItemsInfinite", u.originalArgs, (l) => {
1595
- let p = !1;
1596
- for (const f of l.pages)
1595
+ U.util.updateQueryData("getListItemsInfinite", d.originalArgs, (p) => {
1596
+ let l = !1;
1597
+ for (const f of p.pages)
1597
1598
  e.items?.forEach((y) => {
1598
1599
  const h = f.items.findIndex(
1599
1600
  (g) => g.id === y.id || g.entityId === y.entityId
@@ -1608,30 +1609,30 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1608
1609
  ...y.data || {}
1609
1610
  }
1610
1611
  };
1611
- jt(v, m), Object.assign(f.items[h], v), y.position !== void 0 && (p = !0);
1612
+ Ft(v, m), Object.assign(f.items[h], v), y.position !== void 0 && (l = !0);
1612
1613
  }
1613
1614
  });
1614
- if (p) {
1615
- let f = l.pages.flatMap((h) => h.items);
1615
+ if (l) {
1616
+ let f = p.pages.flatMap((h) => h.items);
1616
1617
  f.sort((h, g) => {
1617
1618
  const m = typeof h.position == "number" ? h.position : 1 / 0, b = typeof g.position == "number" ? g.position : 1 / 0;
1618
1619
  return m - b;
1619
1620
  });
1620
1621
  let y = 0;
1621
- for (const h of l.pages) {
1622
+ for (const h of p.pages) {
1622
1623
  const g = h.items.length;
1623
1624
  h.items = f.slice(y, y + g), y += g;
1624
1625
  }
1625
1626
  }
1626
1627
  })
1627
1628
  );
1628
- d.push(o);
1629
+ u.push(o);
1629
1630
  }
1630
1631
  try {
1631
1632
  await n;
1632
1633
  } catch {
1633
- d.forEach((u) => {
1634
- u.undo();
1634
+ u.forEach((d) => {
1635
+ d.undo();
1635
1636
  });
1636
1637
  }
1637
1638
  },
@@ -1650,15 +1651,15 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1650
1651
  },
1651
1652
  updateEntityListItem: {
1652
1653
  async onQueryStarted({ entityListItemId: t, entityListItemPatchModel: e }, { dispatch: s, queryFulfilled: n, getState: i }) {
1653
- const r = i(), a = [{ type: "entityListItem", id: t }], c = U.util.selectInvalidatedBy(r, a).filter((u) => u.endpointName === "getListItemsInfinite");
1654
- let d = [];
1655
- for (const u of c) {
1654
+ const r = i(), a = [{ type: "entityListItem", id: t }], c = U.util.selectInvalidatedBy(r, a).filter((d) => d.endpointName === "getListItemsInfinite");
1655
+ let u = [];
1656
+ for (const d of c) {
1656
1657
  const o = s(
1657
- U.util.updateQueryData("getListItemsInfinite", u.originalArgs, (l) => {
1658
- for (const p of l.pages) {
1659
- const f = p.items.findIndex((y) => y.id === t);
1658
+ U.util.updateQueryData("getListItemsInfinite", d.originalArgs, (p) => {
1659
+ for (const l of p.pages) {
1660
+ const f = l.items.findIndex((y) => y.id === t);
1660
1661
  if (f !== -1) {
1661
- const y = p.items[f], { attrib: h, ...g } = e, m = {
1662
+ const y = l.items[f], { attrib: h, ...g } = e, m = {
1662
1663
  ...y,
1663
1664
  ...g,
1664
1665
  data: {
@@ -1666,19 +1667,19 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1666
1667
  ...e.data
1667
1668
  }
1668
1669
  };
1669
- jt(m, h), Object.assign(y, m);
1670
+ Ft(m, h), Object.assign(y, m);
1670
1671
  break;
1671
1672
  }
1672
1673
  }
1673
1674
  })
1674
1675
  );
1675
- d.push(o);
1676
+ u.push(o);
1676
1677
  }
1677
1678
  try {
1678
1679
  await n;
1679
1680
  } catch {
1680
- d.forEach((u) => {
1681
- u.undo();
1681
+ u.forEach((d) => {
1682
+ d.undo();
1682
1683
  });
1683
1684
  }
1684
1685
  },
@@ -1755,14 +1756,14 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1755
1756
  { type: "folder", id: s }
1756
1757
  ],
1757
1758
  async onCacheEntryAdded(t, { cacheDataLoaded: e, cacheEntryRemoved: s, updateCachedData: n, getCacheEntry: i, dispatch: r }) {
1758
- const { projectName: a } = t || {}, c = ["status", "tags", "folderType"], d = {
1759
+ const { projectName: a } = t || {}, c = ["status", "tags", "folderType"], u = {
1759
1760
  "entity.folder.label_changed": "label",
1760
1761
  "entity.folder.renamed": "name",
1761
1762
  "entity.folder.type_changed": "folderType",
1762
1763
  "entity.folder.status_changed": "status",
1763
1764
  "entity.folder.tags_changed": "tags",
1764
1765
  "entity.folder.attrib_changed": "attrib"
1765
- }, u = ["entity.folder"], o = [], p = D(
1766
+ }, d = ["entity.folder"], o = [], l = $(
1766
1767
  async (y, h) => {
1767
1768
  if (!a) return;
1768
1769
  const g = /* @__PURE__ */ new Set(), m = i().data;
@@ -1777,13 +1778,13 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1777
1778
  }
1778
1779
  if (!g.has(w)) return;
1779
1780
  const E = fe(
1780
- d[I.topic],
1781
+ u[I.topic],
1781
1782
  I.summary,
1782
1783
  c
1783
1784
  );
1784
1785
  if (E) T.push({ folderId: w, ...E });
1785
1786
  else {
1786
- const A = d[I.topic];
1787
+ const A = u[I.topic];
1787
1788
  if (!A) return;
1788
1789
  const L = v.get(w) || /* @__PURE__ */ new Set();
1789
1790
  L.add(A), v.set(w, L);
@@ -1842,12 +1843,12 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
1842
1843
  ["folder"]
1843
1844
  );
1844
1845
  const y = (h, g) => {
1845
- g?.summary?.entityId && p.add({ ...g, topic: h });
1846
+ g?.summary?.entityId && l.add({ ...g, topic: h });
1846
1847
  };
1847
- u.forEach((h) => o.push(F.subscribe(h, y)));
1848
+ d.forEach((h) => o.push(F.subscribe(h, y)));
1848
1849
  } catch {
1849
1850
  }
1850
- await s, o.forEach((y) => F.unsubscribe(y)), f && f(), p.clear();
1851
+ await s, o.forEach((y) => F.unsubscribe(y)), f && f(), l.clear();
1851
1852
  }
1852
1853
  }
1853
1854
  }
@@ -2051,7 +2052,7 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
2051
2052
  }
2052
2053
  }
2053
2054
  }
2054
- }), Ft = (t) => {
2055
+ }), _t = (t) => {
2055
2056
  switch (t) {
2056
2057
  case "task":
2057
2058
  return "GetDetailsPanelTask";
@@ -2070,7 +2071,7 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
2070
2071
  return { error: P("Entity type not supported", 400) };
2071
2072
  try {
2072
2073
  const i = e.map((c) => n(
2073
- Ke.endpoints[Ft(s)].initiate(
2074
+ Ke.endpoints[_t(s)].initiate(
2074
2075
  {
2075
2076
  projectName: c.projectName,
2076
2077
  entityId: c.id
@@ -2084,13 +2085,13 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
2084
2085
  }
2085
2086
  },
2086
2087
  async onCacheEntryAdded({ entityType: e }, { updateCachedData: s, cacheDataLoaded: n, cacheEntryRemoved: i, dispatch: r, getCacheEntry: a }) {
2087
- let c, d;
2088
- const o = D(
2089
- async (l, p) => {
2088
+ let c, u;
2089
+ const o = $(
2090
+ async (p, l) => {
2090
2091
  const f = a().data ?? [], y = new Set(
2091
2092
  f.map((v) => `${v.projectName}:${v.id}`)
2092
2093
  ), h = /* @__PURE__ */ new Map(), g = [];
2093
- l.forEach(({ topic: v, message: T }) => {
2094
+ p.forEach(({ topic: v, message: T }) => {
2094
2095
  const k = T.summary?.entityId, I = T.project;
2095
2096
  if (!k || !I) return;
2096
2097
  const w = `${I}:${k}`;
@@ -2125,7 +2126,7 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
2125
2126
  m.map(async (v) => {
2126
2127
  try {
2127
2128
  const T = await r(
2128
- Ke.endpoints[Ft(e)].initiate(
2129
+ Ke.endpoints[_t(e)].initiate(
2129
2130
  {
2130
2131
  projectName: v.projectName,
2131
2132
  entityId: v.id
@@ -2142,7 +2143,7 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
2142
2143
  }
2143
2144
  })
2144
2145
  );
2145
- p() && s((v) => {
2146
+ l() && s((v) => {
2146
2147
  b.forEach((T) => {
2147
2148
  if (!T) return;
2148
2149
  const k = v.findIndex(
@@ -2156,10 +2157,10 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
2156
2157
  });
2157
2158
  });
2158
2159
  },
2159
- ({ topic: l, message: p }) => `${p.project}:${p.summary?.entityId}:${l}`
2160
+ ({ topic: p, message: l }) => `${l.project}:${l.summary?.entityId}:${p}`
2160
2161
  );
2161
2162
  try {
2162
- await n, d = H(
2163
+ await n, u = H(
2163
2164
  (f) => {
2164
2165
  const y = a().data ?? [], h = f.filter(
2165
2166
  (g) => y.some(
@@ -2177,13 +2178,13 @@ query EntityTooltip($projectName: String!, $entityId: String!) {
2177
2178
  },
2178
2179
  [e]
2179
2180
  );
2180
- const l = (f, y) => {
2181
+ const p = (f, y) => {
2181
2182
  !y?.project || !y?.summary?.entityId || o.add({ topic: f, message: y });
2182
- }, p = `entity.${e}`;
2183
- c = F.subscribe(p, l);
2183
+ }, l = `entity.${e}`;
2184
+ c = F.subscribe(l, p);
2184
2185
  } catch {
2185
2186
  }
2186
- await i, F.unsubscribe(c), d && d(), o.clear();
2187
+ await i, F.unsubscribe(c), u && u(), o.clear();
2187
2188
  },
2188
2189
  providesTags: (e, s, { entities: n, entityType: i }) => [
2189
2190
  ...n.map(({ id: r }) => ({ id: r, type: "entities" })),
@@ -2301,12 +2302,12 @@ fragment folderTileFragment on FolderNode {
2301
2302
  s += n[i];
2302
2303
  return s;
2303
2304
  };
2304
- function ps(t) {
2305
+ function fs(t) {
2305
2306
  if (typeof t != "object" || t === null)
2306
2307
  return t;
2307
2308
  let e = Object.keys(t);
2308
2309
  if (e.length > 0)
2309
- return ps(t[e[0]]);
2310
+ return fs(t[e[0]]);
2310
2311
  }
2311
2312
  const Wn = (t, e) => {
2312
2313
  if (Array.isArray(e)) {
@@ -2323,7 +2324,7 @@ const Wn = (t, e) => {
2323
2324
  }
2324
2325
  for (const n of s) {
2325
2326
  for (const i in n)
2326
- n[i] && (Array.isArray(n[i]) ? n[i] = n[i][0] : typeof n[i] == "object" && (n[i] = ps(Object.values(n[i])[0])), n.type === "version" && i === "version" && (n[i] = "v" + n[i].toString().padStart(3, "0")));
2327
+ n[i] && (Array.isArray(n[i]) ? n[i] = n[i][0] : typeof n[i] == "object" && (n[i] = fs(Object.values(n[i])[0])), n.type === "version" && i === "version" && (n[i] = "v" + n[i].toString().padStart(3, "0")));
2327
2328
  n.thumbnailEntityType = n.type, n.type === "product" && (n.thumbnailEntityId = n.latestVersion.thumbnailEntityId, n.thumbnailId = n.latestVersion.thumbnailId, n.thumbnailEntityType = "version");
2328
2329
  }
2329
2330
  return s;
@@ -2387,7 +2388,7 @@ const Wn = (t, e) => {
2387
2388
  providesTags: (t, e, { projectName: s }) => [{ type: "project", id: s }]
2388
2389
  }
2389
2390
  }
2390
- }), { useGetProjectQuery: Ha, useListProjectsQuery: Wa, useGetProjectAnatomyQuery: za } = B, _t = 2e3, Rt = R.enhanceEndpoints({
2391
+ }), { useGetProjectQuery: Ha, useListProjectsQuery: Wa, useGetProjectAnatomyQuery: za } = B, Rt = 2e3, Gt = R.enhanceEndpoints({
2391
2392
  endpoints: {
2392
2393
  GetProjects: {
2393
2394
  transformResponse: (t) => ({
@@ -2399,17 +2400,17 @@ const Wn = (t, e) => {
2399
2400
  })
2400
2401
  }
2401
2402
  }
2402
- }), ht = Rt.injectEndpoints({
2403
+ }), ht = Gt.injectEndpoints({
2403
2404
  endpoints: (t) => ({
2404
2405
  getProjectsInfinite: t.infiniteQuery({
2405
2406
  infiniteQueryOptions: {
2406
- initialPageParam: { cursor: "", first: _t },
2407
+ initialPageParam: { cursor: "", first: Rt },
2407
2408
  getNextPageParam: (e) => {
2408
2409
  const { pageInfo: s } = e;
2409
2410
  if (!(!s.hasNextPage || !s.endCursor))
2410
2411
  return {
2411
2412
  cursor: s.endCursor,
2412
- first: _t
2413
+ first: Rt
2413
2414
  };
2414
2415
  }
2415
2416
  },
@@ -2420,7 +2421,7 @@ const Wn = (t, e) => {
2420
2421
  after: s?.cursor || void 0,
2421
2422
  first: s?.first
2422
2423
  }, r = await n.dispatch(
2423
- Rt.endpoints.GetProjects.initiate(i, { forceRefetch: !0 })
2424
+ Gt.endpoints.GetProjects.initiate(i, { forceRefetch: !0 })
2424
2425
  );
2425
2426
  if (r.error) throw r.error;
2426
2427
  return {
@@ -2511,7 +2512,7 @@ const Wn = (t, e) => {
2511
2512
  s(
2512
2513
  ht.util.updateQueryData("getProjectsInfinite", {}, (r) => {
2513
2514
  for (const a of r.pages) {
2514
- const c = a.projects.find((d) => d.name === t);
2515
+ const c = a.projects.find((u) => u.name === t);
2515
2516
  c && Je(c, e);
2516
2517
  }
2517
2518
  })
@@ -2543,10 +2544,10 @@ const Wn = (t, e) => {
2543
2544
  } catch {
2544
2545
  return {};
2545
2546
  }
2546
- }, Yn = (t) => Object.keys(t), Gt = (t) => t.kanban.edges.map(({ node: e }) => e).sort((e, s) => {
2547
+ }, Yn = (t) => Object.keys(t), Ct = (t) => t.kanban.edges.map(({ node: e }) => e).sort((e, s) => {
2547
2548
  const n = e.label || e.name, i = s.label || s.name;
2548
2549
  return n.localeCompare(i);
2549
- }), Ct = (t, e, s) => t?.length ? [
2550
+ }), Nt = (t, e, s) => t?.length ? [
2550
2551
  { type: "kanBanTask", id: "LIST" },
2551
2552
  ...t.flatMap(({ id: n, projectName: i, assignees: r = [] }) => [
2552
2553
  { type: "task", id: n },
@@ -2558,7 +2559,7 @@ const Wn = (t, e) => {
2558
2559
  })),
2559
2560
  { type: "kanban", id: JSON.stringify(s) }
2560
2561
  ])
2561
- ] : [{ type: "kanBanTask", id: "LIST" }], fs = async ({
2562
+ ] : [{ type: "kanBanTask", id: "LIST" }], ys = async ({
2562
2563
  projects: t = [],
2563
2564
  taskIds: e = []
2564
2565
  }, s) => {
@@ -2579,16 +2580,16 @@ const Wn = (t, e) => {
2579
2580
  }, mt = R.enhanceEndpoints({
2580
2581
  endpoints: {
2581
2582
  GetKanban: {
2582
- transformResponse: Gt,
2583
- providesTags: Ct,
2583
+ transformResponse: Ct,
2584
+ providesTags: Nt,
2584
2585
  async onCacheEntryAdded(t = {}, { updateCachedData: e, cacheDataLoaded: s, cacheEntryRemoved: n, dispatch: i, getCacheEntry: r }) {
2585
2586
  let a, c;
2586
- const u = D(
2587
- async (o, l) => {
2588
- const p = Array.isArray(t?.projects) ? t.projects : [], f = Array.isArray(t?.assignees) ? t.assignees : [], y = r().data ?? [], h = new Set(y.map((I) => `${I.projectName}:${I.id}`)), g = /* @__PURE__ */ new Map(), m = [];
2587
+ const d = $(
2588
+ async (o, p) => {
2589
+ const l = Array.isArray(t?.projects) ? t.projects : [], f = Array.isArray(t?.assignees) ? t.assignees : [], y = r().data ?? [], h = new Set(y.map((I) => `${I.projectName}:${I.id}`)), g = /* @__PURE__ */ new Map(), m = [];
2589
2590
  o.forEach(({ topic: I, message: w }) => {
2590
2591
  const E = w.project;
2591
- if (!E || !p.includes(E)) return;
2592
+ if (!E || !l.includes(E)) return;
2592
2593
  const A = w.summary?.entityId;
2593
2594
  if (!A) return;
2594
2595
  const L = I.split(".")[2]?.replace("_changed", ""), S = fe(
@@ -2597,7 +2598,7 @@ const Wn = (t, e) => {
2597
2598
  Ve
2598
2599
  );
2599
2600
  if (!S) return;
2600
- const j = `${E}:${A}`, _ = h.has(j), C = S.value, W = S.field === "assignees" && C.some(($) => f.includes($));
2601
+ const j = `${E}:${A}`, _ = h.has(j), C = S.value, W = S.field === "assignees" && C.some((x) => f.includes(x));
2601
2602
  if (!(!_ && !W)) {
2602
2603
  if (!_) {
2603
2604
  g.set(j, { taskId: A, project: E });
@@ -2624,14 +2625,14 @@ const Wn = (t, e) => {
2624
2625
  const b = Array.from(g.values());
2625
2626
  if (!b.length || b.length > re) return;
2626
2627
  await K();
2627
- const v = await fs(
2628
+ const v = await ys(
2628
2629
  {
2629
2630
  projects: [...new Set(b.map(({ project: I }) => I))],
2630
2631
  taskIds: [...new Set(b.map(({ taskId: I }) => I))]
2631
2632
  },
2632
2633
  i
2633
2634
  );
2634
- if (!l()) return;
2635
+ if (!p()) return;
2635
2636
  const T = v.filter(
2636
2637
  (I) => !f.length || (I.assignees ?? []).some((w) => f.includes(w))
2637
2638
  ), k = v.filter(
@@ -2647,15 +2648,15 @@ const Wn = (t, e) => {
2647
2648
  });
2648
2649
  });
2649
2650
  },
2650
- ({ topic: o, message: l }) => `${l.project ?? ""}:${l.summary?.entityId}:${o}`
2651
+ ({ topic: o, message: p }) => `${p.project ?? ""}:${p.summary?.entityId}:${o}`
2651
2652
  );
2652
2653
  try {
2653
2654
  await s, c = H(
2654
- (l) => {
2655
- const p = r().data ?? [];
2656
- if (!p.length) return;
2657
- const f = l.filter(
2658
- (y) => p.some((h) => h.id === y.summary.entityId && h.projectName === y.project)
2655
+ (p) => {
2656
+ const l = r().data ?? [];
2657
+ if (!l.length) return;
2658
+ const f = p.filter(
2659
+ (y) => l.some((h) => h.id === y.summary.entityId && h.projectName === y.project)
2659
2660
  );
2660
2661
  f.length !== 0 && e((y) => {
2661
2662
  f.forEach((h) => {
@@ -2666,14 +2667,14 @@ const Wn = (t, e) => {
2666
2667
  },
2667
2668
  ["task"]
2668
2669
  );
2669
- const o = (l, p) => {
2670
- p?.summary?.entityId && u.add({ topic: l, message: p });
2670
+ const o = (p, l) => {
2671
+ l?.summary?.entityId && d.add({ topic: p, message: l });
2671
2672
  };
2672
2673
  a = F.subscribe("entity.task", o);
2673
2674
  } catch (o) {
2674
2675
  console.error(o);
2675
2676
  }
2676
- await n, F.unsubscribe(a), c && c(), u.clear();
2677
+ await n, F.unsubscribe(a), c && c(), d.clear();
2677
2678
  }
2678
2679
  // // there is only one cache for kanban
2679
2680
  // serializeQueryArgs: () => '',
@@ -2690,8 +2691,8 @@ const Wn = (t, e) => {
2690
2691
  // same query as GetKanban but for specific tasks
2691
2692
  // used mainly for patching tasks into the kanban cache
2692
2693
  GetKanbanTasks: {
2693
- transformResponse: Gt,
2694
- providesTags: Ct
2694
+ transformResponse: Ct,
2695
+ providesTags: Nt
2695
2696
  },
2696
2697
  // get all users on all selected projects
2697
2698
  GetKanbanProjectUsers: {
@@ -2728,10 +2729,10 @@ const Wn = (t, e) => {
2728
2729
  B.endpoints.getProjectAnatomy.initiate({ projectName: a })
2729
2730
  ).unwrap()
2730
2731
  ] : []
2731
- ], d = await Promise.allSettled(c), u = d[0], o = u.status === "fulfilled" ? u.value : void 0, l = s && d[1]?.status === "fulfilled" ? d[1].value : void 0;
2732
+ ], u = await Promise.allSettled(c), d = u[0], o = d.status === "fulfilled" ? d.value : void 0, p = s && u[1]?.status === "fulfilled" ? u[1].value : void 0;
2732
2733
  o && (i[a] = {
2733
2734
  ...o,
2734
- anatomy: l
2735
+ anatomy: p
2735
2736
  });
2736
2737
  }
2737
2738
  return { data: i, meta: void 0, error: void 0 };
@@ -2789,7 +2790,7 @@ const Wn = (t, e) => {
2789
2790
  ...s
2790
2791
  };
2791
2792
  }
2792
- }, ys = (t = [], e) => {
2793
+ }, gs = (t = [], e) => {
2793
2794
  const s = t.find((c) => c.entityId === e.id), n = s?.data;
2794
2795
  if (!n || s.entityType === "product" || s.entityType === "workfile")
2795
2796
  return console.warn("No operation data found or entity type not supported");
@@ -2799,8 +2800,8 @@ const Wn = (t, e) => {
2799
2800
  c[c.length - 1] = n.name, i.path = c.join("/");
2800
2801
  }
2801
2802
  function r(c) {
2802
- Object.entries(c).forEach(([d, u]) => {
2803
- u === void 0 ? delete c[d] : u !== null && typeof u == "object" && r(u);
2803
+ Object.entries(c).forEach(([u, d]) => {
2804
+ d === void 0 ? delete c[u] : d !== null && typeof d == "object" && r(d);
2804
2805
  });
2805
2806
  }
2806
2807
  r(i);
@@ -2825,23 +2826,23 @@ const Wn = (t, e) => {
2825
2826
  }
2826
2827
  };
2827
2828
  Object.assign(e, a);
2828
- }, gs = (t, {
2829
+ }, hs = (t, {
2829
2830
  state: e,
2830
2831
  dispatch: s
2831
2832
  }, n) => {
2832
2833
  const i = t.map((a) => ({
2833
2834
  type: "entities",
2834
2835
  id: a.entityId
2835
- })), r = _s.util.selectInvalidatedBy(e, i);
2836
+ })), r = Rs.util.selectInvalidatedBy(e, i);
2836
2837
  for (const a of r)
2837
2838
  if (a.endpointName === "getEntitiesDetailsPanel") {
2838
2839
  const c = s(
2839
2840
  ue.util.updateQueryData(
2840
2841
  "getEntitiesDetailsPanel",
2841
2842
  a.originalArgs,
2842
- (d) => {
2843
- for (const u of d)
2844
- ys(t, u);
2843
+ (u) => {
2844
+ for (const d of u)
2845
+ gs(t, d);
2845
2846
  }
2846
2847
  )
2847
2848
  );
@@ -2853,14 +2854,14 @@ const Wn = (t, e) => {
2853
2854
  ie.util.updateQueryData(
2854
2855
  "GetKanban",
2855
2856
  { projects: e, assignees: t },
2856
- (u) => {
2857
- const o = u.findIndex((p) => p.id === n);
2858
- let l = { ...i };
2859
- if (i?.attrib?.priority && (l = { ...l, priority: i.attrib.priority }), i?.attrib?.endDate) {
2860
- const { endDate: p, ...f } = i.attrib;
2861
- l = { ...l, attrib: f, dueDate: p };
2857
+ (d) => {
2858
+ const o = d.findIndex((l) => l.id === n);
2859
+ let p = { ...i };
2860
+ if (i?.attrib?.priority && (p = { ...p, priority: i.attrib.priority }), i?.attrib?.endDate) {
2861
+ const { endDate: l, ...f } = i.attrib;
2862
+ p = { ...p, attrib: f, dueDate: l };
2862
2863
  }
2863
- o === -1 ? r ? u.push(r) : c = !1 : (c = !0, !s?.some((f) => t.includes(f)) && s ? u.splice(o, 1) : Object.assign(u[o], l));
2864
+ o === -1 ? r ? d.push(r) : c = !1 : (c = !0, !s?.some((f) => t.includes(f)) && s ? d.splice(o, 1) : Object.assign(d[o], p));
2864
2865
  }
2865
2866
  )
2866
2867
  ), c];
@@ -2875,30 +2876,30 @@ const Wn = (t, e) => {
2875
2876
  try {
2876
2877
  return r.map(
2877
2878
  (c) => s(
2878
- R.util.updateQueryData("GetTasksProgress", c.originalArgs, (d) => {
2879
- const u = d;
2879
+ R.util.updateQueryData("GetTasksProgress", c.originalArgs, (u) => {
2880
+ const d = u;
2880
2881
  for (const o of t) {
2881
- const l = o.id, p = o.data;
2882
+ const p = o.id, l = o.data;
2882
2883
  if (n === "task") {
2883
- const f = o.meta?.folderId, y = u.find((v) => v.id === f);
2884
+ const f = o.meta?.folderId, y = d.find((v) => v.id === f);
2884
2885
  if (!y) throw new Error("Patching progress view: folder not found");
2885
- const h = y.tasks?.find((v) => v.id === l);
2886
+ const h = y.tasks?.find((v) => v.id === p);
2886
2887
  if (!h) throw new Error("Patching progress view: task not found");
2887
- const g = Object.assign({}, h, p), m = {
2888
+ const g = Object.assign({}, h, l), m = {
2888
2889
  ...y,
2889
- tasks: y.tasks.map((v) => v.id === l ? g : v)
2890
- }, b = u.findIndex((v) => v.id === f);
2891
- u[b] = m;
2890
+ tasks: y.tasks.map((v) => v.id === p ? g : v)
2891
+ }, b = d.findIndex((v) => v.id === f);
2892
+ d[b] = m;
2892
2893
  } else if (n === "folder") {
2893
- const f = u.find((m) => m.id === l);
2894
+ const f = d.find((m) => m.id === p);
2894
2895
  if (!f) throw new Error("Patching progress view: folder not found");
2895
- const y = { ...p };
2896
- if (p.name && f.path) {
2896
+ const y = { ...l };
2897
+ if (l.name && f.path) {
2897
2898
  const m = f.path.split("/");
2898
- m[m.length - 1] = p.name, y.path = m.join("/");
2899
+ m[m.length - 1] = l.name, y.path = m.join("/");
2899
2900
  }
2900
- const h = { ...f, ...y }, g = u.findIndex((m) => m.id === l);
2901
- u[g] = h;
2901
+ const h = { ...f, ...y }, g = d.findIndex((m) => m.id === p);
2902
+ d[g] = h;
2902
2903
  }
2903
2904
  }
2904
2905
  })
@@ -2907,7 +2908,7 @@ const Wn = (t, e) => {
2907
2908
  } catch (a) {
2908
2909
  return console.error(a), s(R.util.invalidateTags(i)), [];
2909
2910
  }
2910
- }, hs = be.injectEndpoints({
2911
+ }, ms = be.injectEndpoints({
2911
2912
  endpoints: (t) => ({
2912
2913
  updateEntity: t.mutation({
2913
2914
  query: ({ projectName: e, entityId: s, data: n, entityType: i }) => ({
@@ -2919,18 +2920,18 @@ const Wn = (t, e) => {
2919
2920
  const r = [];
2920
2921
  return i === "product" && r.push({ type: "product", id: n }), i === "version" && r.push({ type: "version", id: n }), r;
2921
2922
  },
2922
- async onQueryStarted({ projectName: e, entityId: s, data: n, currentAssignees: i = [], entityType: r }, { dispatch: a, queryFulfilled: c, getState: d }) {
2923
- const u = d(), o = [];
2924
- let l = [];
2923
+ async onQueryStarted({ projectName: e, entityId: s, data: n, currentAssignees: i = [], entityType: r }, { dispatch: a, queryFulfilled: c, getState: u }) {
2924
+ const d = u(), o = [];
2925
+ let p = [];
2925
2926
  if (r === "task") {
2926
- const p = d(), f = p.dashboard?.selectedProjects || [], y = p.dashboard?.tasks?.assignees || [], h = p.dashboard?.tasks?.assigneesFilter === "me", g = n.assignees, m = h ? p.user?.name ? [p.user.name] : [] : y, v = [.../* @__PURE__ */ new Set([...i, ...g || []])].some((S) => m.includes(S)), T = f.some((S) => S === e);
2927
+ const l = u(), f = l.dashboard?.selectedProjects || [], y = l.dashboard?.tasks?.assignees || [], h = l.dashboard?.tasks?.assigneesFilter === "me", g = n.assignees, m = h ? l.user?.name ? [l.user.name] : [] : y, v = [.../* @__PURE__ */ new Set([...i, ...g || []])].some((S) => m.includes(S)), T = f.some((S) => S === e);
2927
2928
  if (v && T) {
2928
2929
  const [S, j] = Ye(
2929
2930
  { assignees: m, projects: f },
2930
2931
  { newAssignees: g, taskId: s, data: n },
2931
2932
  { dispatch: a }
2932
2933
  );
2933
- j && o.push(S), j || fs({ projects: [e], taskIds: [s] }, a).then(
2934
+ j && o.push(S), j || ys({ projects: [e], taskIds: [s] }, a).then(
2934
2935
  // use .then so that the rest of the code can run
2935
2936
  (_) => {
2936
2937
  let C = _.find((W) => W.id === s);
@@ -2948,11 +2949,11 @@ const Wn = (t, e) => {
2948
2949
  (N) => !j.has(N)
2949
2950
  ), C = [...j].filter(
2950
2951
  (N) => !S.has(N)
2951
- ), $ = [.../* @__PURE__ */ new Set([..._, ...C])].map((N) => ({
2952
+ ), x = [.../* @__PURE__ */ new Set([..._, ...C])].map((N) => ({
2952
2953
  type: "kanban",
2953
2954
  id: "user-" + N + "-project-" + e
2954
2955
  }));
2955
- I.push(...$), a(
2956
+ I.push(...x), a(
2956
2957
  ie.util.invalidateTags([
2957
2958
  {
2958
2959
  type: "watchers",
@@ -2961,7 +2962,7 @@ const Wn = (t, e) => {
2961
2962
  ])
2962
2963
  );
2963
2964
  }
2964
- const w = ie.util.selectInvalidatedBy(u, I).filter((S) => S.endpointName === "GetKanban");
2965
+ const w = ie.util.selectInvalidatedBy(d, I).filter((S) => S.endpointName === "GetKanban");
2965
2966
  let E = [];
2966
2967
  for (const S of w) {
2967
2968
  const [j, _] = Ye(
@@ -2986,13 +2987,13 @@ const Wn = (t, e) => {
2986
2987
  type: "kanban",
2987
2988
  id: JSON.stringify(S.originalArgs)
2988
2989
  }));
2989
- l.push(...L);
2990
+ p.push(...L);
2990
2991
  }
2991
- gs([{ entityId: s, data: n, entityType: r }], { state: u, dispatch: a }, o);
2992
+ hs([{ entityId: s, data: n, entityType: r }], { state: d, dispatch: a }, o);
2992
2993
  try {
2993
- await c, l.length && a(ie.util.invalidateTags(l));
2994
- } catch (p) {
2995
- os.error(Rs(p) || "Failed to update task"), o.forEach((f) => f?.undo());
2994
+ await c, p.length && a(ie.util.invalidateTags(p));
2995
+ } catch (l) {
2996
+ cs.error(Gs(l) || "Failed to update task"), o.forEach((f) => f?.undo());
2996
2997
  }
2997
2998
  }
2998
2999
  }),
@@ -3000,10 +3001,10 @@ const Wn = (t, e) => {
3000
3001
  async queryFn({ operations: e = [], entityType: s }, { dispatch: n, getState: i }) {
3001
3002
  try {
3002
3003
  const r = i(), a = [];
3003
- for (const { projectName: p, data: f, id: y, currentAssignees: h = [] } of e) {
3004
+ for (const { projectName: l, data: f, id: y, currentAssignees: h = [] } of e) {
3004
3005
  const g = n(
3005
- hs.endpoints.updateEntity.initiate({
3006
- projectName: p,
3006
+ ms.endpoints.updateEntity.initiate({
3007
+ projectName: l,
3007
3008
  entityId: y,
3008
3009
  data: f,
3009
3010
  entityType: s,
@@ -3014,16 +3015,16 @@ const Wn = (t, e) => {
3014
3015
  }
3015
3016
  let c = [];
3016
3017
  (s === "task" || s === "folder") && (c = Xn({ operations: e, state: r, dispatch: n, entityType: s }));
3017
- const d = [], u = e.map((p) => ({ ...p, entityId: p.id }));
3018
- return (s === "task" || s === "folder") && (s === "task" && Se(u, { state: r, dispatch: n }, d), s === "folder" && (xe(u, { state: r, dispatch: n }, d), console.log("invalidate overview folders"), n(be.util.invalidateTags([{ type: "folder", id: "LIST" }])), n(
3018
+ const u = [], d = e.map((l) => ({ ...l, entityId: l.id }));
3019
+ return (s === "task" || s === "folder") && (s === "task" && Se(d, { state: r, dispatch: n }, u), s === "folder" && (xe(d, { state: r, dispatch: n }, u), console.log("invalidate overview folders"), n(be.util.invalidateTags([{ type: "folder", id: "LIST" }])), n(
3019
3020
  be.util.invalidateTags(
3020
- u.map((p) => ({ type: "overviewTask", id: p.entityId }))
3021
+ d.map((l) => ({ type: "overviewTask", id: l.entityId }))
3021
3022
  )
3022
3023
  ))), (await Promise.allSettled(a)).some(
3023
- (p) => p.status === "rejected" || !!p.value.error
3024
+ (l) => l.status === "rejected" || !!l.value.error
3024
3025
  ) ? (n(
3025
- be.util.invalidateTags(e.map((p) => ({ type: "kanBanTask", id: p.id })))
3026
- ), c.forEach((p) => p?.undo()), d.forEach((p) => p?.undo()), { error: P("Failed to update some tasks", 400) }) : { data: e };
3026
+ be.util.invalidateTags(e.map((l) => ({ type: "kanBanTask", id: l.id })))
3027
+ ), c.forEach((l) => l?.undo()), u.forEach((l) => l?.undo()), { error: P("Failed to update some tasks", 400) }) : { data: e };
3027
3028
  } catch (r) {
3028
3029
  return console.error(r), { error: P(r) };
3029
3030
  }
@@ -3031,7 +3032,7 @@ const Wn = (t, e) => {
3031
3032
  invalidatesTags: (e, s, { operations: n, entityType: i }) => {
3032
3033
  const r = n.map((c) => ({ id: c.id, type: "review" })), a = ["status", "attrib", "tags", "assignees", `${i}Type`];
3033
3034
  return n.forEach((c) => {
3034
- c.data && a.some((d) => c.data[d] !== void 0) && r.push({ type: "entityActivities", id: c.id });
3035
+ c.data && a.some((u) => c.data[u] !== void 0) && r.push({ type: "entityActivities", id: c.id });
3035
3036
  }), i === "product" && (r.push({ type: "product", id: "LIST" }, { type: "version", id: "LIST" }), n.forEach((c) => r.push({ type: "product", id: c.id }))), i === "version" && (r.push({ type: "version", id: "LIST" }, { type: "product", id: "LIST" }), n.forEach((c) => r.push({ type: "version", id: c.id })), n.some((c) => !!c.data.status) && (console.log("invalidate version.publish activities"), n.forEach(
3036
3037
  (c) => r.push({ type: "entityActivities", id: `version.publish-${c.id}` })
3037
3038
  ))), r;
@@ -3039,7 +3040,7 @@ const Wn = (t, e) => {
3039
3040
  })
3040
3041
  }),
3041
3042
  overrideExisting: !0
3042
- }), { useUpdateEntitiesMutation: io, useUpdateEntityMutation: ro } = hs, Nt = (t) => [...new Set(t.map((e) => e.entityId).filter(Boolean))], ei = async ({
3043
+ }), { useUpdateEntitiesMutation: io, useUpdateEntityMutation: ro } = ms, Qt = (t) => [...new Set(t.map((e) => e.entityId).filter(Boolean))], ei = async ({
3043
3044
  dispatch: t,
3044
3045
  projectName: e,
3045
3046
  updatedTaskIds: s,
@@ -3052,21 +3053,21 @@ const Wn = (t, e) => {
3052
3053
  };
3053
3054
  n.originalArgs?.filter && (i.filter = n.originalArgs.filter), n.originalArgs?.folderIds && (i.folderIds = n.originalArgs.folderIds);
3054
3055
  const r = await t(
3055
- x.endpoints.GetTasksList.initiate(i, { forceRefetch: !0 })
3056
+ D.endpoints.GetTasksList.initiate(i, { forceRefetch: !0 })
3056
3057
  );
3057
3058
  if (!r.data?.tasks) return null;
3058
- const a = r.data.tasks, c = new Map(a.map((d) => [d.id, d]));
3059
+ const a = r.data.tasks, c = new Map(a.map((u) => [u.id, u]));
3059
3060
  return t(
3060
- x.util.updateQueryData(
3061
+ D.util.updateQueryData(
3061
3062
  "getTasksListInfinite",
3062
3063
  n.originalArgs,
3063
- (d) => {
3064
- for (const u of s) {
3065
- const o = c.get(u);
3066
- for (const l of d.pages) {
3067
- const p = l.tasks.findIndex((f) => f.id === u);
3068
- if (p !== -1) {
3069
- o ? l.tasks[p] = o : l.tasks.splice(p, 1);
3064
+ (u) => {
3065
+ for (const d of s) {
3066
+ const o = c.get(d);
3067
+ for (const p of u.pages) {
3068
+ const l = p.tasks.findIndex((f) => f.id === d);
3069
+ if (l !== -1) {
3070
+ o ? p.tasks[l] = o : p.tasks.splice(l, 1);
3070
3071
  break;
3071
3072
  }
3072
3073
  }
@@ -3084,32 +3085,39 @@ const Wn = (t, e) => {
3084
3085
  cacheEntry: n
3085
3086
  }) => {
3086
3087
  try {
3087
- const i = {
3088
+ const i = () => t(
3089
+ D.util.getRunningQueryThunk(
3090
+ "getOverviewTasksByFolders",
3091
+ n.originalArgs
3092
+ )
3093
+ );
3094
+ await i();
3095
+ const r = {
3088
3096
  projectName: e,
3089
3097
  taskIds: s
3090
3098
  };
3091
- n.originalArgs?.filter && (i.filter = n.originalArgs.filter), n.originalArgs?.parentIds && (i.parentIds = n.originalArgs.parentIds);
3092
- const r = await t(
3093
- x.endpoints.GetTasksList.initiate(i, { forceRefetch: !0 })
3099
+ n.originalArgs?.filter && (r.filter = n.originalArgs.filter), n.originalArgs?.parentIds && (r.parentIds = n.originalArgs.parentIds);
3100
+ const a = await t(
3101
+ D.endpoints.GetTasksList.initiate(r, { forceRefetch: !0 })
3094
3102
  );
3095
- if (!r.data?.tasks) return null;
3096
- const a = r.data.tasks, c = new Map(a.map((d) => [d.id, d]));
3097
- return t(
3098
- x.util.updateQueryData(
3103
+ if (!a.data?.tasks) return null;
3104
+ const c = a.data.tasks, u = new Map(c.map((d) => [d.id, d]));
3105
+ return await i(), t(
3106
+ D.util.updateQueryData(
3099
3107
  "getOverviewTasksByFolders",
3100
3108
  n.originalArgs,
3101
3109
  (d) => {
3102
- for (const u of s) {
3103
- const o = c.get(u), l = d.findIndex((p) => p.id === u);
3104
- l !== -1 && (o ? d[l] = o : d.splice(l, 1));
3110
+ for (const o of s) {
3111
+ const p = u.get(o), l = d.findIndex((f) => f.id === o);
3112
+ l !== -1 && (p ? d[l] = p : d.splice(l, 1));
3105
3113
  }
3106
3114
  }
3107
3115
  )
3108
- ), a;
3116
+ ), c;
3109
3117
  } catch (i) {
3110
3118
  return console.error("Background overview tasks refetch failed:", i), null;
3111
3119
  }
3112
- }, Qt = (t) => [
3120
+ }, Mt = (t) => [
3113
3121
  { type: "version", id: "LIST" },
3114
3122
  ...t.map((e) => ({ type: "version", id: e.entityId }))
3115
3123
  ], _e = (t, e) => {
@@ -3120,24 +3128,24 @@ const Wn = (t, e) => {
3120
3128
  ...s.attrib,
3121
3129
  ...e.attrib
3122
3130
  }), s;
3123
- }, ms = (t, e) => {
3131
+ }, vs = (t, e) => {
3124
3132
  e.data && (Object.entries(e.data).forEach(([s, n]) => {
3125
3133
  s !== "attrib" && (t[s] = n);
3126
3134
  }), e.data.attrib && (t.attrib = { ...t.attrib, ...e.data.attrib }));
3127
- }, Mt = (t, e) => {
3135
+ }, Vt = (t, e) => {
3128
3136
  t.forEach((s) => {
3129
3137
  [s.task, s.product, s.product?.folder].forEach((i) => {
3130
3138
  if (!i) return;
3131
3139
  const r = e.get(i.id);
3132
- r && ms(i, r);
3140
+ r && vs(i, r);
3133
3141
  });
3134
3142
  });
3135
- }, Vt = (t, e) => {
3143
+ }, Ot = (t, e) => {
3136
3144
  t.forEach((s) => {
3137
3145
  const n = s.folder;
3138
3146
  if (!n) return;
3139
3147
  const i = e.get(n.id);
3140
- i && ms(n, i);
3148
+ i && vs(n, i);
3141
3149
  });
3142
3150
  }, si = (t, {
3143
3151
  state: e,
@@ -3159,9 +3167,9 @@ const Wn = (t, e) => {
3159
3167
  Q.util.updateQueryData(
3160
3168
  a.endpointName,
3161
3169
  a.originalArgs,
3162
- (d) => {
3163
- for (const u of d.pages)
3164
- Mt(u.versions, i);
3170
+ (u) => {
3171
+ for (const d of u.pages)
3172
+ Vt(d.versions, i);
3165
3173
  }
3166
3174
  )
3167
3175
  );
@@ -3171,9 +3179,9 @@ const Wn = (t, e) => {
3171
3179
  Q.util.updateQueryData(
3172
3180
  a.endpointName,
3173
3181
  a.originalArgs,
3174
- (d) => {
3175
- for (const u of d.pages)
3176
- Vt(u.products, i);
3182
+ (u) => {
3183
+ for (const d of u.pages)
3184
+ Ot(d.products, i);
3177
3185
  }
3178
3186
  )
3179
3187
  );
@@ -3183,7 +3191,7 @@ const Wn = (t, e) => {
3183
3191
  Q.util.updateQueryData(
3184
3192
  a.endpointName,
3185
3193
  a.originalArgs,
3186
- (d) => Mt(d.versions, i)
3194
+ (u) => Vt(u.versions, i)
3187
3195
  )
3188
3196
  );
3189
3197
  n?.push(c);
@@ -3192,7 +3200,7 @@ const Wn = (t, e) => {
3192
3200
  Q.util.updateQueryData(
3193
3201
  a.endpointName,
3194
3202
  a.originalArgs,
3195
- (d) => Vt(d.products, i)
3203
+ (u) => Ot(u.products, i)
3196
3204
  )
3197
3205
  );
3198
3206
  n?.push(c);
@@ -3202,95 +3210,95 @@ const Wn = (t, e) => {
3202
3210
  dispatch: s
3203
3211
  }, n) => {
3204
3212
  if (!t.length) return;
3205
- const i = Qt(t), r = Q.util.selectInvalidatedBy(e, i), a = new Set(t.filter((d) => d.type === "delete").map((d) => d.entityId));
3206
- for (const d of r)
3207
- if (d.endpointName === "getVersionsInfinite") {
3208
- const u = s(
3213
+ const i = Mt(t), r = Q.util.selectInvalidatedBy(e, i), a = new Set(t.filter((u) => u.type === "delete").map((u) => u.entityId));
3214
+ for (const u of r)
3215
+ if (u.endpointName === "getVersionsInfinite") {
3216
+ const d = s(
3209
3217
  Q.util.updateQueryData(
3210
3218
  "getVersionsInfinite",
3211
- d.originalArgs,
3219
+ u.originalArgs,
3212
3220
  (o) => {
3213
- for (const l of o.pages) {
3214
- for (let p = l.versions.length - 1; p >= 0; p--)
3215
- a.has(l.versions[p].id) && l.versions.splice(p, 1);
3216
- for (let p = 0; p < l.versions.length; p++) {
3217
- const f = l.versions[p], y = t.find(
3221
+ for (const p of o.pages) {
3222
+ for (let l = p.versions.length - 1; l >= 0; l--)
3223
+ a.has(p.versions[l].id) && p.versions.splice(l, 1);
3224
+ for (let l = 0; l < p.versions.length; l++) {
3225
+ const f = p.versions[l], y = t.find(
3218
3226
  (h) => h.entityId === f.id && h.type !== "delete"
3219
3227
  );
3220
- y?.data && (l.versions[p] = _e(f, y.data));
3228
+ y?.data && (p.versions[l] = _e(f, y.data));
3221
3229
  }
3222
3230
  }
3223
3231
  }
3224
3232
  )
3225
3233
  );
3226
- n?.push(u);
3227
- } else if (d.endpointName === "getVersionsByProducts") {
3228
- const u = s(
3234
+ n?.push(d);
3235
+ } else if (u.endpointName === "getVersionsByProducts") {
3236
+ const d = s(
3229
3237
  Q.util.updateQueryData(
3230
3238
  "getVersionsByProducts",
3231
- d.originalArgs,
3239
+ u.originalArgs,
3232
3240
  (o) => {
3233
- for (let l = o.versions.length - 1; l >= 0; l--)
3234
- a.has(o.versions[l].id) && o.versions.splice(l, 1);
3235
- for (let l = 0; l < o.versions.length; l++) {
3236
- const p = o.versions[l], f = t.find(
3237
- (y) => y.entityId === p.id && y.type !== "delete"
3241
+ for (let p = o.versions.length - 1; p >= 0; p--)
3242
+ a.has(o.versions[p].id) && o.versions.splice(p, 1);
3243
+ for (let p = 0; p < o.versions.length; p++) {
3244
+ const l = o.versions[p], f = t.find(
3245
+ (y) => y.entityId === l.id && y.type !== "delete"
3238
3246
  );
3239
- f?.data && (o.versions[l] = _e(p, f.data));
3247
+ f?.data && (o.versions[p] = _e(l, f.data));
3240
3248
  }
3241
3249
  }
3242
3250
  )
3243
3251
  );
3244
- n?.push(u);
3245
- } else if (d.endpointName === "getProductsInfinite") {
3246
- const u = s(
3252
+ n?.push(d);
3253
+ } else if (u.endpointName === "getProductsInfinite") {
3254
+ const d = s(
3247
3255
  Q.util.updateQueryData(
3248
3256
  "getProductsInfinite",
3249
- d.originalArgs,
3257
+ u.originalArgs,
3250
3258
  (o) => {
3251
- for (const l of o.pages)
3252
- for (const p of l.products)
3253
- if (p.featuredVersion)
3254
- if (a.has(p.featuredVersion.id))
3255
- p.featuredVersion = null;
3259
+ for (const p of o.pages)
3260
+ for (const l of p.products)
3261
+ if (l.featuredVersion)
3262
+ if (a.has(l.featuredVersion.id))
3263
+ l.featuredVersion = null;
3256
3264
  else {
3257
3265
  const f = t.find(
3258
- (y) => y.entityId === p.featuredVersion.id && y.type !== "delete"
3266
+ (y) => y.entityId === l.featuredVersion.id && y.type !== "delete"
3259
3267
  );
3260
- f?.data && (p.featuredVersion = _e(
3261
- p.featuredVersion,
3268
+ f?.data && (l.featuredVersion = _e(
3269
+ l.featuredVersion,
3262
3270
  f.data
3263
3271
  ));
3264
3272
  }
3265
3273
  }
3266
3274
  )
3267
3275
  );
3268
- n?.push(u);
3269
- } else if (d.endpointName === "getGroupedVersionsList") {
3270
- const u = s(
3276
+ n?.push(d);
3277
+ } else if (u.endpointName === "getGroupedVersionsList") {
3278
+ const d = s(
3271
3279
  Q.util.updateQueryData(
3272
3280
  "getGroupedVersionsList",
3273
- d.originalArgs,
3281
+ u.originalArgs,
3274
3282
  (o) => {
3275
- for (let l = o.versions.length - 1; l >= 0; l--)
3276
- a.has(o.versions[l].id) && o.versions.splice(l, 1);
3277
- for (let l = 0; l < o.versions.length; l++) {
3278
- const p = o.versions[l], f = t.find(
3279
- (y) => y.entityId === p.id && y.type !== "delete"
3283
+ for (let p = o.versions.length - 1; p >= 0; p--)
3284
+ a.has(o.versions[p].id) && o.versions.splice(p, 1);
3285
+ for (let p = 0; p < o.versions.length; p++) {
3286
+ const l = o.versions[p], f = t.find(
3287
+ (y) => y.entityId === l.id && y.type !== "delete"
3280
3288
  );
3281
3289
  if (f?.data) {
3282
- const y = p.groups;
3283
- o.versions[l] = _e(p, f.data), o.versions[l].groups = y;
3290
+ const y = l.groups;
3291
+ o.versions[p] = _e(l, f.data), o.versions[p].groups = y;
3284
3292
  }
3285
3293
  }
3286
3294
  }
3287
3295
  )
3288
3296
  );
3289
- n?.push(u);
3297
+ n?.push(d);
3290
3298
  }
3291
- const c = t.filter((d) => d.type !== "delete");
3292
- c.length > 0 && s(Q.util.invalidateTags(Qt(c)));
3293
- }, Ot = (t) => [
3299
+ const c = t.filter((u) => u.type !== "delete");
3300
+ c.length > 0 && s(Q.util.invalidateTags(Mt(c)));
3301
+ }, Dt = (t) => [
3294
3302
  { type: "product", id: "LIST" },
3295
3303
  ...t.map((e) => ({ type: "product", id: e.entityId }))
3296
3304
  ], ii = (t, e) => {
@@ -3306,57 +3314,57 @@ const Wn = (t, e) => {
3306
3314
  dispatch: s
3307
3315
  }, n) => {
3308
3316
  if (!t.length) return;
3309
- const i = Ot(t), r = Q.util.selectInvalidatedBy(e, i), a = new Set(t.filter((u) => u.type === "delete").map((u) => u.entityId)), c = (u) => {
3310
- for (let o = u.length - 1; o >= 0; o--)
3311
- a.has(u[o].product?.id) && u.splice(o, 1);
3317
+ const i = Dt(t), r = Q.util.selectInvalidatedBy(e, i), a = new Set(t.filter((d) => d.type === "delete").map((d) => d.entityId)), c = (d) => {
3318
+ for (let o = d.length - 1; o >= 0; o--)
3319
+ a.has(d[o].product?.id) && d.splice(o, 1);
3312
3320
  };
3313
- for (const u of r)
3314
- if (u.endpointName === "getProductsInfinite") {
3321
+ for (const d of r)
3322
+ if (d.endpointName === "getProductsInfinite") {
3315
3323
  const o = s(
3316
3324
  Q.util.updateQueryData(
3317
3325
  "getProductsInfinite",
3318
- u.originalArgs,
3319
- (l) => {
3320
- for (const p of l.pages) {
3321
- for (let f = p.products.length - 1; f >= 0; f--)
3322
- a.has(p.products[f].id) && p.products.splice(f, 1);
3323
- for (let f = 0; f < p.products.length; f++) {
3324
- const y = p.products[f], h = t.find(
3326
+ d.originalArgs,
3327
+ (p) => {
3328
+ for (const l of p.pages) {
3329
+ for (let f = l.products.length - 1; f >= 0; f--)
3330
+ a.has(l.products[f].id) && l.products.splice(f, 1);
3331
+ for (let f = 0; f < l.products.length; f++) {
3332
+ const y = l.products[f], h = t.find(
3325
3333
  (g) => g.entityId === y.id && g.type !== "delete"
3326
3334
  );
3327
- h?.data && (p.products[f] = ii(y, h.data));
3335
+ h?.data && (l.products[f] = ii(y, h.data));
3328
3336
  }
3329
3337
  }
3330
3338
  }
3331
3339
  )
3332
3340
  );
3333
3341
  n?.push(o);
3334
- } else if (a.size > 0 && u.endpointName === "getVersionsInfinite") {
3342
+ } else if (a.size > 0 && d.endpointName === "getVersionsInfinite") {
3335
3343
  const o = s(
3336
3344
  Q.util.updateQueryData(
3337
3345
  "getVersionsInfinite",
3338
- u.originalArgs,
3339
- (l) => {
3340
- for (const p of l.pages)
3341
- c(p.versions);
3346
+ d.originalArgs,
3347
+ (p) => {
3348
+ for (const l of p.pages)
3349
+ c(l.versions);
3342
3350
  }
3343
3351
  )
3344
3352
  );
3345
3353
  n?.push(o);
3346
- } else if (a.size > 0 && (u.endpointName === "getVersionsByProducts" || u.endpointName === "getGroupedVersionsList")) {
3354
+ } else if (a.size > 0 && (d.endpointName === "getVersionsByProducts" || d.endpointName === "getGroupedVersionsList")) {
3347
3355
  const o = s(
3348
3356
  Q.util.updateQueryData(
3349
- u.endpointName,
3350
- u.originalArgs,
3351
- (l) => {
3352
- c(l.versions);
3357
+ d.endpointName,
3358
+ d.originalArgs,
3359
+ (p) => {
3360
+ c(p.versions);
3353
3361
  }
3354
3362
  )
3355
3363
  );
3356
3364
  n?.push(o);
3357
3365
  }
3358
- const d = t.filter((u) => u.type !== "delete");
3359
- d.length > 0 && s(Q.util.invalidateTags(Ot(d)));
3366
+ const u = t.filter((d) => d.type !== "delete");
3367
+ u.length > 0 && s(Q.util.invalidateTags(Dt(u)));
3360
3368
  }, $e = (t, e) => {
3361
3369
  if (Object.keys(e).forEach((s) => {
3362
3370
  s === "attrib" || s === "links" || s === "deleteLinks" || (t[s] = e[s]);
@@ -3408,59 +3416,59 @@ const Wn = (t, e) => {
3408
3416
  state: e,
3409
3417
  dispatch: s
3410
3418
  }, n) => {
3411
- const i = ai(t), r = x.util.selectInvalidatedBy(e, i), a = new Set(
3412
- t.filter((d) => d.type === "delete" && d.entityId).map((d) => d.entityId)
3413
- ), c = (d) => {
3414
- for (let u = d.length - 1; u >= 0; u--)
3415
- a.has(d[u].id) && d.splice(u, 1);
3419
+ const i = ai(t), r = D.util.selectInvalidatedBy(e, i), a = new Set(
3420
+ t.filter((u) => u.type === "delete" && u.entityId).map((u) => u.entityId)
3421
+ ), c = (u) => {
3422
+ for (let d = u.length - 1; d >= 0; d--)
3423
+ a.has(u[d].id) && u.splice(d, 1);
3416
3424
  };
3417
- for (const d of r)
3418
- if (d.endpointName === "getTasksListInfinite") {
3419
- const u = s(
3420
- x.util.updateQueryData("getTasksListInfinite", d.originalArgs, (o) => {
3421
- for (const l of t)
3422
- if (l.type === "create" && l.data)
3423
- o.pages[0].tasks.push(l.data);
3424
- else if (l.type !== "delete")
3425
- for (const p of o.pages) {
3426
- const f = p.tasks.find((y) => y.id === l.entityId);
3427
- f && $e(f, l.data);
3425
+ for (const u of r)
3426
+ if (u.endpointName === "getTasksListInfinite") {
3427
+ const d = s(
3428
+ D.util.updateQueryData("getTasksListInfinite", u.originalArgs, (o) => {
3429
+ for (const p of t)
3430
+ if (p.type === "create" && p.data)
3431
+ o.pages[0].tasks.push(p.data);
3432
+ else if (p.type !== "delete")
3433
+ for (const l of o.pages) {
3434
+ const f = l.tasks.find((y) => y.id === p.entityId);
3435
+ f && $e(f, p.data);
3428
3436
  }
3429
3437
  if (a.size > 0)
3430
- for (const l of o.pages)
3431
- c(l.tasks);
3438
+ for (const p of o.pages)
3439
+ c(p.tasks);
3432
3440
  })
3433
3441
  );
3434
- n?.push(u);
3442
+ n?.push(d);
3435
3443
  } else {
3436
- const u = s(
3437
- x.util.updateQueryData(
3438
- d.endpointName,
3439
- d.originalArgs,
3444
+ const d = s(
3445
+ D.util.updateQueryData(
3446
+ u.endpointName,
3447
+ u.originalArgs,
3440
3448
  (o) => {
3441
- const l = (p) => {
3442
- Array.isArray(o) ? p(o) : o.tasks && Array.isArray(o.tasks) && p(o.tasks);
3449
+ const p = (l) => {
3450
+ Array.isArray(o) ? l(o) : o.tasks && Array.isArray(o.tasks) && l(o.tasks);
3443
3451
  };
3444
- for (const p of t)
3445
- p.type === "create" && p.data && d.originalArgs.parentIds?.includes(p.data.folderId) ? l((f) => {
3446
- f.push(p.data);
3447
- }) : p.type !== "delete" && l((f) => {
3448
- const y = f.find((h) => h.id === p.entityId);
3449
- y && $e(y, p.data);
3452
+ for (const l of t)
3453
+ l.type === "create" && l.data && u.originalArgs.parentIds?.includes(l.data.folderId) ? p((f) => {
3454
+ f.push(l.data);
3455
+ }) : l.type !== "delete" && p((f) => {
3456
+ const y = f.find((h) => h.id === l.entityId);
3457
+ y && $e(y, l.data);
3450
3458
  });
3451
- a.size > 0 && l(c);
3459
+ a.size > 0 && p(c);
3452
3460
  }
3453
3461
  )
3454
3462
  );
3455
- n?.push(u);
3463
+ n?.push(d);
3456
3464
  }
3457
- }, Ze = /* @__PURE__ */ new Map(), Dt = (t, e, s) => {
3465
+ }, Ze = /* @__PURE__ */ new Map(), $t = (t, e, s) => {
3458
3466
  const n = `${e}:${s.join()}`, i = Ze.get(n);
3459
3467
  i && clearTimeout(i), Ze.set(
3460
3468
  n,
3461
3469
  setTimeout(() => {
3462
3470
  Ze.delete(n), t(
3463
- x.util.invalidateTags(s.map((r) => ({ type: r, id: e })))
3471
+ D.util.invalidateTags(s.map((r) => ({ type: r, id: e })))
3464
3472
  );
3465
3473
  }, 500)
3466
3474
  );
@@ -3476,21 +3484,21 @@ const Wn = (t, e) => {
3476
3484
  De.util.updateQueryData(
3477
3485
  a.endpointName,
3478
3486
  a.originalArgs,
3479
- (d) => {
3480
- const u = /* @__PURE__ */ new Map();
3481
- d.folders.forEach((o) => {
3482
- u.set(o.id, o);
3487
+ (u) => {
3488
+ const d = /* @__PURE__ */ new Map();
3489
+ u.folders.forEach((o) => {
3490
+ d.set(o.id, o);
3483
3491
  });
3484
3492
  for (const o of t)
3485
3493
  if (o.type === "create" && o.data)
3486
- d.folders.push(o.data);
3494
+ u.folders.push(o.data);
3487
3495
  else if (o.type !== "delete") {
3488
- const l = u.get(o.entityId);
3489
- l && $e(l, o.data);
3496
+ const p = d.get(o.entityId);
3497
+ p && $e(p, o.data);
3490
3498
  }
3491
3499
  if (r.size > 0)
3492
- for (let o = d.folders.length - 1; o >= 0; o--)
3493
- r.has(d.folders[o].id) && d.folders.splice(o, 1);
3500
+ for (let o = u.folders.length - 1; o >= 0; o--)
3501
+ r.has(u.folders[o].id) && u.folders.splice(o, 1);
3494
3502
  }
3495
3503
  )
3496
3504
  );
@@ -3505,46 +3513,46 @@ const Wn = (t, e) => {
3505
3513
  );
3506
3514
  for (const c of r)
3507
3515
  if (c.endpointName === "getListItemsInfinite") {
3508
- const d = s(
3516
+ const u = s(
3509
3517
  U.util.updateQueryData(
3510
3518
  "getListItemsInfinite",
3511
3519
  c.originalArgs,
3512
- (u) => {
3520
+ (d) => {
3513
3521
  for (const o of t)
3514
3522
  if (o.type === "update" && o.data)
3515
- for (const l of u.pages) {
3516
- const p = l.items.find((f) => f.entityId === o.entityId);
3517
- if (p) {
3523
+ for (const p of d.pages) {
3524
+ const l = p.items.find((f) => f.entityId === o.entityId);
3525
+ if (l) {
3518
3526
  const { attrib: f, ...y } = o.data;
3519
- $e(p, y), Cn(p, f);
3527
+ $e(l, y), Cn(l, f);
3520
3528
  }
3521
3529
  }
3522
3530
  if (a.size > 0)
3523
- for (const o of u.pages)
3524
- for (let l = o.items.length - 1; l >= 0; l--)
3525
- a.has(o.items[l].entityId) && o.items.splice(l, 1);
3531
+ for (const o of d.pages)
3532
+ for (let p = o.items.length - 1; p >= 0; p--)
3533
+ a.has(o.items[p].entityId) && o.items.splice(p, 1);
3526
3534
  }
3527
3535
  )
3528
3536
  );
3529
- n?.push(d);
3537
+ n?.push(u);
3530
3538
  }
3531
- }, $t = (t) => t.reduce(
3539
+ }, xt = (t) => t.reduce(
3532
3540
  (e, s) => (e[s.type].push(s), e),
3533
3541
  {
3534
3542
  create: [],
3535
3543
  update: [],
3536
3544
  delete: []
3537
3545
  }
3538
- ), xt = Gs.enhanceEndpoints({
3546
+ ), Ut = Cs.enhanceEndpoints({
3539
3547
  endpoints: {
3540
3548
  operations: {}
3541
3549
  }
3542
- }), ui = xt.injectEndpoints({
3550
+ }), ui = Ut.injectEndpoints({
3543
3551
  endpoints: (t) => ({
3544
3552
  updateOverviewEntities: t.mutation({
3545
3553
  async queryFn(e, { dispatch: s }) {
3546
3554
  try {
3547
- const n = await s(xt.endpoints.operations.initiate(e));
3555
+ const n = await s(Ut.endpoints.operations.initiate(e));
3548
3556
  if (n.error)
3549
3557
  return { error: P(n.error) };
3550
3558
  const i = n.data, r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
@@ -3570,7 +3578,7 @@ const Wn = (t, e) => {
3570
3578
  },
3571
3579
  async onQueryStarted({ operationsRequestModel: e, patchOperations: s = [], projectName: n }, { dispatch: i, queryFulfilled: r, getState: a }) {
3572
3580
  if (!e.operations?.length) return;
3573
- const { operations: c } = e, d = c.reduce(
3581
+ const { operations: c } = e, u = c.reduce(
3574
3582
  (b, v) => (b[v.entityType].push(v), b),
3575
3583
  {
3576
3584
  task: [],
@@ -3580,25 +3588,25 @@ const Wn = (t, e) => {
3580
3588
  representation: [],
3581
3589
  workfile: []
3582
3590
  }
3583
- ), u = a(), o = [];
3584
- if (d.task?.length) {
3585
- const { delete: b, update: v } = $t(d.task), T = v.filter(
3591
+ ), d = a(), o = [];
3592
+ if (u.task?.length) {
3593
+ const { delete: b, update: v } = xt(u.task), T = v.filter(
3586
3594
  (k) => !s.some((I) => I.entityId === k.entityId)
3587
3595
  );
3588
- Se([...T, ...b], { state: u, dispatch: i }, o);
3596
+ Se([...T, ...b], { state: d, dispatch: i }, o);
3589
3597
  }
3590
- if (d.folder?.length) {
3591
- const { delete: b, update: v } = $t(d.folder), T = v.filter(
3598
+ if (u.folder?.length) {
3599
+ const { delete: b, update: v } = xt(u.folder), T = v.filter(
3592
3600
  (k) => !s.some((I) => I.entityId === k.entityId)
3593
3601
  );
3594
- xe([...T, ...b], { state: u, dispatch: i }, o);
3602
+ xe([...T, ...b], { state: d, dispatch: i }, o);
3595
3603
  }
3596
- const l = s.filter((b) => b.entityType === "task"), p = s.filter((b) => b.entityType === "folder");
3597
- l.length && Se(l, { state: u, dispatch: i }, o), p.length && xe(p, { state: u, dispatch: i }, o), si(
3604
+ const p = s.filter((b) => b.entityType === "task"), l = s.filter((b) => b.entityType === "folder");
3605
+ p.length && Se(p, { state: d, dispatch: i }, o), l.length && xe(l, { state: d, dispatch: i }, o), si(
3598
3606
  [...c, ...s],
3599
- { state: u, dispatch: i },
3607
+ { state: d, dispatch: i },
3600
3608
  o
3601
- ), di([...c, ...s], { state: u, dispatch: i }, o), d.version?.length && ni(d.version, { state: u, dispatch: i }, o), d.product?.length && ri(d.product, { state: u, dispatch: i }, o);
3609
+ ), di([...c, ...s], { state: d, dispatch: i }, o), u.version?.length && ni(u.version, { state: d, dispatch: i }, o), u.product?.length && ri(u.product, { state: d, dispatch: i }, o);
3602
3610
  const f = c.map((b) => ({
3603
3611
  id: b.entityId,
3604
3612
  type: b.entityType
@@ -3606,10 +3614,10 @@ const Wn = (t, e) => {
3606
3614
  type: "entities",
3607
3615
  id: b.id
3608
3616
  })), h = () => i(ue.util.invalidateTags(y)), g = ue.util.selectInvalidatedBy(
3609
- u,
3617
+ d,
3610
3618
  f
3611
3619
  ), m = ue.util.selectInvalidatedBy(
3612
- u,
3620
+ d,
3613
3621
  y
3614
3622
  );
3615
3623
  for (const b of m) {
@@ -3620,7 +3628,7 @@ const Wn = (t, e) => {
3620
3628
  b.originalArgs,
3621
3629
  (T) => {
3622
3630
  for (const k of T)
3623
- ys(c, k);
3631
+ gs(c, k);
3624
3632
  }
3625
3633
  )
3626
3634
  );
@@ -3628,33 +3636,37 @@ const Wn = (t, e) => {
3628
3636
  }
3629
3637
  try {
3630
3638
  await r;
3631
- const b = d.task || [], v = d.folder || [], T = d.version || [], k = d.product || [];
3632
- if (n && ((b.length || v.length) && Dt(i, n, [
3639
+ const b = u.task || [], v = u.folder || [], T = u.version || [], k = u.product || [];
3640
+ if (n && ((b.length || v.length) && $t(i, n, [
3633
3641
  "folderColumnStats",
3634
3642
  "taskColumnStats",
3635
3643
  "entityListItemsColumnStats"
3636
- ]), (T.length || k.length) && Dt(i, n, [
3644
+ ]), (T.length || k.length) && $t(i, n, [
3637
3645
  "productColumnStats",
3638
3646
  "versionColumnStats",
3639
3647
  "entityListItemsColumnStats"
3640
3648
  ])), b.length === 0 && v.length === 0)
3641
3649
  return;
3642
- const I = Nt(b), w = Nt(v), E = I.map((L) => ({ type: "overviewTask", id: L })), A = x.util.selectInvalidatedBy(u, E).filter((L) => L.endpointName === "getTasksListInfinite");
3650
+ const I = Qt(b), w = Qt(v), E = a(), A = I.map((S) => ({ type: "overviewTask", id: S })), L = new Map(
3651
+ [d, E].flatMap(
3652
+ (S) => D.util.selectInvalidatedBy(S, A)
3653
+ ).filter((S) => S.endpointName === "getTasksListInfinite").map((S) => [S.queryCacheKey, S])
3654
+ );
3643
3655
  if (I.length > 0 && n) {
3644
- for (const S of A)
3656
+ for (const j of L.values())
3645
3657
  await ei({
3646
3658
  dispatch: i,
3647
3659
  projectName: n,
3648
3660
  updatedTaskIds: I,
3649
- cacheEntry: S
3661
+ cacheEntry: j
3650
3662
  });
3651
- const L = x.util.selectInvalidatedBy(u, E).filter((S) => S.endpointName === "getOverviewTasksByFolders");
3652
- for (const S of L)
3663
+ const S = D.util.selectCachedArgsForQuery(a(), "getOverviewTasksByFolders").filter((j) => j.projectName === n);
3664
+ for (const j of S)
3653
3665
  await ti({
3654
3666
  dispatch: i,
3655
3667
  projectName: n,
3656
3668
  updatedTaskIds: I,
3657
- cacheEntry: S
3669
+ cacheEntry: { originalArgs: j }
3658
3670
  });
3659
3671
  }
3660
3672
  w.length > 0 && n && i(De.util.invalidateTags([{ type: "folder", id: "LIST" }]));
@@ -3665,25 +3677,25 @@ const Wn = (t, e) => {
3665
3677
  }
3666
3678
  },
3667
3679
  invalidatesTags: (e, s, { operationsRequestModel: n, projectName: i }) => {
3668
- const r = [{ type: "kanban", id: "project-" + i }], a = [], c = [], d = [], u = [], o = [];
3669
- let l = !1;
3670
- const p = /* @__PURE__ */ new Set();
3680
+ const r = [{ type: "kanban", id: "project-" + i }], a = [], c = [], u = [], d = [], o = [];
3681
+ let p = !1;
3682
+ const l = /* @__PURE__ */ new Set();
3671
3683
  n.operations?.forEach((y) => {
3672
3684
  const { entityId: h } = y;
3673
- h ? (a.push({ type: "progress", id: h }), c.push({ type: "entityListItem", id: h })) : a.push({ type: "progress", id: "LIST" }), y.data?.attrib && (l = !0), y.type === "update" && h && ["status", "attrib", "tags", "assignees", `${y.entityType}Type`].some(
3685
+ h ? (a.push({ type: "progress", id: h }), c.push({ type: "entityListItem", id: h })) : a.push({ type: "progress", id: "LIST" }), y.data?.attrib && (p = !0), y.type === "update" && h && ["status", "attrib", "tags", "assignees", `${y.entityType}Type`].some(
3674
3686
  (g) => y.data?.[g] !== void 0
3675
- ) && o.push({ type: "entityActivities", id: h }), y.type === "delete" && h && (p.add(y.entityType), u.push({ type: y.entityType, id: h }), u.push({ type: "entities", id: h }));
3676
- }), l && d.push({ type: "tasksFolder", id: i });
3687
+ ) && o.push({ type: "entityActivities", id: h }), y.type === "delete" && h && (l.add(y.entityType), d.push({ type: y.entityType, id: h }), d.push({ type: "entities", id: h }));
3688
+ }), p && u.push({ type: "tasksFolder", id: i });
3677
3689
  const f = /* @__PURE__ */ new Set();
3678
- return p.has("folder") && ["folder", "task", "product", "version"].forEach((y) => f.add(y)), p.has("product") && f.add("version"), f.has("folder") && u.push({ type: "folder", id: "LIST" }), f.has("task") && u.push(
3690
+ return l.has("folder") && ["folder", "task", "product", "version"].forEach((y) => f.add(y)), l.has("product") && f.add("version"), f.has("folder") && d.push({ type: "folder", id: "LIST" }), f.has("task") && d.push(
3679
3691
  { type: "overviewTask", id: "LIST" },
3680
3692
  { type: "overviewTask", id: i }
3681
- ), f.has("product") && u.push({ type: "product", id: "LIST" }), f.has("version") && u.push({ type: "version", id: "LIST" }), [
3693
+ ), f.has("product") && d.push({ type: "product", id: "LIST" }), f.has("version") && d.push({ type: "version", id: "LIST" }), [
3682
3694
  ...r,
3683
3695
  ...a,
3684
3696
  ...c,
3685
- ...d,
3686
3697
  ...u,
3698
+ ...d,
3687
3699
  ...o
3688
3700
  ];
3689
3701
  }
@@ -3692,14 +3704,14 @@ const Wn = (t, e) => {
3692
3704
  }), { useUpdateOverviewEntitiesMutation: co } = ui, ot = (t) => {
3693
3705
  if (t)
3694
3706
  return t.label;
3695
- }, Ut = {
3707
+ }, Bt = {
3696
3708
  folder: "GetFoldersLinks",
3697
3709
  task: "GetTasksLinks",
3698
3710
  product: "GetProductsLinks",
3699
3711
  version: "GetVersionsLinks",
3700
3712
  representation: "GetRepresentationsLinks",
3701
3713
  workfile: "GetWorkfilesLinks"
3702
- }, Bt = {
3714
+ }, qt = {
3703
3715
  folder: "folders",
3704
3716
  task: "tasks",
3705
3717
  product: "products",
@@ -3711,10 +3723,10 @@ const Wn = (t, e) => {
3711
3723
  getEntityLinks: t.query({
3712
3724
  queryFn: async ({ projectName: e, entityIds: s, entityType: n }, { getState: i, dispatch: r, queryCacheKey: a, forced: c }) => {
3713
3725
  try {
3714
- const d = i(), u = JSON.stringify({ projectName: e, entityType: n }), l = d.restApi?.queries?.[a || `getEntityLinks(${u})`]?.data || [], p = new Set(l.map((b) => b.id)), f = s.filter((b) => !p?.has(b) || c);
3726
+ const u = i(), d = JSON.stringify({ projectName: e, entityType: n }), p = u.restApi?.queries?.[a || `getEntityLinks(${d})`]?.data || [], l = new Set(p.map((b) => b.id)), f = s.filter((b) => !l?.has(b) || c);
3715
3727
  if (f.length === 0)
3716
- return { data: l };
3717
- const y = Ut[n], h = Bt[n];
3728
+ return { data: p };
3729
+ const y = Bt[n], h = qt[n];
3718
3730
  return { data: (await r(
3719
3731
  M.endpoints[y].initiate(
3720
3732
  { projectName: e, entityIds: f },
@@ -3751,8 +3763,8 @@ const Wn = (t, e) => {
3751
3763
  // Flatten the edges structure
3752
3764
  };
3753
3765
  }) || [] };
3754
- } catch (d) {
3755
- return console.error(`Error in getEntityLinks queryFn for ${n}:`, d), os.error(`Error fetching ${n} links`), { error: P(d) };
3766
+ } catch (u) {
3767
+ return console.error(`Error in getEntityLinks queryFn for ${n}:`, u), cs.error(`Error fetching ${n} links`), { error: P(u) };
3756
3768
  }
3757
3769
  },
3758
3770
  // 2. We should not create new caches when the entityIds argument changes.
@@ -3785,19 +3797,19 @@ const Wn = (t, e) => {
3785
3797
  // Subscribe to link.created and link.deleted WebSocket events
3786
3798
  async onCacheEntryAdded({ projectName: e, entityType: s }, { cacheDataLoaded: n, cacheEntryRemoved: i, updateCachedData: r, dispatch: a }) {
3787
3799
  let c;
3788
- const d = D(
3789
- async (u, o) => {
3790
- const l = Ut[s], p = Bt[s];
3800
+ const u = $(
3801
+ async (d, o) => {
3802
+ const p = Bt[s], l = qt[s];
3791
3803
  try {
3792
3804
  await K();
3793
3805
  const f = await a(
3794
- M.endpoints[l].initiate(
3795
- { projectName: e, entityIds: u.map(({ entityId: h }) => h) },
3806
+ M.endpoints[p].initiate(
3807
+ { projectName: e, entityIds: d.map(({ entityId: h }) => h) },
3796
3808
  { forceRefetch: !0 }
3797
3809
  )
3798
3810
  ).unwrap();
3799
3811
  if (!o()) return;
3800
- const y = f.project?.[p]?.edges?.map(({ node: h }) => ({
3812
+ const y = f.project?.[l]?.edges?.map(({ node: h }) => ({
3801
3813
  id: h.id,
3802
3814
  links: h.links.edges?.map((g) => g?.node ? {
3803
3815
  ...g,
@@ -3825,37 +3837,37 @@ const Wn = (t, e) => {
3825
3837
  console.error("Realtime link batch update failed", f);
3826
3838
  }
3827
3839
  },
3828
- ({ entityId: u }) => u
3840
+ ({ entityId: d }) => d
3829
3841
  );
3830
3842
  try {
3831
3843
  await n;
3832
- const u = (o, l) => {
3833
- if (!o.startsWith("link.created") && !o.startsWith("link.deleted") || l?.project !== e) return;
3834
- const p = l?.summary?.inputId, f = l?.summary?.outputId;
3835
- !p && !f || (p && d.add({ entityId: p }), f && d.add({ entityId: f }));
3844
+ const d = (o, p) => {
3845
+ if (!o.startsWith("link.created") && !o.startsWith("link.deleted") || p?.project !== e) return;
3846
+ const l = p?.summary?.inputId, f = p?.summary?.outputId;
3847
+ !l && !f || (l && u.add({ entityId: l }), f && u.add({ entityId: f }));
3836
3848
  };
3837
- c = F.subscribe("link", u);
3849
+ c = F.subscribe("link", d);
3838
3850
  } catch {
3839
3851
  }
3840
- await i, c && F.unsubscribe(c), d.clear();
3852
+ await i, c && F.unsubscribe(c), u.clear();
3841
3853
  }
3842
3854
  })
3843
3855
  })
3844
- }), { useGetEntityLinksQuery: uo } = pe, vs = "version", li = { type: vs, id: "LIST" }, bs = "product", vt = { type: bs, id: "LIST" }, Xe = {
3845
- version: { type: vs, list: li },
3846
- product: { type: bs, list: vt }
3856
+ }), { useGetEntityLinksQuery: uo } = pe, bs = "version", li = { type: bs, id: "LIST" }, Is = "product", vt = { type: Is, id: "LIST" }, Xe = {
3857
+ version: { type: bs, list: li },
3858
+ product: { type: Is, list: vt }
3847
3859
  }, z = (t, e) => t ? [
3848
3860
  ...t.map(
3849
3861
  (s) => ({ type: Xe[e].type, id: s.id })
3850
3862
  ),
3851
3863
  Xe[e].list
3852
- ] : [Xe[e].list], Is = (t) => {
3864
+ ] : [Xe[e].list], Ts = (t) => {
3853
3865
  const e = z(t, "version"), s = z(
3854
3866
  t.map((n) => n.product).filter((n) => !!n),
3855
3867
  "product"
3856
3868
  );
3857
3869
  return [...e, ...s];
3858
- }, Ue = (t) => t ? Is(t.versions) : z(void 0, "version"), pi = (t) => t ? Is(hi(t)) : z(void 0, "version"), fi = (t) => {
3870
+ }, Ue = (t) => t ? Ts(t.versions) : z(void 0, "version"), pi = (t) => t ? Ts(hi(t)) : z(void 0, "version"), fi = (t) => {
3859
3871
  if (!t) return [vt, ...z(void 0, "product")];
3860
3872
  const e = mi(t), s = z(e, "product"), n = z(
3861
3873
  e.map((i) => i.featuredVersion).filter((i) => !!i),
@@ -3874,7 +3886,7 @@ const Wn = (t, e) => {
3874
3886
  for (const { node: s } of t)
3875
3887
  Math.sign(s.version) !== -1 && e.push(s);
3876
3888
  return e;
3877
- }, hi = (t) => t ? t.pages.flatMap((e) => e.versions) : [], mi = (t) => t ? t.pages.flatMap((e) => e.products) : [], Ts = (t) => {
3889
+ }, hi = (t) => t ? t.pages.flatMap((e) => e.versions) : [], mi = (t) => t ? t.pages.flatMap((e) => e.products) : [], ks = (t) => {
3878
3890
  const e = G(t.allAttrib), s = t.task ? {
3879
3891
  ...t.task,
3880
3892
  attrib: G(t.task.allAttrib),
@@ -3893,10 +3905,10 @@ const Wn = (t, e) => {
3893
3905
  task: s,
3894
3906
  product: n
3895
3907
  };
3896
- }, qt = (t) => {
3897
- const e = t.project.versions.pageInfo, n = gi(t.project.versions.edges).map((i) => Ts(i));
3908
+ }, Ht = (t) => {
3909
+ const e = t.project.versions.pageInfo, n = gi(t.project.versions.edges).map((i) => ks(i));
3898
3910
  return { pageInfo: e, versions: n };
3899
- }, vi = (t) => t.featuredVersion ? Ts({
3911
+ }, vi = (t) => t.featuredVersion ? ks({
3900
3912
  ...t.featuredVersion,
3901
3913
  product: {
3902
3914
  id: t.id,
@@ -3912,20 +3924,20 @@ const Wn = (t, e) => {
3912
3924
  const i = n.node, r = G(i.allAttrib), a = {
3913
3925
  ...i.folder,
3914
3926
  attrib: G(i.folder.allAttrib)
3915
- }, c = i.versions.find((u) => Math.sign(u.version) === -1), d = i.versions.filter((u) => Math.sign(u.version) !== -1).map((u) => ({
3916
- ...u,
3917
- heroVersionId: c && u.version === Math.abs(c?.version) ? c.id : void 0
3927
+ }, c = i.versions.find((d) => Math.sign(d.version) === -1), u = i.versions.filter((d) => Math.sign(d.version) !== -1).map((d) => ({
3928
+ ...d,
3929
+ heroVersionId: c && d.version === Math.abs(c?.version) ? c.id : void 0
3918
3930
  }));
3919
3931
  return {
3920
3932
  ...i,
3921
3933
  attrib: r,
3922
3934
  folder: a,
3923
- versions: d,
3935
+ versions: u,
3924
3936
  featuredVersion: vi(i)
3925
3937
  };
3926
3938
  });
3927
3939
  return { pageInfo: e, products: s };
3928
- }, Ht = (t) => {
3940
+ }, Wt = (t) => {
3929
3941
  try {
3930
3942
  const e = t.match(/:\s*({.*})$/);
3931
3943
  if (!e)
@@ -3939,7 +3951,7 @@ const Wn = (t, e) => {
3939
3951
  } catch {
3940
3952
  return t.split(":")[0] || t;
3941
3953
  }
3942
- }, Y = 10;
3954
+ }, Z = 10;
3943
3955
  function Ii(t, e, s, n) {
3944
3956
  for (let i = 0; i < t.length; i++) {
3945
3957
  const r = e[s], a = t[i][s];
@@ -3950,9 +3962,9 @@ function Ii(t, e, s, n) {
3950
3962
  }
3951
3963
  function Ti(t, e, s, n, i, r) {
3952
3964
  for (const a of t) {
3953
- const c = a[n], d = c.findIndex((u) => u.id === e);
3954
- if (d !== -1) {
3955
- s ? c[d] = s : c.splice(d, 1);
3965
+ const c = a[n], u = c.findIndex((d) => d.id === e);
3966
+ if (u !== -1) {
3967
+ s ? c[u] = s : c.splice(u, 1);
3956
3968
  return;
3957
3969
  }
3958
3970
  }
@@ -3961,29 +3973,29 @@ function Ti(t, e, s, n, i, r) {
3961
3973
  a.splice(c, 0, s);
3962
3974
  }
3963
3975
  }
3964
- function Wt(t, e) {
3976
+ function zt(t, e) {
3965
3977
  const s = t.findIndex((n) => n.id === e.id);
3966
3978
  s !== -1 && (t[s] = e);
3967
3979
  }
3968
- const J = R.enhanceEndpoints({
3980
+ const Y = R.enhanceEndpoints({
3969
3981
  endpoints: {
3970
3982
  // used by both stacked and non-stacked views
3971
3983
  GetVersions: {
3972
- transformResponse: qt,
3984
+ transformResponse: Ht,
3973
3985
  providesTags: Ue,
3974
- keepUnusedDataFor: Y
3986
+ keepUnusedDataFor: Z
3975
3987
  },
3976
3988
  // used by getVersionsByProducts only
3977
3989
  GetVersionsByProductId: {
3978
- transformResponse: qt,
3990
+ transformResponse: Ht,
3979
3991
  providesTags: Ue,
3980
- keepUnusedDataFor: Y
3992
+ keepUnusedDataFor: Z
3981
3993
  },
3982
3994
  // used by getProductsInfinite only
3983
3995
  GetProducts: {
3984
3996
  transformResponse: bi,
3985
3997
  providesTags: yi,
3986
- keepUnusedDataFor: Y
3998
+ keepUnusedDataFor: Z
3987
3999
  },
3988
4000
  // footer stats: `targets` excluded from cache key + responses merged,
3989
4001
  // so column toggles reuse cache and only added targets refetch
@@ -3993,7 +4005,7 @@ const J = R.enhanceEndpoints({
3993
4005
  merge: (t, e) => Ae(e, t),
3994
4006
  forceRefetch: ({ currentArg: t, previousArg: e }) => Ee(t, e),
3995
4007
  providesTags: (t, e, { projectName: s }) => [{ type: "productColumnStats", id: s }],
3996
- keepUnusedDataFor: Y
4008
+ keepUnusedDataFor: Z
3997
4009
  },
3998
4010
  GetVersionsColumnStats: {
3999
4011
  transformResponse: (t) => we(t?.project?.versions?.fieldStats ?? []),
@@ -4001,19 +4013,19 @@ const J = R.enhanceEndpoints({
4001
4013
  merge: (t, e) => Ae(e, t),
4002
4014
  forceRefetch: ({ currentArg: t, previousArg: e }) => Ee(t, e),
4003
4015
  providesTags: (t, e, { projectName: s }) => [{ type: "versionColumnStats", id: s }],
4004
- keepUnusedDataFor: Y
4016
+ keepUnusedDataFor: Z
4005
4017
  }
4006
4018
  }
4007
- }), oe = 250, zt = 1e3, ki = 10, wi = ["status", "tags"];
4019
+ }), oe = 250, Kt = 1e3, ki = 10, wi = ["status", "tags"];
4008
4020
  function Re(t, e, s) {
4009
- const i = D(
4021
+ const i = $(
4010
4022
  async (a, c) => {
4011
- const d = [], u = [], o = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set();
4023
+ const u = [], d = [], o = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Set();
4012
4024
  for (const { topic: f, message: y } of a) {
4013
4025
  const h = y.summary?.entityId, g = y.summary?.parentId;
4014
4026
  if (h) {
4015
4027
  if (f === "entity.version.deleted")
4016
- d.push({ entityId: h, parentId: g });
4028
+ u.push({ entityId: h, parentId: g });
4017
4029
  else if (f.startsWith("entity.version.") && f.endsWith("_changed")) {
4018
4030
  if (!s.checkVersionInCache(h, g)) continue;
4019
4031
  const b = f.split(".")[2].split("_changed")[0];
@@ -4023,21 +4035,21 @@ function Re(t, e, s) {
4023
4035
  }
4024
4036
  const v = fe(b, y.summary, wi);
4025
4037
  if (!v) {
4026
- l.add(h);
4038
+ p.add(h);
4027
4039
  continue;
4028
4040
  }
4029
- u.push({ entityId: h, field: v.field, value: v.value, parentId: g });
4041
+ d.push({ entityId: h, field: v.field, value: v.value, parentId: g });
4030
4042
  }
4031
4043
  }
4032
4044
  }
4033
- if (l.size > 0 && l.size <= re && e)
4045
+ if (p.size > 0 && p.size <= re && e)
4034
4046
  try {
4035
4047
  await K();
4036
4048
  const f = await e(
4037
- J.endpoints.GetVersions.initiate({
4049
+ Y.endpoints.GetVersions.initiate({
4038
4050
  ...s.getBaseFilters?.() || {},
4039
4051
  projectName: t,
4040
- versionIds: Array.from(l)
4052
+ versionIds: Array.from(p)
4041
4053
  })
4042
4054
  );
4043
4055
  if (!c()) return;
@@ -4045,12 +4057,12 @@ function Re(t, e, s) {
4045
4057
  } catch (f) {
4046
4058
  console.error("Failed to fetch full version data batch", f);
4047
4059
  }
4048
- const p = [];
4060
+ const l = [];
4049
4061
  if (o.size > 0 && o.size <= re && e)
4050
4062
  try {
4051
4063
  await K();
4052
4064
  const f = Array.from(o), y = await e(
4053
- J.endpoints.GetVersionsAttribs.initiate(
4065
+ Y.endpoints.GetVersionsAttribs.initiate(
4054
4066
  { projectName: t, versionIds: f },
4055
4067
  { forceRefetch: !0 }
4056
4068
  )
@@ -4059,7 +4071,7 @@ function Re(t, e, s) {
4059
4071
  if (y.data?.project?.versions?.edges)
4060
4072
  for (const h of y.data.project.versions.edges) {
4061
4073
  const g = h.node;
4062
- g && p.push({
4074
+ g && l.push({
4063
4075
  entityId: g.id,
4064
4076
  allAttrib: g.allAttrib,
4065
4077
  parsedAttrib: G(g.allAttrib)
@@ -4068,7 +4080,7 @@ function Re(t, e, s) {
4068
4080
  } catch (f) {
4069
4081
  console.error("Failed to fetch patched version attribs", f);
4070
4082
  }
4071
- (d.length > 0 || u.length > 0 || p.length > 0) && s.onBatchUpdate({ deleted: d, patched: u, attribPatched: p });
4083
+ (u.length > 0 || d.length > 0 || l.length > 0) && s.onBatchUpdate({ deleted: u, patched: d, attribPatched: l });
4072
4084
  },
4073
4085
  ({ topic: a, message: c }) => `${c.summary?.entityId}:${c.summary?.parentId ?? ""}:${a}`
4074
4086
  );
@@ -4081,7 +4093,7 @@ function Re(t, e, s) {
4081
4093
  }
4082
4094
  };
4083
4095
  }
4084
- const Q = J.injectEndpoints({
4096
+ const Q = Y.injectEndpoints({
4085
4097
  endpoints: (t) => ({
4086
4098
  // enhance GetVersions with an infinite query
4087
4099
  getVersionsInfinite: t.infiniteQuery(
@@ -4100,17 +4112,17 @@ const Q = J.injectEndpoints({
4100
4112
  },
4101
4113
  queryFn: async ({ queryArg: e, pageParam: s }, n) => {
4102
4114
  try {
4103
- const { sortBy: i, desc: r, folderIds: a, ...c } = e, { cursor: d } = s, u = {
4115
+ const { sortBy: i, desc: r, folderIds: a, ...c } = e, { cursor: u } = s, d = {
4104
4116
  ...c
4105
4117
  };
4106
- i ? (u.sortBy = i, r ? (u.before = d || void 0, u.last = oe) : (u.after = d || void 0, u.first = oe)) : (u.after = d || void 0, u.first = oe), a && a.length && (u.folderIds = a);
4118
+ i ? (d.sortBy = i, r ? (d.before = u || void 0, d.last = oe) : (d.after = u || void 0, d.first = oe)) : (d.after = u || void 0, d.first = oe), a && a.length && (d.folderIds = a);
4107
4119
  const o = await n.dispatch(
4108
- J.endpoints.GetVersions.initiate(u, {
4120
+ Y.endpoints.GetVersions.initiate(d, {
4109
4121
  forceRefetch: !0
4110
4122
  })
4111
4123
  );
4112
4124
  if (o.error) throw o.error;
4113
- const l = {
4125
+ const p = {
4114
4126
  versions: [],
4115
4127
  pageInfo: {
4116
4128
  hasNextPage: !1,
@@ -4120,7 +4132,7 @@ const Q = J.injectEndpoints({
4120
4132
  }
4121
4133
  };
4122
4134
  return {
4123
- data: o.data || l
4135
+ data: o.data || p
4124
4136
  };
4125
4137
  } catch (i) {
4126
4138
  return console.error("Error in getVersionsInfiniteQuery queryFn:", i), { error: P(i) };
@@ -4132,15 +4144,15 @@ const Q = J.injectEndpoints({
4132
4144
  onCacheEntryAdded: async (e, { getCacheEntry: s, updateCachedData: n, cacheEntryRemoved: i, dispatch: r }) => {
4133
4145
  let a;
4134
4146
  a = H(
4135
- (u) => {
4136
- const o = u.filter((l) => l.project === e.projectName);
4137
- o.length && n((l) => {
4138
- o.forEach((p) => {
4139
- p.summary.entityType === "version" && l.pages.forEach((f) => {
4147
+ (d) => {
4148
+ const o = d.filter((p) => p.project === e.projectName);
4149
+ o.length && n((p) => {
4150
+ o.forEach((l) => {
4151
+ l.summary.entityType === "version" && p.pages.forEach((f) => {
4140
4152
  const y = f.versions.findIndex(
4141
- (h) => h.id === p.summary.entityId
4153
+ (h) => h.id === l.summary.entityId
4142
4154
  );
4143
- y !== -1 && (f.versions[y].thumbnailHash = p.summary.thumbnailHash || "");
4155
+ y !== -1 && (f.versions[y].thumbnailHash = l.summary.thumbnailHash || "");
4144
4156
  });
4145
4157
  });
4146
4158
  });
@@ -4161,18 +4173,18 @@ const Q = J.injectEndpoints({
4161
4173
  hasReviewables: e.hasReviewables,
4162
4174
  sortBy: e.sortBy
4163
4175
  }),
4164
- checkVersionInCache: (u) => {
4176
+ checkVersionInCache: (d) => {
4165
4177
  const o = s().data;
4166
4178
  if (!o) return !1;
4167
- for (const l of o.pages || [])
4168
- if (l.versions.some((p) => p.id === u)) return !0;
4179
+ for (const p of o.pages || [])
4180
+ if (p.versions.some((l) => l.id === d)) return !0;
4169
4181
  return !1;
4170
4182
  },
4171
- onBatchUpdate: ({ deleted: u, patched: o, attribPatched: l, fullUpdated: p }) => {
4183
+ onBatchUpdate: ({ deleted: d, patched: o, attribPatched: p, fullUpdated: l }) => {
4172
4184
  n((f) => {
4173
4185
  for (const y of f?.pages || []) {
4174
- if (u)
4175
- for (const { entityId: h } of u) {
4186
+ if (d)
4187
+ for (const { entityId: h } of d) {
4176
4188
  const g = y.versions.findIndex((m) => m.id === h);
4177
4189
  g !== -1 && y.versions.splice(g, 1);
4178
4190
  }
@@ -4181,49 +4193,49 @@ const Q = J.injectEndpoints({
4181
4193
  const b = y.versions.find((v) => v.id === h);
4182
4194
  b && (b[g] = m);
4183
4195
  }
4184
- if (l)
4185
- for (const { entityId: h, allAttrib: g, parsedAttrib: m } of l) {
4196
+ if (p)
4197
+ for (const { entityId: h, allAttrib: g, parsedAttrib: m } of p) {
4186
4198
  const b = y.versions.find((v) => v.id === h);
4187
4199
  b && (b.allAttrib = g, b.attrib = m);
4188
4200
  }
4189
- if (p)
4190
- for (const h of p)
4191
- Wt(y.versions, h);
4201
+ if (l)
4202
+ for (const h of l)
4203
+ zt(y.versions, h);
4192
4204
  }
4193
4205
  });
4194
4206
  }
4195
- }), d = F.subscribe("entity.version", c.handle);
4196
- await i, c.clear(), F.unsubscribe(d), a && a();
4207
+ }), u = F.subscribe("entity.version", c.handle);
4208
+ await i, c.clear(), F.unsubscribe(u), a && a();
4197
4209
  },
4198
- keepUnusedDataFor: Y
4210
+ keepUnusedDataFor: Z
4199
4211
  }
4200
4212
  ),
4201
4213
  // custom query function that fetches versions by multiple parent ids -not infinite and gets 1000 versions max
4202
4214
  getVersionsByProducts: t.query({
4203
4215
  queryFn: async (e, { dispatch: s, forced: n }) => {
4204
- const { productIds: i = [], desc: r, ...a } = e, c = async (p, f) => {
4216
+ const { productIds: i = [], desc: r, ...a } = e, c = async (l, f) => {
4205
4217
  const y = {
4206
4218
  ...a,
4207
- productIds: [p]
4219
+ productIds: [l]
4208
4220
  };
4209
- return r ? (f && (y.before = f), y.last = zt) : (f && (y.after = f), y.first = zt), s(
4210
- J.endpoints.GetVersionsByProductId.initiate(y, {
4221
+ return r ? (f && (y.before = f), y.last = Kt) : (f && (y.after = f), y.first = Kt), s(
4222
+ Y.endpoints.GetVersionsByProductId.initiate(y, {
4211
4223
  forceRefetch: n
4212
4224
  })
4213
4225
  );
4214
- }, d = i.map((p) => c(p)), u = await Promise.allSettled(d), o = [], l = [];
4215
- for (let p = 0; p < u.length; p++) {
4216
- const f = u[p], y = i[p];
4226
+ }, u = i.map((l) => c(l)), d = await Promise.allSettled(u), o = [], p = [];
4227
+ for (let l = 0; l < d.length; l++) {
4228
+ const f = d[l], y = i[l];
4217
4229
  if (f.status === "rejected") {
4218
- console.error(`Error fetching versions for product ${y}:`, f.reason), l.push({ productId: y, error: Ht(f.reason) });
4230
+ console.error(`Error fetching versions for product ${y}:`, f.reason), p.push({ productId: y, error: Wt(f.reason) });
4219
4231
  continue;
4220
4232
  }
4221
4233
  const h = f.value;
4222
4234
  if (h.error) {
4223
- console.error(`Error fetching versions for product ${y}:`, h.error), l.push({
4235
+ console.error(`Error fetching versions for product ${y}:`, h.error), p.push({
4224
4236
  productId: y,
4225
4237
  // @ts-expect-error - message
4226
- error: Ht(h.error?.message || "Unknown error")
4238
+ error: Wt(h.error?.message || "Unknown error")
4227
4239
  });
4228
4240
  continue;
4229
4241
  }
@@ -4238,22 +4250,22 @@ const Q = J.injectEndpoints({
4238
4250
  console.error(
4239
4251
  `Error fetching versions page ${m + 1} for product ${y}:`,
4240
4252
  T.error
4241
- ), l.push({ productId: y, error: T.error });
4253
+ ), p.push({ productId: y, error: T.error });
4242
4254
  break;
4243
4255
  }
4244
4256
  if (!T.data) break;
4245
4257
  o.push(...T.data.versions), g = T.data.pageInfo, m++;
4246
4258
  }
4247
4259
  }
4248
- return l.length > 0 && console.warn(
4249
- `Partial success: ${l.length} of ${i.length} products failed to fetch versions`,
4250
- l
4260
+ return p.length > 0 && console.warn(
4261
+ `Partial success: ${p.length} of ${i.length} products failed to fetch versions`,
4262
+ p
4251
4263
  ), {
4252
4264
  data: {
4253
4265
  versions: o,
4254
4266
  pageInfo: void 0,
4255
4267
  // pageInfo is undefined as we've flattened multiple queries
4256
- errors: l.length > 0 ? l : void 0
4268
+ errors: p.length > 0 ? p : void 0
4257
4269
  }
4258
4270
  };
4259
4271
  },
@@ -4262,13 +4274,13 @@ const Q = J.injectEndpoints({
4262
4274
  onCacheEntryAdded: async (e, { updateCachedData: s, cacheEntryRemoved: n, dispatch: i }) => {
4263
4275
  let r;
4264
4276
  r = H(
4265
- (d) => {
4266
- const u = d.filter((o) => o.project === e.projectName);
4267
- u.length && s((o) => {
4268
- u.forEach((l) => {
4269
- if (l.summary.entityType === "version") {
4270
- const p = o.versions.findIndex((f) => f.id === l.summary.entityId);
4271
- p !== -1 && (o.versions[p].thumbnailHash = l.summary.thumbnailHash || "");
4277
+ (u) => {
4278
+ const d = u.filter((o) => o.project === e.projectName);
4279
+ d.length && s((o) => {
4280
+ d.forEach((p) => {
4281
+ if (p.summary.entityType === "version") {
4282
+ const l = o.versions.findIndex((f) => f.id === p.summary.entityId);
4283
+ l !== -1 && (o.versions[l].thumbnailHash = p.summary.thumbnailHash || "");
4272
4284
  }
4273
4285
  });
4274
4286
  });
@@ -4284,40 +4296,40 @@ const Q = J.injectEndpoints({
4284
4296
  productIds: e.productIds,
4285
4297
  latestPerFolder: e.latestPerFolder
4286
4298
  }),
4287
- checkVersionInCache: (d, u) => {
4288
- if (!u || !e.productIds.includes(u)) return !1;
4299
+ checkVersionInCache: (u, d) => {
4300
+ if (!d || !e.productIds.includes(d)) return !1;
4289
4301
  let o = !1;
4290
- return s((l) => {
4291
- o = l.versions.some((p) => p.id === d);
4302
+ return s((p) => {
4303
+ o = p.versions.some((l) => l.id === u);
4292
4304
  }), o;
4293
4305
  },
4294
- onBatchUpdate: ({ deleted: d, patched: u, attribPatched: o, fullUpdated: l }) => {
4295
- s((p) => {
4296
- if (d)
4297
- for (const { entityId: f } of d) {
4298
- const y = p.versions.findIndex((h) => h.id === f);
4299
- y !== -1 && p.versions.splice(y, 1);
4300
- }
4306
+ onBatchUpdate: ({ deleted: u, patched: d, attribPatched: o, fullUpdated: p }) => {
4307
+ s((l) => {
4301
4308
  if (u)
4302
- for (const { entityId: f, field: y, value: h } of u) {
4303
- const g = p.versions.find((m) => m.id === f);
4309
+ for (const { entityId: f } of u) {
4310
+ const y = l.versions.findIndex((h) => h.id === f);
4311
+ y !== -1 && l.versions.splice(y, 1);
4312
+ }
4313
+ if (d)
4314
+ for (const { entityId: f, field: y, value: h } of d) {
4315
+ const g = l.versions.find((m) => m.id === f);
4304
4316
  g && (g[y] = h);
4305
4317
  }
4306
4318
  if (o)
4307
4319
  for (const { entityId: f, allAttrib: y, parsedAttrib: h } of o) {
4308
- const g = p.versions.find((m) => m.id === f);
4320
+ const g = l.versions.find((m) => m.id === f);
4309
4321
  g && (g.allAttrib = y, g.attrib = h);
4310
4322
  }
4311
- if (l)
4312
- for (const f of l)
4313
- Wt(p.versions, f);
4323
+ if (p)
4324
+ for (const f of p)
4325
+ zt(l.versions, f);
4314
4326
  });
4315
4327
  }
4316
4328
  }), c = F.subscribe("entity.version", a.handle);
4317
4329
  await n, a.clear(), F.unsubscribe(c), r && r();
4318
4330
  },
4319
4331
  providesTags: Ue,
4320
- keepUnusedDataFor: Y
4332
+ keepUnusedDataFor: Z
4321
4333
  }),
4322
4334
  // enhance GetProducts with an infinite query
4323
4335
  getProductsInfinite: t.infiniteQuery(
@@ -4337,15 +4349,15 @@ const Q = J.injectEndpoints({
4337
4349
  queryFn: async ({ queryArg: e, pageParam: s }, n) => {
4338
4350
  let i;
4339
4351
  try {
4340
- const { sortBy: r, desc: a, folderIds: c, ...d } = e, { cursor: u } = s, o = {
4341
- ...d
4352
+ const { sortBy: r, desc: a, folderIds: c, ...u } = e, { cursor: d } = s, o = {
4353
+ ...u
4342
4354
  };
4343
- if (r ? (o.sortBy = r, a ? (o.before = u || void 0, o.last = oe) : (o.after = u || void 0, o.first = oe)) : (o.after = u || void 0, o.first = oe), c && c.length && (o.folderIds = c), i = await n.dispatch(
4344
- J.endpoints.GetProducts.initiate(o, {
4355
+ if (r ? (o.sortBy = r, a ? (o.before = d || void 0, o.last = oe) : (o.after = d || void 0, o.first = oe)) : (o.after = d || void 0, o.first = oe), c && c.length && (o.folderIds = c), i = await n.dispatch(
4356
+ Y.endpoints.GetProducts.initiate(o, {
4345
4357
  forceRefetch: !0
4346
4358
  })
4347
4359
  ), i.error) throw i.error;
4348
- const l = {
4360
+ const p = {
4349
4361
  products: [],
4350
4362
  pageInfo: {
4351
4363
  hasNextPage: !1,
@@ -4355,7 +4367,7 @@ const Q = J.injectEndpoints({
4355
4367
  }
4356
4368
  };
4357
4369
  return {
4358
- data: i.data || l
4370
+ data: i.data || p
4359
4371
  };
4360
4372
  } catch (r) {
4361
4373
  return console.error("Error in getProductsInfiniteQuery queryFn:", r), { error: P(r) };
@@ -4392,7 +4404,7 @@ const Q = J.injectEndpoints({
4392
4404
  folderIds: e.folderIds?.length ? e.folderIds : void 0,
4393
4405
  first: f.length
4394
4406
  }, g = await i(
4395
- J.endpoints.GetProducts.initiate(h, {
4407
+ Y.endpoints.GetProducts.initiate(h, {
4396
4408
  forceRefetch: !0
4397
4409
  })
4398
4410
  );
@@ -4416,12 +4428,12 @@ const Q = J.injectEndpoints({
4416
4428
  v,
4417
4429
  T,
4418
4430
  "products",
4419
- Xs(e.sortBy) || "createdAt",
4431
+ en(e.sortBy) || "createdAt",
4420
4432
  e.desc || !1
4421
4433
  );
4422
4434
  });
4423
4435
  });
4424
- }, d = D(
4436
+ }, u = $(
4425
4437
  async (f, y) => {
4426
4438
  const h = new Set(
4427
4439
  r().data?.pages.flatMap(
@@ -4431,7 +4443,7 @@ const Q = J.injectEndpoints({
4431
4443
  g.length && await c([...new Set(g)], y);
4432
4444
  },
4433
4445
  ({ message: f }) => f.summary?.entityId || f.id
4434
- ), u = Re(e.projectName, i, {
4446
+ ), d = Re(e.projectName, i, {
4435
4447
  getBaseFilters: () => ({
4436
4448
  versionFilter: e.versionFilter,
4437
4449
  productFilter: e.productFilter,
@@ -4456,7 +4468,7 @@ const Q = J.injectEndpoints({
4456
4468
  for (const v of b.products) {
4457
4469
  const T = v.featuredVersion?.id;
4458
4470
  if (T) {
4459
- if (f && f.some((k) => k.entityId === T && k.parentId === v.id) && p.add(v.id), y)
4471
+ if (f && f.some((k) => k.entityId === T && k.parentId === v.id) && l.add(v.id), y)
4460
4472
  for (const { entityId: k, field: I, value: w, parentId: E } of y)
4461
4473
  v.id === E && T === k && v.featuredVersion && (v.featuredVersion[I] = w);
4462
4474
  if (h)
@@ -4468,16 +4480,16 @@ const Q = J.injectEndpoints({
4468
4480
  }
4469
4481
  }
4470
4482
  });
4471
- for (const m of p)
4483
+ for (const m of l)
4472
4484
  c([m], () => !0);
4473
- p.clear();
4485
+ l.clear();
4474
4486
  }
4475
- }), o = F.subscribe("entity.version", u.handle), l = F.subscribe("entity.product", (f, y) => {
4476
- y?.summary?.entityId && d.add({ topic: f, message: y });
4477
- }), p = /* @__PURE__ */ new Set();
4478
- await n, d.clear(), u.clear(), F.unsubscribe(l), F.unsubscribe(o), a && a();
4487
+ }), o = F.subscribe("entity.version", d.handle), p = F.subscribe("entity.product", (f, y) => {
4488
+ y?.summary?.entityId && u.add({ topic: f, message: y });
4489
+ }), l = /* @__PURE__ */ new Set();
4490
+ await n, u.clear(), d.clear(), F.unsubscribe(p), F.unsubscribe(o), a && a();
4479
4491
  },
4480
- keepUnusedDataFor: Y
4492
+ keepUnusedDataFor: Z
4481
4493
  }
4482
4494
  ),
4483
4495
  // Grouped versions query - fetches versions for multiple group filters
@@ -4491,11 +4503,11 @@ const Q = J.injectEndpoints({
4491
4503
  productFilter: r,
4492
4504
  taskFilter: a,
4493
4505
  folderFilter: c,
4494
- representationFilter: d,
4495
- folderIds: u,
4506
+ representationFilter: u,
4507
+ folderIds: d,
4496
4508
  versionIds: o,
4497
- productIds: l,
4498
- desc: p,
4509
+ productIds: p,
4510
+ desc: l,
4499
4511
  sortBy: f,
4500
4512
  featuredOnly: y,
4501
4513
  featuredOnlyEntityType: h,
@@ -4511,13 +4523,13 @@ const Q = J.injectEndpoints({
4511
4523
  productFilter: r,
4512
4524
  taskFilter: a,
4513
4525
  folderFilter: c,
4514
- representationFilter: d,
4526
+ representationFilter: u,
4515
4527
  versionFilter: i,
4516
4528
  // specific group filter
4517
4529
  [n]: I.filter,
4518
- folderIds: u?.length ? u : void 0,
4530
+ folderIds: d?.length ? d : void 0,
4519
4531
  versionIds: o?.length ? o : void 0,
4520
- productIds: l?.length ? l : void 0,
4532
+ productIds: p?.length ? p : void 0,
4521
4533
  sortBy: f,
4522
4534
  featuredOnly: y,
4523
4535
  featuredOnlyEntityType: h,
@@ -4525,9 +4537,9 @@ const Q = J.injectEndpoints({
4525
4537
  hasReviewables: m,
4526
4538
  group: I.value
4527
4539
  };
4528
- p ? E.last = w : E.first = w;
4540
+ l ? E.last = w : E.first = w;
4529
4541
  const A = b.dispatch(
4530
- J.endpoints.GetVersions.initiate(
4542
+ Y.endpoints.GetVersions.initiate(
4531
4543
  E,
4532
4544
  {
4533
4545
  forceRefetch: !0
@@ -4565,13 +4577,13 @@ const Q = J.injectEndpoints({
4565
4577
  onCacheEntryAdded: async (e, { updateCachedData: s, cacheEntryRemoved: n, dispatch: i }) => {
4566
4578
  let r;
4567
4579
  r = H(
4568
- (d) => {
4569
- const u = d.filter((o) => o.project === e.projectName);
4570
- u.length && s((o) => {
4571
- u.forEach((l) => {
4572
- if (l.summary.entityType === "version") {
4573
- const p = o.versions.findIndex((f) => f.id === l.summary.entityId);
4574
- p !== -1 && (o.versions[p].thumbnailHash = l.summary.thumbnailHash || "");
4580
+ (u) => {
4581
+ const d = u.filter((o) => o.project === e.projectName);
4582
+ d.length && s((o) => {
4583
+ d.forEach((p) => {
4584
+ if (p.summary.entityType === "version") {
4585
+ const l = o.versions.findIndex((f) => f.id === p.summary.entityId);
4586
+ l !== -1 && (o.versions[l].thumbnailHash = p.summary.thumbnailHash || "");
4575
4587
  }
4576
4588
  });
4577
4589
  });
@@ -4592,35 +4604,35 @@ const Q = J.injectEndpoints({
4592
4604
  latestPerFolder: e.latestPerFolder,
4593
4605
  hasReviewables: e.hasReviewables
4594
4606
  }),
4595
- checkVersionInCache: (d) => {
4596
- let u = !1;
4607
+ checkVersionInCache: (u) => {
4608
+ let d = !1;
4597
4609
  return s((o) => {
4598
- u = o.versions.some((l) => l.id === d);
4599
- }), u;
4610
+ d = o.versions.some((p) => p.id === u);
4611
+ }), d;
4600
4612
  },
4601
- onBatchUpdate: ({ deleted: d, patched: u, attribPatched: o, fullUpdated: l }) => {
4602
- s((p) => {
4603
- if (d)
4604
- for (const { entityId: f } of d) {
4605
- const y = p.versions.findIndex((h) => h.id === f);
4606
- y !== -1 && p.versions.splice(y, 1);
4607
- }
4613
+ onBatchUpdate: ({ deleted: u, patched: d, attribPatched: o, fullUpdated: p }) => {
4614
+ s((l) => {
4608
4615
  if (u)
4609
- for (const { entityId: f, field: y, value: h } of u) {
4610
- const g = p.versions.find((m) => m.id === f);
4616
+ for (const { entityId: f } of u) {
4617
+ const y = l.versions.findIndex((h) => h.id === f);
4618
+ y !== -1 && l.versions.splice(y, 1);
4619
+ }
4620
+ if (d)
4621
+ for (const { entityId: f, field: y, value: h } of d) {
4622
+ const g = l.versions.find((m) => m.id === f);
4611
4623
  g && (g[y] = h);
4612
4624
  }
4613
4625
  if (o)
4614
4626
  for (const { entityId: f, allAttrib: y, parsedAttrib: h } of o) {
4615
- const g = p.versions.find((m) => m.id === f);
4627
+ const g = l.versions.find((m) => m.id === f);
4616
4628
  g && (g.allAttrib = y, g.attrib = h);
4617
4629
  }
4618
- if (l)
4619
- for (const f of l) {
4620
- const y = p.versions.findIndex((h) => h.id === f.id);
4630
+ if (p)
4631
+ for (const f of p) {
4632
+ const y = l.versions.findIndex((h) => h.id === f.id);
4621
4633
  if (y !== -1) {
4622
- const h = p.versions[y].groups;
4623
- p.versions[y] = { ...f, groups: h };
4634
+ const h = l.versions[y].groups;
4635
+ l.versions[y] = { ...f, groups: h };
4624
4636
  }
4625
4637
  }
4626
4638
  });
@@ -4628,25 +4640,25 @@ const Q = J.injectEndpoints({
4628
4640
  }), c = F.subscribe("entity.version", a.handle);
4629
4641
  await n, a.clear(), F.unsubscribe(c), r && r();
4630
4642
  },
4631
- keepUnusedDataFor: Y
4643
+ keepUnusedDataFor: Z
4632
4644
  })
4633
4645
  })
4634
4646
  }), {
4635
4647
  useGetVersionsQuery: lo,
4636
4648
  useGetProductsColumnStatsQuery: po,
4637
4649
  useGetVersionsColumnStatsQuery: fo
4638
- } = J, {
4650
+ } = Y, {
4639
4651
  useGetVersionsInfiniteInfiniteQuery: yo,
4640
4652
  useGetVersionsByProductsQuery: go,
4641
4653
  useGetProductsInfiniteInfiniteQuery: ho,
4642
4654
  useGetGroupedVersionsListQuery: mo
4643
- } = Q, Kt = 5, ke = (t) => (t || "").replace(/-/g, ""), Ai = (t, e, s) => {
4655
+ } = Q, Jt = 5, ke = (t) => (t || "").replace(/-/g, ""), Ai = (t, e, s) => {
4644
4656
  Array.isArray(t.latestComments) || (t.latestComments = []);
4645
4657
  const n = t.latestComments, i = ke(e.activityId), r = n.findIndex((a) => ke(a.activityId) === i);
4646
- s === "delete" ? r !== -1 && n.splice(r, 1) : s === "update" ? r !== -1 && (n[r].body = e.body) : (r !== -1 && n.splice(r, 1), n.unshift(e), n.length > Kt && n.splice(Kt));
4658
+ s === "delete" ? r !== -1 && n.splice(r, 1) : s === "update" ? r !== -1 && (n[r].body = e.body) : (r !== -1 && n.splice(r, 1), n.unshift(e), n.length > Jt && n.splice(Jt));
4647
4659
  }, Ei = [
4648
4660
  {
4649
- api: x,
4661
+ api: D,
4650
4662
  tag: "overviewTask",
4651
4663
  selectors: {
4652
4664
  getOverviewTasksByFolders: (t) => t ?? [],
@@ -4683,16 +4695,16 @@ const Q = J.injectEndpoints({
4683
4695
  body: i?.body ?? "",
4684
4696
  author: i?.authorName ?? null,
4685
4697
  createdAt: i?.createdAt ?? ""
4686
- }, d = s(), u = ke(r), o = [];
4687
- for (const { api: l, tag: p, selectors: f } of Ei) {
4688
- const y = l.util.selectInvalidatedBy(d, [{ type: p, id: r }]);
4698
+ }, u = s(), d = ke(r), o = [];
4699
+ for (const { api: p, tag: l, selectors: f } of Ei) {
4700
+ const y = p.util.selectInvalidatedBy(u, [{ type: l, id: r }]);
4689
4701
  for (const { endpointName: h, originalArgs: g } of y) {
4690
4702
  const m = f[h];
4691
4703
  m && o.push(
4692
4704
  e(
4693
- l.util.updateQueryData(h, g, (b) => {
4705
+ p.util.updateQueryData(h, g, (b) => {
4694
4706
  for (const v of m(b))
4695
- (ke(v?.id) === u || ke(v?.entityId) === u) && Ai(v, c, n);
4707
+ (ke(v?.id) === d || ke(v?.entityId) === d) && Ai(v, c, n);
4696
4708
  })
4697
4709
  )
4698
4710
  );
@@ -4707,15 +4719,15 @@ const Q = J.injectEndpoints({
4707
4719
  getCacheEntry: r,
4708
4720
  gqlApi: a
4709
4721
  }) => {
4710
- let c, d;
4711
- const u = D(
4712
- async (o, l) => {
4713
- const p = Array.isArray(t.entityIds) ? t.entityIds : [t.entityIds], f = ["origin", "mention", "relation"], y = t.activityTypes, h = Array.isArray(y) ? y : y ? [y] : [], g = [], m = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Set(), v = /* @__PURE__ */ new Set();
4722
+ let c, u;
4723
+ const d = $(
4724
+ async (o, p) => {
4725
+ const l = Array.isArray(t.entityIds) ? t.entityIds : [t.entityIds], f = ["origin", "mention", "relation"], y = t.activityTypes, h = Array.isArray(y) ? y : y ? [y] : [], g = [], m = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Set(), v = /* @__PURE__ */ new Set();
4714
4726
  o.forEach(({ topic: k, message: I }) => {
4715
4727
  const w = I.summary?.activity_id;
4716
4728
  if (!w) return;
4717
4729
  const E = (I.summary?.references || []).filter((L) => f.includes(L.reference_type)).map((L) => L.entity_id);
4718
- if (!(!p.some((L) => E.includes(L)) && p.length > 0)) {
4730
+ if (!(!l.some((L) => E.includes(L)) && l.length > 0)) {
4719
4731
  if (k === "activity.deleted") {
4720
4732
  g.push(w);
4721
4733
  return;
@@ -4744,26 +4756,26 @@ const Q = J.injectEndpoints({
4744
4756
  )
4745
4757
  );
4746
4758
  if ("error" in I && I.error) throw new Error("Failed to fetch activities");
4747
- if (!l()) return;
4759
+ if (!p()) return;
4748
4760
  const w = I.data?.activities || [], E = new Map(
4749
4761
  w.map((A) => [A.activityId, A])
4750
4762
  );
4751
4763
  e((A) => {
4752
4764
  E.forEach((L, S) => {
4753
4765
  const j = [L.activityType];
4754
- if (L.activityType === "comment" && Li(L.body || "") && j.push("checklist"), h.length > 0 && !h.some(($) => j.includes($)))
4766
+ if (L.activityType === "comment" && Li(L.body || "") && j.push("checklist"), h.length > 0 && !h.some((x) => j.includes(x)))
4755
4767
  return;
4756
4768
  let _ = !1;
4757
- if (A.pages?.forEach(($) => {
4758
- const N = $.activities?.findIndex(
4759
- (js) => js.activityId === S
4769
+ if (A.pages?.forEach((x) => {
4770
+ const N = x.activities?.findIndex(
4771
+ (Fs) => Fs.activityId === S
4760
4772
  );
4761
- N !== void 0 && N !== -1 && $.activities && ($.activities[N] = L, _ = !0);
4773
+ N !== void 0 && N !== -1 && x.activities && (x.activities[N] = L, _ = !0);
4762
4774
  }), !_ && m.get(S) === "activity.created" && A.pages?.[0]?.activities?.unshift(L), L.activityType !== "status.change" || L.origin?.type !== "version")
4763
4775
  return;
4764
4776
  const C = L.origin.id, W = L.activityData?.newValue;
4765
- W && A.pages?.forEach(($) => {
4766
- $.activities?.forEach((N) => {
4777
+ W && A.pages?.forEach((x) => {
4778
+ x.activities?.forEach((N) => {
4767
4779
  N.activityType === "version.publish" && N.origin?.id === C && (N.version || (N.version = {}), N.version.status = W);
4768
4780
  });
4769
4781
  });
@@ -4772,7 +4784,7 @@ const Q = J.injectEndpoints({
4772
4784
  } catch (k) {
4773
4785
  console.error("[Activity RT] Error fetching activity data for real-time update:", k), i(
4774
4786
  a.util.invalidateTags(
4775
- [.../* @__PURE__ */ new Set([...p, ...v])].map((I) => ({
4787
+ [.../* @__PURE__ */ new Set([...l, ...v])].map((I) => ({
4776
4788
  type: "entityActivities",
4777
4789
  id: I
4778
4790
  }))
@@ -4780,14 +4792,14 @@ const Q = J.injectEndpoints({
4780
4792
  );
4781
4793
  }
4782
4794
  },
4783
- ({ topic: o, message: l }) => `${o}:${l.summary?.activity_id ?? ""}`,
4795
+ ({ topic: o, message: p }) => `${o}:${p.summary?.activity_id ?? ""}`,
4784
4796
  500
4785
4797
  );
4786
4798
  try {
4787
- await s, d = H(
4788
- (l) => {
4799
+ await s, u = H(
4800
+ (p) => {
4789
4801
  if (!r().data?.pages?.length) return;
4790
- const f = l.reduce((y, h) => (h.summary.entityType === "version" && (y[h.summary.entityId] = h.summary.thumbnailHash || ""), y), {});
4802
+ const f = p.reduce((y, h) => (h.summary.entityType === "version" && (y[h.summary.entityId] = h.summary.thumbnailHash || ""), y), {});
4791
4803
  Object.keys(f).length !== 0 && e((y) => {
4792
4804
  !y || !y.pages || y.pages.forEach((h) => {
4793
4805
  h.activities?.forEach((g) => {
@@ -4798,24 +4810,24 @@ const Q = J.injectEndpoints({
4798
4810
  },
4799
4811
  ["version"]
4800
4812
  );
4801
- const o = (l, p) => {
4802
- if (!p.summary?.activity_id) {
4803
- console.warn("[Activity RT] Activity message missing activity_id", p);
4813
+ const o = (p, l) => {
4814
+ if (!l.summary?.activity_id) {
4815
+ console.warn("[Activity RT] Activity message missing activity_id", l);
4804
4816
  return;
4805
4817
  }
4806
- u.add({ topic: l, message: p });
4818
+ d.add({ topic: p, message: l });
4807
4819
  };
4808
4820
  c = F.subscribe(["activity"], o);
4809
4821
  } catch (o) {
4810
4822
  console.error("[Activity RT] Error in activity real-time handler setup:", o);
4811
4823
  }
4812
- await n, c && F.unsubscribe(c), d && d(), u.clear();
4824
+ await n, c && F.unsubscribe(c), u && u(), d.clear();
4813
4825
  }, et = R.enhanceEndpoints({
4814
4826
  endpoints: {
4815
4827
  // Only used by the infinite query below
4816
4828
  GetActivities: {
4817
4829
  transformResponse: (t) => Tt(t.project.activities.edges, t.project.activities.pageInfo),
4818
- providesTags: us
4830
+ providesTags: ls
4819
4831
  },
4820
4832
  GetActivitiesById: {
4821
4833
  transformResponse: (t) => Tt(t.project.activities.edges, t.project.activities.pageInfo)
@@ -4829,7 +4841,7 @@ const Q = J.injectEndpoints({
4829
4841
  )
4830
4842
  },
4831
4843
  GetEntitiesChecklists: {
4832
- transformResponse: (t) => yn(t),
4844
+ transformResponse: (t) => gn(t),
4833
4845
  providesTags: (t, e, { entityIds: s }) => t ? [
4834
4846
  { type: "activity", id: "LIST" },
4835
4847
  ...t.ids.map((n) => ({ type: "activity", id: "checklist-" + n })),
@@ -4844,18 +4856,18 @@ const Q = J.injectEndpoints({
4844
4856
  providesTags: (t) => t?.length ? [{ type: "user", id: "LIST" }, ...t.map(({ name: e }) => ({ type: "user", id: e }))] : [{ type: "user", id: "LIST" }]
4845
4857
  }
4846
4858
  }
4847
- }), Jt = 30, ge = et.injectEndpoints({
4859
+ }), Yt = 30, ge = et.injectEndpoints({
4848
4860
  endpoints: (t) => ({
4849
4861
  getActivitiesInfinite: t.infiniteQuery({
4850
4862
  infiniteQueryOptions: {
4851
- initialPageParam: { cursor: "", last: Jt },
4863
+ initialPageParam: { cursor: "", last: Yt },
4852
4864
  // Calculate the next page param based on current page response and params
4853
4865
  getNextPageParam: (e) => {
4854
4866
  const s = e.pageInfo;
4855
4867
  if (!(!s.hasPreviousPage || !s.endCursor))
4856
4868
  return {
4857
4869
  cursor: s.endCursor,
4858
- last: Jt
4870
+ last: Yt
4859
4871
  };
4860
4872
  }
4861
4873
  },
@@ -4871,7 +4883,7 @@ const Q = J.injectEndpoints({
4871
4883
  })
4872
4884
  );
4873
4885
  if (c.error) throw c.error;
4874
- const d = {
4886
+ const u = {
4875
4887
  activities: [],
4876
4888
  pageInfo: {
4877
4889
  hasNextPage: !1,
@@ -4881,7 +4893,7 @@ const Q = J.injectEndpoints({
4881
4893
  }
4882
4894
  };
4883
4895
  return {
4884
- data: c.data || d
4896
+ data: c.data || u
4885
4897
  };
4886
4898
  } catch (i) {
4887
4899
  return console.error("Error in getActivitiesInfinite queryFn:", i), { error: P(i) };
@@ -4897,7 +4909,7 @@ const Q = J.injectEndpoints({
4897
4909
  gqlApi: et
4898
4910
  });
4899
4911
  },
4900
- providesTags: us
4912
+ providesTags: ls
4901
4913
  }),
4902
4914
  // get data for a reference tooltip based on type,id and projectName
4903
4915
  getEntityTooltip: t.query({
@@ -4905,12 +4917,12 @@ const Q = J.injectEndpoints({
4905
4917
  url: "/graphql",
4906
4918
  method: "POST",
4907
4919
  body: {
4908
- query: mn(n),
4920
+ query: vn(n),
4909
4921
  variables: { projectName: e, entityId: s }
4910
4922
  }
4911
4923
  }),
4912
- transformResponse: (e, s, { entityType: n }) => fn(e?.data?.project, n),
4913
- providesTags: (e, s, { entityType: n }) => gn([e], "task", n)
4924
+ transformResponse: (e, s, { entityType: n }) => yn(e?.data?.project, n),
4925
+ providesTags: (e, s, { entityType: n }) => hn([e], "task", n)
4914
4926
  })
4915
4927
  }),
4916
4928
  overrideExisting: !0
@@ -4944,12 +4956,12 @@ const Q = J.injectEndpoints({
4944
4956
  !n && t.pages.length > 0 && t.pages[0].activities.unshift(e);
4945
4957
  }
4946
4958
  }, Fi = (t) => t == null ? "" : typeof t == "string" ? t : JSON.stringify(t), tt = async ({ patch: t, entityIds: e = [], filter: s, refs: n = [], ...i }, r, a) => {
4947
- const { dispatch: c, queryFulfilled: d, getState: u } = r, o = n.map((g) => g.id) || [];
4959
+ const { dispatch: c, queryFulfilled: u, getState: d } = r, o = n.map((g) => g.id) || [];
4948
4960
  Fi(s);
4949
- const l = [...e, ...o].map((g) => ({
4961
+ const p = [...e, ...o].map((g) => ({
4950
4962
  type: "entityActivities",
4951
- id: g + "-" + ds(s)
4952
- })), p = u(), f = ge.util.selectInvalidatedBy(p, l);
4963
+ id: g + "-" + us(s)
4964
+ })), l = d(), f = ge.util.selectInvalidatedBy(l, p);
4953
4965
  a !== "delete" && t.data && (t.activityData = { ...t.activityData, ...t.data });
4954
4966
  const y = f.map(
4955
4967
  ({ originalArgs: g }) => c(
@@ -4965,7 +4977,7 @@ const Q = J.injectEndpoints({
4965
4977
  a
4966
4978
  );
4967
4979
  try {
4968
- await d;
4980
+ await u;
4969
4981
  } catch {
4970
4982
  for (const m of [...y, ...h])
4971
4983
  m?.undo();
@@ -5020,23 +5032,23 @@ const Q = J.injectEndpoints({
5020
5032
  useCreateEntityActivityMutation: So,
5021
5033
  useDeleteActivityMutation: Lo,
5022
5034
  useUpdateActivityMutation: Po
5023
- } = _i, Yt = ({ activityId: t, userName: e, reaction: s }, { getState: n, dispatch: i }, r) => {
5035
+ } = _i, Zt = ({ activityId: t, userName: e, reaction: s }, { getState: n, dispatch: i }, r) => {
5024
5036
  const a = [{ type: "activity", id: t }];
5025
- return ge.util.selectInvalidatedBy(n(), a).map((d) => i(
5037
+ return ge.util.selectInvalidatedBy(n(), a).map((u) => i(
5026
5038
  // @ts-ignore
5027
5039
  ge.util.updateQueryData(
5028
5040
  "getActivitiesInfinite",
5029
- d.originalArgs,
5030
- (u) => {
5041
+ u.originalArgs,
5042
+ (d) => {
5031
5043
  console.log("patchActivity", r, t, e, s);
5032
- for (const o of u.pages) {
5033
- const l = o.activities.findIndex(
5044
+ for (const o of d.pages) {
5045
+ const p = o.activities.findIndex(
5034
5046
  // @ts-ignore
5035
- (p) => p.activityId === t
5047
+ (l) => l.activityId === t
5036
5048
  );
5037
- if (l !== -1) {
5038
- if (r === "create" && (o.activities[l].reactions = [
5039
- ...o.activities[l].reactions || [],
5049
+ if (p !== -1) {
5050
+ if (r === "create" && (o.activities[p].reactions = [
5051
+ ...o.activities[p].reactions || [],
5040
5052
  {
5041
5053
  reaction: s,
5042
5054
  userName: e,
@@ -5045,10 +5057,10 @@ const Q = J.injectEndpoints({
5045
5057
  timeStamp: ""
5046
5058
  }
5047
5059
  ]), r === "delete")
5048
- for (const p in o.activities[l].reactions) {
5049
- const f = o.activities[l].reactions[p];
5060
+ for (const l in o.activities[p].reactions) {
5061
+ const f = o.activities[p].reactions[l];
5050
5062
  if (f.userName == e && f.reaction == s) {
5051
- o.activities[l].reactions.splice(p, 1);
5063
+ o.activities[p].reactions.splice(l, 1);
5052
5064
  break;
5053
5065
  }
5054
5066
  }
@@ -5062,7 +5074,7 @@ const Q = J.injectEndpoints({
5062
5074
  endpoints: {
5063
5075
  createReactionToActivity: {
5064
5076
  async onQueryStarted(t, { getState: e, dispatch: s, queryFulfilled: n }) {
5065
- const i = Yt(
5077
+ const i = Zt(
5066
5078
  {
5067
5079
  activityId: t.activityId,
5068
5080
  // @ts-ignore
@@ -5082,7 +5094,7 @@ const Q = J.injectEndpoints({
5082
5094
  },
5083
5095
  deleteReactionToActivity: {
5084
5096
  async onQueryStarted(t, { getState: e, dispatch: s, queryFulfilled: n }) {
5085
- const i = Yt(
5097
+ const i = Zt(
5086
5098
  // @ts-ignore
5087
5099
  { activityId: t.activityId, userName: t.userName, reaction: t.reaction },
5088
5100
  { getState: e, dispatch: s },
@@ -5097,16 +5109,16 @@ const Q = J.injectEndpoints({
5097
5109
  }
5098
5110
  }
5099
5111
  }
5100
- }), { useCreateReactionToActivityMutation: jo, useDeleteReactionToActivityMutation: Fo } = Ri, Zt = Le.enhanceEndpoints({
5112
+ }), { useCreateReactionToActivityMutation: jo, useDeleteReactionToActivityMutation: Fo } = Ri, Xt = Le.enhanceEndpoints({
5101
5113
  endpoints: {
5102
5114
  suggestEntityMention: {}
5103
5115
  }
5104
- }), Gi = Zt.injectEndpoints({
5116
+ }), Gi = Xt.injectEndpoints({
5105
5117
  endpoints: (t) => ({
5106
5118
  getEntityMentions: t.query({
5107
5119
  queryFn: async (e, { dispatch: s }) => {
5108
5120
  const n = await s(
5109
- Zt.endpoints.suggestEntityMention.initiate(e)
5121
+ Xt.endpoints.suggestEntityMention.initiate(e)
5110
5122
  );
5111
5123
  return n.error ? { error: P(n.error) } : { data: n.data };
5112
5124
  },
@@ -5145,13 +5157,13 @@ const Q = J.injectEndpoints({
5145
5157
  providesTags: [ct, dt]
5146
5158
  })
5147
5159
  })
5148
- }), { useGetActivityCategoriesQuery: Ro } = ut, { useGetProjectsCategoriesQuery: Go } = Ci, ks = Cs.enhanceEndpoints({
5160
+ }), { useGetActivityCategoriesQuery: Ro } = ut, { useGetProjectsCategoriesQuery: Go } = Ci, ws = Ns.enhanceEndpoints({
5149
5161
  endpoints: {
5150
5162
  listAddons: {
5151
5163
  providesTags: ["addonList"]
5152
5164
  }
5153
5165
  }
5154
- }), { useListAddonsQuery: Ni } = ks, Qi = (t, e, s) => {
5166
+ }), { useListAddonsQuery: Ni } = ws, Qi = (t, e, s) => {
5155
5167
  const n = [];
5156
5168
  for (const i of t.addons) {
5157
5169
  const r = s ? s(i.name) : i.productionVersion, a = r ? i.versions[r] : void 0;
@@ -5166,12 +5178,12 @@ const Q = J.injectEndpoints({
5166
5178
  }
5167
5179
  return n;
5168
5180
  }, bt = (t) => ({ getVersion: e } = {}, s) => {
5169
- const n = Ni({}, s), i = en(
5181
+ const n = Ni({}, s), i = tn(
5170
5182
  () => n.data ? Qi(n.data, t, e) : void 0,
5171
5183
  [n.data, e]
5172
5184
  );
5173
5185
  return { ...n, data: i };
5174
- }, Co = bt("project"), No = bt("settings"), Qo = bt("dashboard"), nt = ks.enhanceEndpoints({
5186
+ }, Co = bt("project"), No = bt("settings"), Qo = bt("dashboard"), nt = ws.enhanceEndpoints({
5175
5187
  endpoints: {
5176
5188
  deleteAddonVersion: {
5177
5189
  invalidatesTags: ["addonList"]
@@ -5187,7 +5199,7 @@ const Q = J.injectEndpoints({
5187
5199
  ]
5188
5200
  }
5189
5201
  }
5190
- }), ws = nt.injectEndpoints({
5202
+ }), As = nt.injectEndpoints({
5191
5203
  endpoints: (t) => ({
5192
5204
  // delete multiple addon versions at once
5193
5205
  deleteAddonVersions: t.mutation({
@@ -5235,7 +5247,7 @@ const Q = J.injectEndpoints({
5235
5247
  }),
5236
5248
  // endpoints
5237
5249
  overrideExisting: !0
5238
- }), { useDeleteAddonVersionsMutation: Mo, useDownloadAddonsMutation: Vo } = ws, As = Ns.enhanceEndpoints({
5250
+ }), { useDeleteAddonVersionsMutation: Mo, useDownloadAddonsMutation: Vo } = As, Es = Qs.enhanceEndpoints({
5239
5251
  endpoints: {
5240
5252
  getAttributeList: {
5241
5253
  transformResponse: (t) => t.attributes || [],
@@ -5248,7 +5260,7 @@ const Q = J.injectEndpoints({
5248
5260
  ]
5249
5261
  }
5250
5262
  }
5251
- }), { useGetAttributeListQuery: Oo, useGetAttributeConfigQuery: Do } = As, Mi = As.enhanceEndpoints({
5263
+ }), { useGetAttributeListQuery: Oo, useGetAttributeConfigQuery: Do } = Es, Mi = Es.enhanceEndpoints({
5252
5264
  endpoints: {
5253
5265
  setAttributeList: {
5254
5266
  invalidatesTags: ["attribute"]
@@ -5260,14 +5272,14 @@ const Q = J.injectEndpoints({
5260
5272
  invalidatesTags: (t, e, { attributeName: s }) => [{ type: "attribute", id: s }]
5261
5273
  }
5262
5274
  }
5263
- }), { useSetAttributeListMutation: $o, usePatchAttributeConfigMutation: xo } = Mi, Vi = Qs.enhanceEndpoints({
5275
+ }), { useSetAttributeListMutation: $o, usePatchAttributeConfigMutation: xo } = Mi, Vi = Ms.enhanceEndpoints({
5264
5276
  endpoints: {
5265
5277
  createSession: {},
5266
5278
  getUserPools: {
5267
5279
  providesTags: [{ type: "userPool", id: "LIST" }]
5268
5280
  }
5269
5281
  }
5270
- }), { useCreateSessionMutation: Uo, useGetUserPoolsQuery: Bo } = Vi, lt = Ms.enhanceEndpoints({
5282
+ }), { useCreateSessionMutation: Uo, useGetUserPoolsQuery: Bo } = Vi, lt = Vs.enhanceEndpoints({
5271
5283
  endpoints: {
5272
5284
  listBundles: {
5273
5285
  providesTags: () => [{ type: "bundleList" }]
@@ -5301,7 +5313,7 @@ const Q = J.injectEndpoints({
5301
5313
  const r = n(
5302
5314
  lt.util.updateQueryData("listBundles", { archived: e }, (a) => {
5303
5315
  if (!s || !a?.bundles) return;
5304
- const c = a.bundles.findIndex((d) => d.name === t);
5316
+ const c = a.bundles.findIndex((u) => u.name === t);
5305
5317
  if (c === -1) throw new Error("bundle not found");
5306
5318
  a.bundles[c] = s;
5307
5319
  })
@@ -5396,7 +5408,7 @@ const Q = J.injectEndpoints({
5396
5408
  usePromoteBundleMutation: Yo,
5397
5409
  useMigrateSettingsByBundleMutation: Zo,
5398
5410
  useUpdateBundleMutation: Xo
5399
- } = Ui, { useUnsetProjectBundleMutation: ec } = xi, Bi = Vs.enhanceEndpoints({
5411
+ } = Ui, { useUnsetProjectBundleMutation: ec } = xi, Bi = Os.enhanceEndpoints({
5400
5412
  endpoints: {
5401
5413
  getYnputCloudInfo: {
5402
5414
  providesTags: ["connections"]
@@ -5416,7 +5428,7 @@ const Q = J.injectEndpoints({
5416
5428
  useSetYnputCloudKeyMutation: sc,
5417
5429
  useDeleteYnputCloudKeyMutation: nc,
5418
5430
  useGetFeedbackVerificationQuery: ic
5419
- } = Bi, Es = Os.enhanceEndpoints({
5431
+ } = Bi, Ss = Ds.enhanceEndpoints({
5420
5432
  endpoints: {
5421
5433
  getServerConfig: {
5422
5434
  providesTags: ["config"]
@@ -5434,7 +5446,7 @@ const Q = J.injectEndpoints({
5434
5446
  useGetServerConfigOverridesQuery: ac,
5435
5447
  useGetServerConfigSchemaQuery: oc,
5436
5448
  useGetConfigValueQuery: cc
5437
- } = Es, qi = Es.enhanceEndpoints({
5449
+ } = Ss, qi = Ss.enhanceEndpoints({
5438
5450
  endpoints: {
5439
5451
  setServerConfig: {
5440
5452
  invalidatesTags: ["config"]
@@ -5444,24 +5456,24 @@ const Q = J.injectEndpoints({
5444
5456
  "folder",
5445
5457
  "task",
5446
5458
  "version"
5447
- ], Xt = 500, Hi = 3e4, it = async (t, { projectName: e, entityType: s, entityIds: n }) => {
5448
- const i = { forceRefetch: !0, subscribe: !1 }, r = async (u) => {
5449
- const o = { projectName: e, entityIds: u };
5459
+ ], es = 500, Hi = 3e4, it = async (t, { projectName: e, entityType: s, entityIds: n }) => {
5460
+ const i = { forceRefetch: !0, subscribe: !1 }, r = async (d) => {
5461
+ const o = { projectName: e, entityIds: d };
5450
5462
  return s === "folder" ? (await t(
5451
5463
  R.endpoints.GetFoldersListsMembership.initiate(o, i)
5452
5464
  ).unwrap()).project.folders.edges.map(({ node: f }) => f) : s === "task" ? (await t(
5453
5465
  R.endpoints.GetTasksListsMembership.initiate(o, i)
5454
5466
  ).unwrap()).project.tasks.edges.map(({ node: f }) => f) : (await t(
5455
5467
  R.endpoints.GetVersionsListsMembership.initiate(o, i)
5456
- ).unwrap()).project.versions.edges.map(({ node: p }) => p);
5468
+ ).unwrap()).project.versions.edges.map(({ node: l }) => l);
5457
5469
  }, a = [];
5458
- for (let u = 0; u < n.length; u += Xt)
5459
- a.push(n.slice(u, u + Xt));
5460
- const c = (await Promise.all(a.map(r))).flat(), d = {};
5461
- for (const u of n) d[u] = [];
5462
- for (const u of c) d[u.id] = u.entityLists;
5463
- return d;
5464
- }, es = (t, e) => e && t()[R.reducerPath]?.queries?.[e]?.data || {}, pt = R.injectEndpoints({
5470
+ for (let d = 0; d < n.length; d += es)
5471
+ a.push(n.slice(d, d + es));
5472
+ const c = (await Promise.all(a.map(r))).flat(), u = {};
5473
+ for (const d of n) u[d] = [];
5474
+ for (const d of c) u[d.id] = d.entityLists;
5475
+ return u;
5476
+ }, ts = (t, e) => e && t()[R.reducerPath]?.queries?.[e]?.data || {}, pt = R.injectEndpoints({
5465
5477
  endpoints: (t) => ({
5466
5478
  // One cache per project and entity type. Each call only fetches the ids that are not cached yet.
5467
5479
  // The query returns the whole map instead of using `merge`: RTK builds `providesTags` from the
@@ -5470,10 +5482,10 @@ const Q = J.injectEndpoints({
5470
5482
  queryFn: async (e, { dispatch: s, getState: n, queryCacheKey: i, forced: r }) => {
5471
5483
  try {
5472
5484
  if (r) return { data: await it(s, e) };
5473
- const a = es(n, i), c = e.entityIds.filter((u) => !a[u]);
5485
+ const a = ts(n, i), c = e.entityIds.filter((d) => !a[d]);
5474
5486
  if (!c.length) return { data: a };
5475
- const d = await it(s, { ...e, entityIds: c });
5476
- return { data: { ...es(n, i), ...d } };
5487
+ const u = await it(s, { ...e, entityIds: c });
5488
+ return { data: { ...ts(n, i), ...u } };
5477
5489
  } catch (a) {
5478
5490
  return { error: P(a) };
5479
5491
  }
@@ -5500,14 +5512,14 @@ const Q = J.injectEndpoints({
5500
5512
  // lists of this entity type share one batch key: the first starts a REALTIME_REFETCH_DELAY
5501
5513
  // timer, and when it fires one refetch of every cached entity replaces their lists.
5502
5514
  async onCacheEntryAdded({ projectName: e, entityType: s }, { cacheDataLoaded: n, cacheEntryRemoved: i, getCacheEntry: r, updateCachedData: a, dispatch: c }) {
5503
- let d;
5504
- const u = D(
5505
- async (o, l) => {
5506
- const p = Object.keys(r().data || {});
5507
- if (!p.length) return;
5515
+ let u;
5516
+ const d = $(
5517
+ async (o, p) => {
5518
+ const l = Object.keys(r().data || {});
5519
+ if (!l.length) return;
5508
5520
  await K();
5509
- const f = await it(c, { projectName: e, entityType: s, entityIds: p });
5510
- l() && a((y) => {
5521
+ const f = await it(c, { projectName: e, entityType: s, entityIds: l });
5522
+ p() && a((y) => {
5511
5523
  for (const [h, g] of Object.entries(f))
5512
5524
  y[h] && (y[h] = g);
5513
5525
  });
@@ -5516,13 +5528,13 @@ const Q = J.injectEndpoints({
5516
5528
  Hi
5517
5529
  );
5518
5530
  try {
5519
- await n, d = F.subscribe("entity_list", (o, l) => {
5520
- const { id: p, entity_type: f } = l?.summary || {};
5521
- l?.project !== e || f !== s || !p || u.add(p);
5531
+ await n, u = F.subscribe("entity_list", (o, p) => {
5532
+ const { id: l, entity_type: f } = p?.summary || {};
5533
+ p?.project !== e || f !== s || !l || d.add(l);
5522
5534
  });
5523
5535
  } catch {
5524
5536
  }
5525
- await i, d && F.unsubscribe(d), u.clear();
5537
+ await i, u && F.unsubscribe(u), d.clear();
5526
5538
  }
5527
5539
  })
5528
5540
  })
@@ -5544,7 +5556,7 @@ const Q = J.injectEndpoints({
5544
5556
  ] : [{ type: "entityListAttribute", id: "LIST" }]
5545
5557
  }
5546
5558
  }
5547
- }), { useGetEntityListAttributesDefinitionQuery: fc } = ft, Wi = (t) => t.startsWith("attrib.") ? `_all_attrib.${t.slice(7)}` : t.startsWith("inherited_attributes.") ? `_all_attrib.${t.slice(21)}` : `_entity_${t}`, zi = (t) => t.startsWith("_all_attrib_") ? `attrib_${t.slice(12)}` : t.startsWith("_entity_") ? t.slice(8) : t, yc = (t) => t.map((e) => ({ ...e, field: Wi(e.field) })), Ki = R.enhanceEndpoints({
5559
+ }), { useGetEntityListAttributesDefinitionQuery: fc } = ft, Wi = (t, e) => e === "version" && t === "product_type" ? "_parent_product_type" : t.startsWith("attrib.") ? `_all_attrib.${t.slice(7)}` : t.startsWith("inherited_attributes.") ? `_all_attrib.${t.slice(21)}` : `_entity_${t}`, zi = (t) => t.startsWith("_all_attrib_") ? `attrib_${t.slice(12)}` : t.startsWith("_entity_") ? t.slice(8) : t === "_parent_product_type" ? "product_type" : t, yc = (t, e) => t.map((s) => ({ ...s, field: Wi(s.field, e) })), Ki = R.enhanceEndpoints({
5548
5560
  endpoints: {
5549
5561
  // same caching as the other column stats endpoints: `targets` excluded
5550
5562
  // from the cache key, responses merged, only added targets refetch
@@ -5604,7 +5616,7 @@ const Q = J.injectEndpoints({
5604
5616
  (r) => {
5605
5617
  const a = {
5606
5618
  ...e,
5607
- id: e.id || cs()
5619
+ id: e.id || ds()
5608
5620
  };
5609
5621
  r.push(a);
5610
5622
  }
@@ -5649,14 +5661,14 @@ const Q = J.injectEndpoints({
5649
5661
  "getEntityListFolders",
5650
5662
  { projectName: t },
5651
5663
  (a) => {
5652
- const c = a.findIndex((d) => d.id === e);
5664
+ const c = a.findIndex((u) => u.id === e);
5653
5665
  if (c !== -1) {
5654
- const d = a[c];
5655
- Object.assign(d, {
5656
- ...d,
5666
+ const u = a[c];
5667
+ Object.assign(u, {
5668
+ ...u,
5657
5669
  ...s,
5658
5670
  data: {
5659
- ...d.data,
5671
+ ...u.data,
5660
5672
  ...s.data
5661
5673
  }
5662
5674
  });
@@ -5678,11 +5690,11 @@ const Q = J.injectEndpoints({
5678
5690
  useCreateEntityListFolderMutation: vc,
5679
5691
  useDeleteEntityListFolderMutation: bc,
5680
5692
  useUpdateEntityListFolderMutation: Ic
5681
- } = Qe, Yi = Ds.enhanceEndpoints({
5693
+ } = Qe, Yi = $s.enhanceEndpoints({
5682
5694
  endpoints: {
5683
5695
  getEntityGroups: {}
5684
5696
  }
5685
- }), { useGetEntityGroupsQuery: Tc } = Yi, ts = async (t, e, s, n) => {
5697
+ }), { useGetEntityGroupsQuery: Tc } = Yi, ss = async (t, e, s, n) => {
5686
5698
  switch (t) {
5687
5699
  case "task":
5688
5700
  return (await n(
@@ -5729,7 +5741,7 @@ const Q = J.injectEndpoints({
5729
5741
  default:
5730
5742
  throw new Error(`Unknown entity type: ${t}`);
5731
5743
  }
5732
- }, ss = ({
5744
+ }, ns = ({
5733
5745
  projectName: t,
5734
5746
  sourceEntity: e,
5735
5747
  targetEntity: s,
@@ -5739,28 +5751,28 @@ const Q = J.injectEndpoints({
5739
5751
  isDelete: a = !1
5740
5752
  }, {
5741
5753
  state: c,
5742
- dispatch: d
5743
- }, u = []) => {
5744
- const o = (p, f, y) => {
5754
+ dispatch: u
5755
+ }, d = []) => {
5756
+ const o = (l, f, y) => {
5745
5757
  const g = pe.util.selectCachedArgsForQuery(c, "getEntityLinks").filter(
5746
- (b) => b.projectName === t && b.entityType === p.entityType
5758
+ (b) => b.projectName === t && b.entityType === l.entityType
5747
5759
  );
5748
5760
  let m = !1;
5749
5761
  for (const b of g)
5750
5762
  try {
5751
- const v = d(
5763
+ const v = u(
5752
5764
  pe.util.updateQueryData(
5753
5765
  "getEntityLinks",
5754
5766
  b,
5755
5767
  (T) => {
5756
- const k = T.find((I) => I.id === p.entityId);
5768
+ const k = T.find((I) => I.id === l.entityId);
5757
5769
  if (k)
5758
5770
  if (m = !0, console.log(
5759
- `Found and patching ${p.entityType} ${p.entityId} in cache`
5771
+ `Found and patching ${l.entityType} ${l.entityId} in cache`
5760
5772
  ), a)
5761
5773
  k.links = k.links.filter((I) => I.id !== n);
5762
5774
  else {
5763
- console.log(`Adding new link to ${p.entityType}`);
5775
+ console.log(`Adding new link to ${l.entityType}`);
5764
5776
  const I = {
5765
5777
  id: n,
5766
5778
  direction: y,
@@ -5777,59 +5789,59 @@ const Q = J.injectEndpoints({
5777
5789
  (E) => E.id === n
5778
5790
  );
5779
5791
  w !== -1 ? k.links[w] = I : (console.log(
5780
- `Adding new link to ${p.entityType} links cache`,
5792
+ `Adding new link to ${l.entityType} links cache`,
5781
5793
  I,
5782
- tn(k)
5794
+ sn(k)
5783
5795
  ), k.links.push(I));
5784
5796
  }
5785
5797
  }
5786
5798
  )
5787
5799
  );
5788
- u.push(v);
5800
+ d.push(v);
5789
5801
  } catch (v) {
5790
- console.error(`Error patching cache for ${p.entityType}:`, v);
5802
+ console.error(`Error patching cache for ${l.entityType}:`, v);
5791
5803
  }
5792
- m || (p.entityId === e.entityId ? (console.warn(
5793
- `Source ${p.entityType} ${p.entityId} not in cache - invalidating to refresh UI`
5794
- ), d(
5804
+ m || (l.entityId === e.entityId ? (console.warn(
5805
+ `Source ${l.entityType} ${l.entityId} not in cache - invalidating to refresh UI`
5806
+ ), u(
5795
5807
  pe.util.invalidateTags([
5796
- { type: "link", id: `${t}-${p.entityType}` }
5808
+ { type: "link", id: `${t}-${l.entityType}` }
5797
5809
  ])
5798
5810
  )) : console.log(
5799
- `Target ${p.entityType} ${p.entityId} not in cache - skipping patch (entity not currently visible)`
5811
+ `Target ${l.entityType} ${l.entityId} not in cache - skipping patch (entity not currently visible)`
5800
5812
  ));
5801
5813
  };
5802
5814
  o(e, s, r), o(s, e, r === "in" ? "out" : "in");
5803
- }, Zi = $s.enhanceEndpoints({
5815
+ }, Zi = xs.enhanceEndpoints({
5804
5816
  endpoints: {
5805
5817
  deleteEntityLink: {
5806
5818
  async onQueryStarted({ linkId: t, projectName: e, patch: s }, { dispatch: n, getState: i, queryFulfilled: r }) {
5807
5819
  const a = i();
5808
5820
  let c = [];
5809
- const d = s?.source, u = s?.target, o = s?.linkType || "", l = s?.direction || "out";
5810
- if (d && u)
5821
+ const u = s?.source, d = s?.target, o = s?.linkType || "", p = s?.direction || "out";
5822
+ if (u && d)
5811
5823
  try {
5812
- ss(
5824
+ ns(
5813
5825
  {
5814
5826
  projectName: e,
5815
- sourceEntity: d,
5816
- targetEntity: u,
5827
+ sourceEntity: u,
5828
+ targetEntity: d,
5817
5829
  linkId: t,
5818
5830
  linkType: o,
5819
- direction: l,
5831
+ direction: p,
5820
5832
  isDelete: !0
5821
5833
  },
5822
5834
  { state: a, dispatch: n },
5823
5835
  c
5824
5836
  ), await r;
5825
- } catch (p) {
5826
- console.error("Error patching entities during link deletion:", p);
5837
+ } catch (l) {
5838
+ console.error("Error patching entities during link deletion:", l);
5827
5839
  for (const f of c)
5828
5840
  f.undo();
5829
5841
  n(
5830
5842
  pe.util.invalidateTags([
5831
- { type: "link", id: `${e}-${d.entityType}` },
5832
- { type: "link", id: `${e}-${u.entityType}` }
5843
+ { type: "link", id: `${e}-${u.entityType}` },
5844
+ { type: "link", id: `${e}-${d.entityType}` }
5833
5845
  ])
5834
5846
  );
5835
5847
  }
@@ -5839,17 +5851,17 @@ const Q = J.injectEndpoints({
5839
5851
  },
5840
5852
  createEntityLink: {
5841
5853
  async onQueryStarted({ projectName: t, createLinkRequestModel: e, patch: s }, { dispatch: n, getState: i, queryFulfilled: r }) {
5842
- const { linkType: a, id: c } = e, d = i();
5843
- let u = [];
5844
- const o = s?.source, l = o?.entityType, p = o?.entityId, f = s?.target, y = f?.entityType, h = f?.entityId, g = s?.direction || "out", m = a?.split("|")[0];
5854
+ const { linkType: a, id: c } = e, u = i();
5855
+ let d = [];
5856
+ const o = s?.source, p = o?.entityType, l = o?.entityId, f = s?.target, y = f?.entityType, h = f?.entityId, g = s?.direction || "out", m = a?.split("|")[0];
5845
5857
  try {
5846
5858
  if (o && o.entityType && f) {
5847
- const b = ts(
5848
- l,
5859
+ const b = ss(
5849
5860
  p,
5861
+ l,
5850
5862
  t,
5851
5863
  n
5852
- ), v = ts(
5864
+ ), v = ss(
5853
5865
  y,
5854
5866
  h,
5855
5867
  t,
@@ -5860,8 +5872,8 @@ const Q = J.injectEndpoints({
5860
5872
  if (!c)
5861
5873
  throw new Error("Link ID not found in cache entry");
5862
5874
  const w = {
5863
- entityType: l,
5864
- entityId: p,
5875
+ entityType: p,
5876
+ entityId: l,
5865
5877
  name: k.name,
5866
5878
  label: "label" in k ? k.label : void 0,
5867
5879
  parents: k.parents || [],
@@ -5874,7 +5886,7 @@ const Q = J.injectEndpoints({
5874
5886
  parents: I.parents || [],
5875
5887
  subType: "subType" in I ? I.subType : void 0
5876
5888
  };
5877
- ss(
5889
+ ns(
5878
5890
  {
5879
5891
  projectName: t,
5880
5892
  sourceEntity: w,
@@ -5884,13 +5896,13 @@ const Q = J.injectEndpoints({
5884
5896
  direction: g,
5885
5897
  isDelete: !1
5886
5898
  },
5887
- { state: d, dispatch: n },
5888
- u
5899
+ { state: u, dispatch: n },
5900
+ d
5889
5901
  ), await r;
5890
5902
  } else
5891
5903
  throw console.warn("Source entity type not provided, falling back to task query"), new Error("Source entity type not provided");
5892
5904
  } catch {
5893
- for (const v of u)
5905
+ for (const v of d)
5894
5906
  v.undo();
5895
5907
  o && f && n(
5896
5908
  pe.util.invalidateTags([
@@ -5917,51 +5929,51 @@ const Q = J.injectEndpoints({
5917
5929
  keepUnusedDataFor: 5,
5918
5930
  queryFn: async ({ queryArg: e, pageParam: s }, n) => {
5919
5931
  try {
5920
- const { projectName: i, entityType: r, search: a, parentIds: c, hasReviewables: d, includeTask: u } = e, { cursor: o } = s, l = {
5932
+ const { projectName: i, entityType: r, search: a, parentIds: c, hasReviewables: u, includeTask: d } = e, { cursor: o } = s, p = {
5921
5933
  projectName: i,
5922
5934
  first: Xi
5923
5935
  };
5924
- o && (l.after = o), l.search = a || "", l.parentIds = c, l.hasReviewables = d, l.includeTask = !!u;
5925
- let p;
5936
+ o && (p.after = o), p.search = a || "", p.parentIds = c, p.hasReviewables = u, p.includeTask = !!d;
5937
+ let l;
5926
5938
  switch (r) {
5927
5939
  case "folder":
5928
- p = await n.dispatch(
5929
- M.endpoints.GetSearchedFolders.initiate(l, {
5940
+ l = await n.dispatch(
5941
+ M.endpoints.GetSearchedFolders.initiate(p, {
5930
5942
  forceRefetch: !0
5931
5943
  })
5932
5944
  ).unwrap();
5933
5945
  break;
5934
5946
  case "product":
5935
- p = await n.dispatch(
5936
- M.endpoints.GetSearchedProducts.initiate(l, {
5947
+ l = await n.dispatch(
5948
+ M.endpoints.GetSearchedProducts.initiate(p, {
5937
5949
  forceRefetch: !0
5938
5950
  })
5939
5951
  ).unwrap();
5940
5952
  break;
5941
5953
  case "task":
5942
- p = await n.dispatch(
5943
- M.endpoints.GetSearchedTasks.initiate(l, {
5954
+ l = await n.dispatch(
5955
+ M.endpoints.GetSearchedTasks.initiate(p, {
5944
5956
  forceRefetch: !0
5945
5957
  })
5946
5958
  ).unwrap();
5947
5959
  break;
5948
5960
  case "version":
5949
- p = await n.dispatch(
5950
- M.endpoints.GetSearchedVersions.initiate(l, {
5961
+ l = await n.dispatch(
5962
+ M.endpoints.GetSearchedVersions.initiate(p, {
5951
5963
  forceRefetch: !0
5952
5964
  })
5953
5965
  ).unwrap();
5954
5966
  break;
5955
5967
  case "representation":
5956
- p = await n.dispatch(
5957
- M.endpoints.GetSearchedRepresentations.initiate(l, {
5968
+ l = await n.dispatch(
5969
+ M.endpoints.GetSearchedRepresentations.initiate(p, {
5958
5970
  forceRefetch: !0
5959
5971
  })
5960
5972
  ).unwrap();
5961
5973
  break;
5962
5974
  case "workfile":
5963
- p = await n.dispatch(
5964
- M.endpoints.GetSearchedWorkfiles.initiate(l, {
5975
+ l = await n.dispatch(
5976
+ M.endpoints.GetSearchedWorkfiles.initiate(p, {
5965
5977
  forceRefetch: !0
5966
5978
  })
5967
5979
  ).unwrap();
@@ -5969,7 +5981,7 @@ const Q = J.injectEndpoints({
5969
5981
  default:
5970
5982
  throw new Error(`Unsupported entity type: ${r}`);
5971
5983
  }
5972
- const f = p.project;
5984
+ const f = l.project;
5973
5985
  if (!f)
5974
5986
  throw new Error("No project data returned");
5975
5987
  const y = f[r + "s"], h = y?.edges?.map(({ node: g }) => {
@@ -6069,7 +6081,7 @@ const Q = J.injectEndpoints({
6069
6081
  queryFn: async ({ projectName: e, entityIds: s, direction: n }, { dispatch: i }) => {
6070
6082
  if (!s.length) return { data: { entities: [], truncated: !1 } };
6071
6083
  const r = n === "in" ? "GetLinksIntoEntities" : "GetLinksFromEntities", a = new Map(s.map((o) => [o, []]));
6072
- let c, d = 0, u = !1;
6084
+ let c, u = 0, d = !1;
6073
6085
  try {
6074
6086
  do {
6075
6087
  const o = await i(
@@ -6077,8 +6089,8 @@ const Q = J.injectEndpoints({
6077
6089
  { projectName: e, entityIds: s, first: tr, after: c },
6078
6090
  { forceRefetch: !0, subscribe: !1 }
6079
6091
  )
6080
- ).unwrap(), { edges: l, pageInfo: p } = o.project.links;
6081
- for (const f of l) {
6092
+ ).unwrap(), { edges: p, pageInfo: l } = o.project.links;
6093
+ for (const f of p) {
6082
6094
  const y = n === "in" ? f.outputId : f.inputId, h = n === "in" ? f.inputType : f.outputType, g = f.node;
6083
6095
  a.get(y)?.push({
6084
6096
  id: f.id,
@@ -6095,21 +6107,21 @@ const Q = J.injectEndpoints({
6095
6107
  isRestricted: !g
6096
6108
  });
6097
6109
  }
6098
- d += l.length, c = p.hasNextPage ? p.endCursor : void 0, u = !!c && d >= sr;
6099
- } while (c && !u);
6110
+ u += p.length, c = l.hasNextPage ? l.endCursor : void 0, d = !!c && u >= sr;
6111
+ } while (c && !d);
6100
6112
  } catch (o) {
6101
6113
  return { error: P(o) };
6102
6114
  }
6103
6115
  return {
6104
6116
  data: {
6105
- entities: [...a].map(([o, l]) => ({ id: o, links: l })),
6106
- truncated: u
6117
+ entities: [...a].map(([o, p]) => ({ id: o, links: p })),
6118
+ truncated: d
6107
6119
  }
6108
6120
  };
6109
6121
  }
6110
6122
  })
6111
6123
  })
6112
- }), { useGetLinksOfEntitiesQuery: Ec } = nr, ir = as.enhanceEndpoints({
6124
+ }), { useGetLinksOfEntitiesQuery: Ec } = nr, ir = os.enhanceEndpoints({
6113
6125
  endpoints: {
6114
6126
  getMyPermissions: {
6115
6127
  providesTags: (t) => [{ type: "userPermissions" }]
@@ -6118,13 +6130,13 @@ const Q = J.injectEndpoints({
6118
6130
  providesTags: (t, e, s) => [{ type: "userProjectPermissions" }]
6119
6131
  }
6120
6132
  }
6121
- }), { useGetMyPermissionsQuery: Sc, useGetMyProjectPermissionsQuery: Lc } = ir, Ss = xs.enhanceEndpoints({
6133
+ }), { useGetMyPermissionsQuery: Sc, useGetMyProjectPermissionsQuery: Lc } = ir, Ls = Us.enhanceEndpoints({
6122
6134
  endpoints: {
6123
6135
  getProductTypes: {
6124
6136
  providesTags: (t, e, s) => [{ type: "productType", id: "LIST" }]
6125
6137
  }
6126
6138
  }
6127
- }), { useGetProductTypesQuery: Pc } = Ss, rr = Ss.enhanceEndpoints({
6139
+ }), { useGetProductTypesQuery: Pc } = Ls, rr = Ls.enhanceEndpoints({
6128
6140
  endpoints: {
6129
6141
  createProduct: {
6130
6142
  invalidatesTags: (t, e, { productPostModel: s }) => [
@@ -6156,7 +6168,7 @@ const Q = J.injectEndpoints({
6156
6168
  ] : [{ type: "product", id: s }]
6157
6169
  }
6158
6170
  }
6159
- }), { useGetFolderProductsQuery: Fc } = ar, ce = { type: "projectFolder", id: "LIST" }, Me = Us.enhanceEndpoints({
6171
+ }), { useGetFolderProductsQuery: Fc } = ar, ce = { type: "projectFolder", id: "LIST" }, Me = Bs.enhanceEndpoints({
6160
6172
  endpoints: {
6161
6173
  getProjectFolders: {
6162
6174
  transformResponse: (t) => t.folders || [],
@@ -6174,7 +6186,7 @@ const Q = J.injectEndpoints({
6174
6186
  (i) => {
6175
6187
  const r = {
6176
6188
  ...t,
6177
- id: t.id || cs()
6189
+ id: t.id || ds()
6178
6190
  };
6179
6191
  i.push(r);
6180
6192
  }
@@ -6265,8 +6277,8 @@ const Q = J.injectEndpoints({
6265
6277
  e(
6266
6278
  ht.util.updateQueryData("getProjectsInfinite", {}, (a) => {
6267
6279
  for (const c of a.pages)
6268
- c.projects.forEach((d) => {
6269
- n.includes(d.name) && (d.projectFolder = i || void 0);
6280
+ c.projects.forEach((u) => {
6281
+ n.includes(u.name) && (u.projectFolder = i || void 0);
6270
6282
  });
6271
6283
  })
6272
6284
  )
@@ -6308,8 +6320,8 @@ const Q = J.injectEndpoints({
6308
6320
  a.projects?.includes(t) && i.push(
6309
6321
  s(
6310
6322
  ie.util.updateQueryData("getProjectsInfo", a, (c) => {
6311
- const d = c[t];
6312
- d && (d.tags = e, d.anatomy && (d.anatomy.tags = e));
6323
+ const u = c[t];
6324
+ u && (u.tags = e, u.anatomy && (u.anatomy.tags = e));
6313
6325
  })
6314
6326
  )
6315
6327
  );
@@ -6326,11 +6338,11 @@ const Q = J.injectEndpoints({
6326
6338
  const a = [...r.data?.tags || []];
6327
6339
  let c = !1;
6328
6340
  for (const o of s) {
6329
- const l = a.findIndex((p) => p.name === o.name);
6330
- l === -1 ? (a.push({ name: o.name, color: o.color || cr }), c = !0) : o.color && a[l].color !== o.color && (a[l] = { ...a[l], color: o.color }, c = !0);
6341
+ const p = a.findIndex((l) => l.name === o.name);
6342
+ p === -1 ? (a.push({ name: o.name, color: o.color || cr }), c = !0) : o.color && a[p].color !== o.color && (a[p] = { ...a[p], color: o.color }, c = !0);
6331
6343
  }
6332
6344
  if (!c) return { data: void 0 };
6333
- const d = or(e, a, n, i), u = await n(
6345
+ const u = or(e, a, n, i), d = await n(
6334
6346
  he.endpoints.updateProject.initiate(
6335
6347
  {
6336
6348
  projectName: e,
@@ -6341,11 +6353,11 @@ const Q = J.injectEndpoints({
6341
6353
  { track: !1 }
6342
6354
  )
6343
6355
  );
6344
- return u.error ? (d.forEach((o) => o.undo()), { error: P(u.error) }) : { data: void 0 };
6356
+ return d.error ? (u.forEach((o) => o.undo()), { error: P(d.error) }) : { data: void 0 };
6345
6357
  }
6346
6358
  })
6347
6359
  })
6348
- }), { useSaveProjectTagsMutation: Mc } = dr, Ls = (t, {
6360
+ }), { useSaveProjectTagsMutation: Mc } = dr, Ps = (t, {
6349
6361
  productId: e,
6350
6362
  taskId: s,
6351
6363
  folderId: n,
@@ -6354,46 +6366,46 @@ const Q = J.injectEndpoints({
6354
6366
  const a = [];
6355
6367
  if (e && a.push({ type: "review", id: e }), s && a.push({ type: "review", id: s }), n && a.push({ type: "review", id: n }), r && (e && a.push({ type: "viewer", id: e }), s && a.push({ type: "viewer", id: s }), n && a.push({ type: "viewer", id: n }), i && a.push({ type: "viewer", id: i }), a.push({ type: "viewer", id: "LIST" })), i && a.push({ type: "review", id: i }), t) {
6356
6368
  [...new Set(t.flatMap((o) => o?.productId || []))].forEach((o) => {
6357
- a.find((l) => l.id === o && l.type === "review") || a.push({ type: "review", id: o }), r && !a.find((l) => l.id === o && l.type === "viewer") && a.push({ type: "viewer", id: o });
6369
+ a.find((p) => p.id === o && p.type === "review") || a.push({ type: "review", id: o }), r && !a.find((p) => p.id === o && p.type === "viewer") && a.push({ type: "viewer", id: o });
6358
6370
  });
6359
- const d = t.flatMap(
6371
+ const u = t.flatMap(
6360
6372
  (o) => o ? {
6361
6373
  type: "review",
6362
6374
  id: o.id
6363
6375
  } : []
6364
6376
  );
6365
- a.push(...d), r && d.forEach((o) => {
6366
- a.find((l) => l.id === o.id && l.type === "viewer") || a.push({ type: "viewer", id: o.id });
6377
+ a.push(...u), r && u.forEach((o) => {
6378
+ a.find((p) => p.id === o.id && p.type === "viewer") || a.push({ type: "viewer", id: o.id });
6367
6379
  });
6368
- const u = t.flatMap(
6369
- (o) => o ? o.reviewables?.flatMap((l) => [
6380
+ const d = t.flatMap(
6381
+ (o) => o ? o.reviewables?.flatMap((p) => [
6370
6382
  {
6371
6383
  type: "review",
6372
- id: l.fileId
6384
+ id: p.fileId
6373
6385
  },
6374
6386
  {
6375
6387
  type: "review",
6376
- id: l.activityId
6388
+ id: p.activityId
6377
6389
  }
6378
6390
  ]) : []
6379
6391
  );
6380
- a.push(...u);
6392
+ a.push(...d);
6381
6393
  }
6382
6394
  return a;
6383
6395
  }, ur = X.enhanceEndpoints({
6384
6396
  endpoints: {
6385
6397
  getReviewablesForVersion: {
6386
6398
  keepUnusedDataFor: 1,
6387
- providesTags: (t, e, { versionId: s }) => Ls([t], { versionId: s, productId: t?.productId }),
6399
+ providesTags: (t, e, { versionId: s }) => Ps([t], { versionId: s, productId: t?.productId }),
6388
6400
  async onCacheEntryAdded({ versionId: t }, { updateCachedData: e, cacheDataLoaded: s, cacheEntryRemoved: n, dispatch: i, getCacheEntry: r }) {
6389
6401
  let a;
6390
- const c = D(
6391
- (d) => {
6392
- const u = r(), o = [], l = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Set();
6393
- d.forEach(({ message: f }) => {
6402
+ const c = $(
6403
+ (u) => {
6404
+ const d = r(), o = [], p = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set();
6405
+ u.forEach(({ message: f }) => {
6394
6406
  const y = f?.summary || {};
6395
6407
  if (y.versionId !== t) return;
6396
- const h = u.data?.reviewables?.findIndex(
6408
+ const h = d.data?.reviewables?.findIndex(
6397
6409
  (g) => g?.fileId === y.sourceFileId
6398
6410
  );
6399
6411
  if (f.status !== "finished" && h !== void 0 && h !== -1) {
@@ -6404,7 +6416,7 @@ const Q = J.injectEndpoints({
6404
6416
  });
6405
6417
  return;
6406
6418
  } else
6407
- l.add(y.versionId), f.status === "finished" && u.data?.productId && p.add(u.data.productId);
6419
+ p.add(y.versionId), f.status === "finished" && d.data?.productId && l.add(d.data.productId);
6408
6420
  }), o.length && e((f) => {
6409
6421
  const y = f.reviewables;
6410
6422
  y && o.forEach(({ index: h, progress: g, eventId: m }) => {
@@ -6418,25 +6430,25 @@ const Q = J.injectEndpoints({
6418
6430
  }
6419
6431
  });
6420
6432
  });
6421
- }), l.size && i(
6433
+ }), p.size && i(
6422
6434
  X.util.invalidateTags(
6423
- [...l].map((f) => ({ type: "review", id: f }))
6435
+ [...p].map((f) => ({ type: "review", id: f }))
6424
6436
  )
6425
- ), p.size && i(
6437
+ ), l.size && i(
6426
6438
  X.util.invalidateTags(
6427
- [...p].map((f) => ({ type: "viewer", id: f }))
6439
+ [...l].map((f) => ({ type: "viewer", id: f }))
6428
6440
  )
6429
6441
  );
6430
6442
  },
6431
- ({ message: d }) => d?.summary?.sourceFileId || d?.id || "",
6443
+ ({ message: u }) => u?.summary?.sourceFileId || u?.id || "",
6432
6444
  500
6433
6445
  );
6434
6446
  try {
6435
6447
  await s;
6436
- const d = (u, o) => {
6448
+ const u = (d, o) => {
6437
6449
  o?.summary?.versionId === t && c.add({ message: o });
6438
6450
  };
6439
- a = F.subscribe("reviewable.process", d);
6451
+ a = F.subscribe("reviewable.process", u);
6440
6452
  } catch {
6441
6453
  }
6442
6454
  await n, F.unsubscribe(a), c.clear();
@@ -6478,33 +6490,33 @@ const Q = J.injectEndpoints({
6478
6490
  const c = await r(a);
6479
6491
  return c.error ? { error: P(c.error) } : { data: c.data };
6480
6492
  },
6481
- providesTags: (e, s, n) => Ls(e, n, !0),
6493
+ providesTags: (e, s, n) => Ps(e, n, !0),
6482
6494
  async onCacheEntryAdded({ productId: e, taskId: s, folderId: n }, { cacheDataLoaded: i, cacheEntryRemoved: r, dispatch: a, getCacheEntry: c }) {
6483
- let d;
6484
- const u = D(
6495
+ let u;
6496
+ const d = $(
6485
6497
  (o) => {
6486
- const l = new Set(c().data?.map((y) => y.id) || []), p = e || s || n;
6487
- if (!p) return;
6498
+ const p = new Set(c().data?.map((y) => y.id) || []), l = e || s || n;
6499
+ if (!l) return;
6488
6500
  o.some(
6489
- ({ message: y }) => y.status === "finished" && l.has(y?.summary?.versionId || "")
6490
- ) && a(X.util.invalidateTags([{ type: "review", id: p }]));
6501
+ ({ message: y }) => y.status === "finished" && p.has(y?.summary?.versionId || "")
6502
+ ) && a(X.util.invalidateTags([{ type: "review", id: l }]));
6491
6503
  },
6492
6504
  ({ message: o }) => o?.summary?.versionId || o?.id || ""
6493
6505
  );
6494
6506
  try {
6495
6507
  await i;
6496
- const o = (l, p) => {
6497
- p?.status === "finished" && u.add({ message: p });
6508
+ const o = (p, l) => {
6509
+ l?.status === "finished" && d.add({ message: l });
6498
6510
  };
6499
- d = F.subscribe("reviewable.process", o);
6511
+ u = F.subscribe("reviewable.process", o);
6500
6512
  } catch {
6501
6513
  }
6502
- await r, F.unsubscribe(d), u.clear();
6514
+ await r, F.unsubscribe(u), d.clear();
6503
6515
  }
6504
6516
  }),
6505
6517
  hasTranscoder: t.query({
6506
6518
  queryFn: async (e, { dispatch: s }) => {
6507
- const n = await s(ws.endpoints.listAddons.initiate({ details: !1 }));
6519
+ const n = await s(As.endpoints.listAddons.initiate({ details: !1 }));
6508
6520
  return n.data ? { data: n.data.addons.some((r) => r.name === "transcoder") } : n.error ? { data: !1 } : { data: !1 };
6509
6521
  }
6510
6522
  })
@@ -6541,12 +6553,12 @@ const Q = J.injectEndpoints({
6541
6553
  "getReviewablesForVersion",
6542
6554
  { projectName: t, versionId: e },
6543
6555
  (a) => {
6544
- const c = s.sort, d = [], u = new Set(c);
6556
+ const c = s.sort, u = [], d = new Set(c);
6545
6557
  c?.forEach((o) => {
6546
- a.reviewables?.filter((l) => l.activityId === o).forEach((l) => d.push(l));
6558
+ a.reviewables?.filter((p) => p.activityId === o).forEach((p) => u.push(p));
6547
6559
  }), a.reviewables?.forEach((o) => {
6548
- u.has(o.activityId) || d.push(o);
6549
- }), a.reviewables = d;
6560
+ d.has(o.activityId) || u.push(o);
6561
+ }), a.reviewables = u;
6550
6562
  }
6551
6563
  )
6552
6564
  );
@@ -6567,7 +6579,7 @@ const Q = J.injectEndpoints({
6567
6579
  useDeleteReviewableMutation: $c,
6568
6580
  useSortVersionReviewablesMutation: xc,
6569
6581
  useUpdateReviewableMutation: Uc
6570
- } = pr, ns = (t) => {
6582
+ } = pr, is = (t) => {
6571
6583
  const e = [{ type: "shared", id: "LIST" }];
6572
6584
  return t && e.push({
6573
6585
  type: "shared",
@@ -6599,14 +6611,14 @@ const Q = J.injectEndpoints({
6599
6611
  }
6600
6612
  }
6601
6613
  return e;
6602
- }, yr = rs.enhanceEndpoints({
6614
+ }, yr = as.enhanceEndpoints({
6603
6615
  endpoints: {
6604
6616
  getShareOptions: {
6605
6617
  transformResponse: (t) => t?.options || [],
6606
- providesTags: (t, e, { projectName: s }) => t ? [...fr(t), ...ns(s)] : ns(s)
6618
+ providesTags: (t, e, { projectName: s }) => t ? [...fr(t), ...is(s)] : is(s)
6607
6619
  }
6608
6620
  }
6609
- }), { useGetShareOptionsQuery: Bc } = yr, Ps = Bs.enhanceEndpoints({
6621
+ }), { useGetShareOptionsQuery: Bc } = yr, js = qs.enhanceEndpoints({
6610
6622
  endpoints: {
6611
6623
  getSiteInfo: {
6612
6624
  providesTags: (t) => t ? [
@@ -6628,7 +6640,7 @@ const Q = J.injectEndpoints({
6628
6640
  let i;
6629
6641
  try {
6630
6642
  await s, i = F.subscribe("bundle", () => {
6631
- e(Ps.util.invalidateTags(["frontendModules", "addonList", "bundleList"]));
6643
+ e(js.util.invalidateTags(["frontendModules", "addonList", "bundleList"]));
6632
6644
  });
6633
6645
  } catch {
6634
6646
  }
@@ -6636,7 +6648,7 @@ const Q = J.injectEndpoints({
6636
6648
  }
6637
6649
  }
6638
6650
  }
6639
- }), { useGetSiteInfoQuery: qc, useLazyGetSiteInfoQuery: Hc, useListFrontendModulesQuery: Wc } = Ps, gr = rt.enhanceEndpoints({
6651
+ }), { useGetSiteInfoQuery: qc, useLazyGetSiteInfoQuery: Hc, useListFrontendModulesQuery: Wc } = js, gr = rt.enhanceEndpoints({
6640
6652
  endpoints: {
6641
6653
  getTask: {
6642
6654
  providesTags: (t, e, { taskId: s }) => [
@@ -6647,18 +6659,18 @@ const Q = J.injectEndpoints({
6647
6659
  }), { useGetTaskQuery: zc } = gr, hr = (t, e, { state: s, dispatch: n }, i) => {
6648
6660
  const r = [{ type: "entityListItem", id: t }], a = U.util.selectInvalidatedBy(s, r).filter((c) => c.endpointName === "getListItemsInfinite");
6649
6661
  for (const c of a) {
6650
- const d = n(
6651
- U.util.updateQueryData("getListItemsInfinite", c.originalArgs, (u) => {
6652
- for (const o of u.pages) {
6653
- const l = o.items.findIndex((p) => p.entityId === t);
6654
- if (l !== -1) {
6655
- const p = o.items[l];
6656
- p.subtasks || (p.subtasks = []), p.subtasks = e;
6662
+ const u = n(
6663
+ U.util.updateQueryData("getListItemsInfinite", c.originalArgs, (d) => {
6664
+ for (const o of d.pages) {
6665
+ const p = o.items.findIndex((l) => l.entityId === t);
6666
+ if (p !== -1) {
6667
+ const l = o.items[p];
6668
+ l.subtasks || (l.subtasks = []), l.subtasks = e;
6657
6669
  }
6658
6670
  }
6659
6671
  })
6660
6672
  );
6661
- i.push(d);
6673
+ i.push(u);
6662
6674
  }
6663
6675
  }, mr = rt.injectEndpoints({
6664
6676
  endpoints: (t) => ({
@@ -6679,14 +6691,14 @@ const Q = J.injectEndpoints({
6679
6691
  }
6680
6692
  },
6681
6693
  async onQueryStarted({ taskId: e, subtasks: s }, { dispatch: n, queryFulfilled: i, getState: r }) {
6682
- const a = r(), c = [], d = [
6694
+ const a = r(), c = [], u = [
6683
6695
  {
6684
6696
  entityId: e,
6685
6697
  entityType: "task",
6686
6698
  data: { subtasks: s }
6687
6699
  }
6688
6700
  ];
6689
- Se(d, { state: a, dispatch: n }, c), gs(d, { state: a, dispatch: n }, c), hr(e, s, { state: a, dispatch: n }, c);
6701
+ Se(u, { state: a, dispatch: n }, c), hs(u, { state: a, dispatch: n }, c), hr(e, s, { state: a, dispatch: n }, c);
6690
6702
  try {
6691
6703
  await i;
6692
6704
  } catch {
@@ -6695,7 +6707,7 @@ const Q = J.injectEndpoints({
6695
6707
  }
6696
6708
  })
6697
6709
  })
6698
- }), { useUpdateSubtasksMutation: Kc } = mr, te = { type: "team", id: "LIST" }, vr = qs.enhanceEndpoints({
6710
+ }), { useUpdateSubtasksMutation: Kc } = mr, te = { type: "team", id: "LIST" }, vr = Hs.enhanceEndpoints({
6699
6711
  endpoints: {
6700
6712
  getTeams: {
6701
6713
  providesTags: (t) => t ? [te, ...t.map((e) => ({ type: "team", id: e.name }))] : [te]
@@ -6817,7 +6829,7 @@ query Assignees($projectName: String) {
6817
6829
  avatarUrl: `/api/users/${e}/avatar`,
6818
6830
  hidden: t.hidden
6819
6831
  };
6820
- }, Ar = as.enhanceEndpoints({
6832
+ }, Ar = os.enhanceEndpoints({
6821
6833
  endpoints: {
6822
6834
  getCurrentUser: {
6823
6835
  providesTags: [{ type: "user", id: "LIST" }]
@@ -6873,8 +6885,8 @@ query Assignees($projectName: String) {
6873
6885
  getUsersAssignee: t.query({
6874
6886
  async queryFn({ names: e, projectName: s }, n, i, r) {
6875
6887
  if (!e && s) {
6876
- const d = await n.dispatch(
6877
- Hs.endpoints.getEnumOptions.initiate(
6888
+ const u = await n.dispatch(
6889
+ Ws.endpoints.getEnumOptions.initiate(
6878
6890
  {
6879
6891
  enumName: "users",
6880
6892
  params: { project_name: s, mode: "users", hide_inactive: !0 }
@@ -6882,7 +6894,7 @@ query Assignees($projectName: String) {
6882
6894
  { subscribe: !1, forceRefetch: n.forced }
6883
6895
  )
6884
6896
  ).unwrap();
6885
- return d.error ? { error: P(d.error) } : { data: d.items.map(wr) };
6897
+ return u.error ? { error: P(u.error) } : { data: u.items.map(wr) };
6886
6898
  }
6887
6899
  const a = await r({
6888
6900
  url: "/graphql",
@@ -6894,11 +6906,11 @@ query Assignees($projectName: String) {
6894
6906
  });
6895
6907
  return a.error ? { error: P(a.error) } : {
6896
6908
  data: (a.data?.data?.users.edges ?? []).flatMap(
6897
- (d) => d.node ? [
6909
+ (u) => u.node ? [
6898
6910
  {
6899
- name: d.node.name,
6900
- fullName: d.node.attrib?.fullName ?? void 0,
6901
- avatarUrl: `/api/users/${d.node.name}/avatar`
6911
+ name: u.node.name,
6912
+ fullName: u.node.attrib?.fullName ?? void 0,
6913
+ avatarUrl: `/api/users/${u.node.name}/avatar`
6902
6914
  }
6903
6915
  ] : []
6904
6916
  )
@@ -6968,7 +6980,7 @@ query Assignees($projectName: String) {
6968
6980
  ] : [{ type: "product", id: s }]
6969
6981
  }
6970
6982
  }
6971
- }), { useGetLatestProductVersionQuery: gd } = Pr, jr = Ws.enhanceEndpoints({
6983
+ }), { useGetLatestProductVersionQuery: gd } = Pr, jr = zs.enhanceEndpoints({
6972
6984
  endpoints: {
6973
6985
  getVersion: {},
6974
6986
  createVersion: {
@@ -6990,7 +7002,7 @@ query Assignees($projectName: String) {
6990
7002
  }), { useGetVersionQuery: hd, useCreateVersionMutation: md, useDeleteVersionMutation: vd } = jr, q = (t, e) => ({
6991
7003
  type: "view",
6992
7004
  id: `${t.toUpperCase()}${e ? `:${e.toUpperCase()}` : ""}`
6993
- }), Ce = { type: "view", id: "LIST" }, V = zs.enhanceEndpoints({
7005
+ }), Ce = { type: "view", id: "LIST" }, V = Ks.enhanceEndpoints({
6994
7006
  endpoints: {
6995
7007
  listViews: {
6996
7008
  transformResponse: (t) => t?.views || [],
@@ -7032,7 +7044,7 @@ query Assignees($projectName: String) {
7032
7044
  "listViews",
7033
7045
  { viewType: t.viewType, projectName: t.projectName },
7034
7046
  (o) => {
7035
- const l = {
7047
+ const p = {
7036
7048
  ...i,
7037
7049
  working: i.working || !1,
7038
7050
  scope: t.projectName ? "project" : "studio",
@@ -7043,41 +7055,41 @@ query Assignees($projectName: String) {
7043
7055
  accessLevel: 30
7044
7056
  };
7045
7057
  if (i.working) {
7046
- const p = o.findIndex((f) => f.working === !0);
7047
- if (p !== -1) {
7048
- const f = o[p].id;
7049
- o[p] = { ...l, id: f };
7058
+ const l = o.findIndex((f) => f.working === !0);
7059
+ if (l !== -1) {
7060
+ const f = o[l].id;
7061
+ o[l] = { ...p, id: f };
7050
7062
  } else
7051
- o.push(l);
7063
+ o.push(p);
7052
7064
  } else
7053
- o.push(l);
7054
- o.sort((p, f) => p.position !== f.position ? p.position - f.position : p.label.localeCompare(f.label));
7065
+ o.push(p);
7066
+ o.sort((l, f) => l.position !== f.position ? l.position - f.position : l.label.localeCompare(f.label));
7055
7067
  }
7056
7068
  )
7057
7069
  );
7058
- let d;
7059
- i.working && (d = e(
7070
+ let u;
7071
+ i.working && (u = e(
7060
7072
  V.util.updateQueryData(
7061
7073
  "getWorkingView",
7062
7074
  { viewType: t.viewType, projectName: t.projectName },
7063
7075
  (o) => {
7064
- const l = o?.id, p = {
7076
+ const p = o?.id, l = {
7065
7077
  ...i,
7066
7078
  working: !0,
7067
7079
  scope: t.projectName ? "project" : "studio",
7068
7080
  visibility: "private",
7069
7081
  owner: a,
7070
- ...l && { id: l }
7082
+ ...p && { id: p }
7071
7083
  // Keep existing ID if it exists
7072
7084
  };
7073
- Object.assign(o, p);
7085
+ Object.assign(o, l);
7074
7086
  }
7075
7087
  )
7076
7088
  ));
7077
- let u;
7089
+ let d;
7078
7090
  if (i.label === "__base__") {
7079
7091
  const o = {
7080
- id: Js(),
7092
+ id: Ys(),
7081
7093
  ...i,
7082
7094
  working: !1,
7083
7095
  scope: t.projectName ? "project" : "studio",
@@ -7086,15 +7098,15 @@ query Assignees($projectName: String) {
7086
7098
  accessLevel: 30,
7087
7099
  position: 0
7088
7100
  };
7089
- u = e(
7101
+ d = e(
7090
7102
  V.util.updateQueryData(
7091
7103
  "getBaseView",
7092
7104
  { viewType: t.viewType, projectName: t.projectName },
7093
- (l) => {
7094
- l && Object.assign(l, o);
7105
+ (p) => {
7106
+ p && Object.assign(p, o);
7095
7107
  }
7096
7108
  )
7097
- ), u?.patches?.length || e(
7109
+ ), d?.patches?.length || e(
7098
7110
  V.util.upsertQueryData(
7099
7111
  "getBaseView",
7100
7112
  { viewType: t.viewType, projectName: t.projectName },
@@ -7105,7 +7117,7 @@ query Assignees($projectName: String) {
7105
7117
  try {
7106
7118
  await s;
7107
7119
  } catch {
7108
- c.undo(), d && d.undo(), u && u.undo();
7120
+ c.undo(), u && u.undo(), d && d.undo();
7109
7121
  }
7110
7122
  },
7111
7123
  // updates the view list cache for a specific view type and project
@@ -7119,9 +7131,9 @@ query Assignees($projectName: String) {
7119
7131
  const { viewId: n, genericViewPatchModel: i, viewType: r, projectName: a } = t, c = [];
7120
7132
  c.push(
7121
7133
  e(
7122
- V.util.updateQueryData("listViews", { viewType: r, projectName: a }, (d) => {
7123
- const u = d.find((o) => o.id === n);
7124
- u && Object.assign(u, i);
7134
+ V.util.updateQueryData("listViews", { viewType: r, projectName: a }, (u) => {
7135
+ const d = u.find((o) => o.id === n);
7136
+ d && Object.assign(d, i);
7125
7137
  })
7126
7138
  )
7127
7139
  ), c.push(
@@ -7129,8 +7141,8 @@ query Assignees($projectName: String) {
7129
7141
  V.util.updateQueryData(
7130
7142
  "getWorkingView",
7131
7143
  { viewType: r, projectName: a },
7132
- (d) => {
7133
- d?.id === n && Object.assign(d, i);
7144
+ (u) => {
7145
+ u?.id === n && Object.assign(u, i);
7134
7146
  }
7135
7147
  )
7136
7148
  )
@@ -7139,8 +7151,8 @@ query Assignees($projectName: String) {
7139
7151
  V.util.updateQueryData(
7140
7152
  "getDefaultView",
7141
7153
  { viewType: r, projectName: a },
7142
- (d) => {
7143
- d?.id === n && Object.assign(d, i);
7154
+ (u) => {
7155
+ u?.id === n && Object.assign(u, i);
7144
7156
  }
7145
7157
  )
7146
7158
  )
@@ -7149,8 +7161,8 @@ query Assignees($projectName: String) {
7149
7161
  V.util.updateQueryData(
7150
7162
  "getView",
7151
7163
  { viewType: r, viewId: n, projectName: a },
7152
- (d) => {
7153
- d && Object.assign(d, i);
7164
+ (u) => {
7165
+ u && Object.assign(u, i);
7154
7166
  }
7155
7167
  )
7156
7168
  )
@@ -7158,7 +7170,7 @@ query Assignees($projectName: String) {
7158
7170
  try {
7159
7171
  await s;
7160
7172
  } catch {
7161
- c.forEach((u) => u.undo());
7173
+ c.forEach((d) => d.undo());
7162
7174
  }
7163
7175
  },
7164
7176
  invalidatesTags: (t, e, { viewType: s, projectName: n, viewId: i, genericViewPatchModel: r }) => {
@@ -7171,33 +7183,33 @@ query Assignees($projectName: String) {
7171
7183
  "accessLevel",
7172
7184
  "working"
7173
7185
  ];
7174
- return Object.keys(r).some((u) => c.includes(u)) && (a.push({ type: "view", id: i }), a.push(q(s, n))), a;
7186
+ return Object.keys(r).some((d) => c.includes(d)) && (a.push({ type: "view", id: i }), a.push(q(s, n))), a;
7175
7187
  }
7176
7188
  },
7177
7189
  deleteView: {
7178
7190
  onQueryStarted: async (t, { dispatch: e, queryFulfilled: s, getState: n }) => {
7179
- const { viewId: i, projectName: r, viewType: a } = t, c = n(), d = [];
7180
- d.push(
7191
+ const { viewId: i, projectName: r, viewType: a } = t, c = n(), u = [];
7192
+ u.push(
7181
7193
  e(
7182
- V.util.updateQueryData("listViews", { viewType: a, projectName: r }, (l) => l.filter((p) => p.id !== i))
7194
+ V.util.updateQueryData("listViews", { viewType: a, projectName: r }, (p) => p.filter((l) => l.id !== i))
7183
7195
  )
7184
7196
  );
7185
- const u = [
7197
+ const d = [
7186
7198
  { projectName: r },
7187
7199
  { projectName: void 0 }
7188
7200
  // studio level
7189
7201
  ], o = ["getBaseView", "getDefaultView"];
7190
- for (const l of u)
7191
- for (const p of o) {
7192
- const f = V.endpoints[p].select({
7202
+ for (const p of d)
7203
+ for (const l of o) {
7204
+ const f = V.endpoints[l].select({
7193
7205
  viewType: a,
7194
- projectName: l.projectName
7206
+ projectName: p.projectName
7195
7207
  })(c);
7196
- f?.isSuccess && f.data?.id === i && d.push(
7208
+ f?.isSuccess && f.data?.id === i && u.push(
7197
7209
  e(
7198
7210
  V.util.updateQueryData(
7199
- p,
7200
- { viewType: a, projectName: l.projectName },
7211
+ l,
7212
+ { viewType: a, projectName: p.projectName },
7201
7213
  () => null
7202
7214
  )
7203
7215
  )
@@ -7206,7 +7218,7 @@ query Assignees($projectName: String) {
7206
7218
  try {
7207
7219
  await s;
7208
7220
  } catch {
7209
- d.forEach((p) => p.undo());
7221
+ u.forEach((l) => l.undo());
7210
7222
  }
7211
7223
  },
7212
7224
  // updates the view list cache for a specific view type and project
@@ -7218,22 +7230,22 @@ query Assignees($projectName: String) {
7218
7230
  },
7219
7231
  setDefaultView: {
7220
7232
  onQueryStarted: async (t, { dispatch: e, queryFulfilled: s, getState: n }) => {
7221
- const { setDefaultViewRequestModel: i, projectName: r, viewType: a } = t, { viewId: c } = i, d = n(), u = V.endpoints.getDefaultView.select({
7233
+ const { setDefaultViewRequestModel: i, projectName: r, viewType: a } = t, { viewId: c } = i, u = n(), d = V.endpoints.getDefaultView.select({
7222
7234
  viewType: a,
7223
7235
  projectName: r
7224
- })(d);
7225
- if (u?.isSuccess && u.data?.id) {
7236
+ })(u);
7237
+ if (d?.isSuccess && d.data?.id) {
7226
7238
  const o = e(
7227
7239
  V.util.updateQueryData(
7228
7240
  "getDefaultView",
7229
7241
  { viewType: a, projectName: r },
7230
- (l) => {
7231
- if (l) {
7242
+ (p) => {
7243
+ if (p) {
7232
7244
  const f = V.endpoints.listViews.select({
7233
7245
  viewType: a,
7234
7246
  projectName: r
7235
- })(d)?.data?.find((y) => y.id === c);
7236
- f ? Object.assign(l, f) : l.id = c;
7247
+ })(u)?.data?.find((y) => y.id === c);
7248
+ f ? Object.assign(p, f) : p.id = c;
7237
7249
  }
7238
7250
  }
7239
7251
  )
@@ -7265,7 +7277,7 @@ query Assignees($projectName: String) {
7265
7277
  getEntityWatchers: {},
7266
7278
  setEntityWatchers: {}
7267
7279
  }
7268
- }), is = Be.injectEndpoints({
7280
+ }), rs = Be.injectEndpoints({
7269
7281
  endpoints: (t) => ({
7270
7282
  getEntitiesWatchers: t.query({
7271
7283
  async queryFn({ entities: e = [] }, { dispatch: s }) {
@@ -7292,7 +7304,7 @@ query Assignees($projectName: String) {
7292
7304
  ])
7293
7305
  })
7294
7306
  })
7295
- }), _r = is.injectEndpoints({
7307
+ }), _r = rs.injectEndpoints({
7296
7308
  endpoints: (t) => ({
7297
7309
  setEntitiesWatchers: t.mutation({
7298
7310
  async queryFn({ entities: e = [] }, { dispatch: s }) {
@@ -7314,19 +7326,19 @@ query Assignees($projectName: String) {
7314
7326
  }
7315
7327
  },
7316
7328
  async onQueryStarted({ entities: e }, { dispatch: s, queryFulfilled: n, getState: i }) {
7317
- const r = i(), a = e.map((u) => ({ type: "watchers", id: u.entityId })), c = Be.util.selectInvalidatedBy(r, a);
7318
- let d = [];
7329
+ const r = i(), a = e.map((d) => ({ type: "watchers", id: d.entityId })), c = Be.util.selectInvalidatedBy(r, a);
7330
+ let u = [];
7319
7331
  try {
7320
- c.forEach((u) => {
7332
+ c.forEach((d) => {
7321
7333
  const o = s(
7322
- is.util.updateQueryData(
7334
+ rs.util.updateQueryData(
7323
7335
  "getEntitiesWatchers",
7324
- u.originalArgs,
7325
- (l) => {
7326
- u.originalArgs.entities.forEach((p) => {
7327
- const f = e.find((g) => g.entityId === p.entityId);
7336
+ d.originalArgs,
7337
+ (p) => {
7338
+ d.originalArgs.entities.forEach((l) => {
7339
+ const f = e.find((g) => g.entityId === l.entityId);
7328
7340
  if (!f) return;
7329
- const y = l.find((g) => g.entityId === f.entityId);
7341
+ const y = p.find((g) => g.entityId === f.entityId);
7330
7342
  if (!y) throw new Error("Entity draft not found");
7331
7343
  const h = f.watchers;
7332
7344
  y.watchers = h;
@@ -7334,17 +7346,17 @@ query Assignees($projectName: String) {
7334
7346
  }
7335
7347
  )
7336
7348
  );
7337
- d.push(o);
7349
+ u.push(o);
7338
7350
  }), await n;
7339
7351
  } catch {
7340
- d.forEach((o) => o?.undo());
7352
+ u.forEach((o) => o?.undo());
7341
7353
  }
7342
7354
  },
7343
7355
  // invalidates all versions if any of the entities are tasks
7344
7356
  invalidatesTags: (e, s, { entities: n }) => n.some((i) => i.entityType === "task") ? [{ type: "watchers", id: "VERSION-LIST" }] : []
7345
7357
  })
7346
7358
  })
7347
- }), { useGetEntitiesWatchersQuery: Pd, useSetEntitiesWatchersMutation: jd } = _r, Rr = Ks.enhanceEndpoints({
7359
+ }), { useGetEntitiesWatchersQuery: Pd, useSetEntitiesWatchersMutation: jd } = _r, Rr = Js.enhanceEndpoints({
7348
7360
  endpoints: {
7349
7361
  resolveUris: {}
7350
7362
  }
@@ -7368,7 +7380,7 @@ export {
7368
7380
  ge as O,
7369
7381
  Un as P,
7370
7382
  ta as Q,
7371
- fs as R,
7383
+ ys as R,
7372
7384
  Gn as S,
7373
7385
  He as T,
7374
7386
  ht as U,
@@ -7378,7 +7390,7 @@ export {
7378
7390
  V as Y,
7379
7391
  oa as Z,
7380
7392
  Yi as _,
7381
- Pt as a,
7393
+ jt as a,
7382
7394
  Ra as a$,
7383
7395
  Q as a0,
7384
7396
  at as a1,
@@ -7387,14 +7399,14 @@ export {
7387
7399
  Ae as a4,
7388
7400
  we as a5,
7389
7401
  da as a6,
7390
- Ht as a7,
7402
+ Wt as a7,
7391
7403
  G as a8,
7392
- gs as a9,
7404
+ hs as a9,
7393
7405
  sa as aA,
7394
7406
  Fe as aB,
7395
7407
  bi as aC,
7396
- Ts as aD,
7397
- qt as aE,
7408
+ ks as aD,
7409
+ Ht as aE,
7398
7410
  fd as aF,
7399
7411
  Qc as aG,
7400
7412
  Wo as aH,
@@ -7417,7 +7429,7 @@ export {
7417
7429
  Ko as aY,
7418
7430
  kc as aZ,
7419
7431
  bc as a_,
7420
- ys as aa,
7432
+ gs as aa,
7421
7433
  hr as ab,
7422
7434
  oo as ac,
7423
7435
  xe as ad,
@@ -7439,7 +7451,7 @@ export {
7439
7451
  ca as at,
7440
7452
  yr as au,
7441
7453
  ra as av,
7442
- Ps as aw,
7454
+ js as aw,
7443
7455
  Fn as ax,
7444
7456
  vr as ay,
7445
7457
  yc as az,
@@ -7573,7 +7585,7 @@ export {
7573
7585
  Bo as cx,
7574
7586
  ld as cy,
7575
7587
  dd as cz,
7576
- _t as d,
7588
+ Rt as d,
7577
7589
  Wa as d0,
7578
7590
  bd as d1,
7579
7591
  Zo as d2,
@@ -7595,9 +7607,9 @@ export {
7595
7607
  Bi as dI,
7596
7608
  Pc as dJ,
7597
7609
  gt as dK,
7598
- An as dL,
7610
+ En as dL,
7599
7611
  ia as dM,
7600
- ls as dN,
7612
+ ps as dN,
7601
7613
  Zc as da,
7602
7614
  ea as db,
7603
7615
  $o as dc,
@@ -7626,9 +7638,9 @@ export {
7626
7638
  $n as e,
7627
7639
  oe as f,
7628
7640
  _i as g,
7629
- ws as h,
7630
- rn as i,
7631
- En as j,
7641
+ As as h,
7642
+ an as i,
7643
+ Sn as j,
7632
7644
  Mi as k,
7633
7645
  Vi as l,
7634
7646
  aa as m,
@@ -7639,10 +7651,10 @@ export {
7639
7651
  ci as r,
7640
7652
  ie as s,
7641
7653
  ao as t,
7642
- sn as u,
7654
+ nn as u,
7643
7655
  Dn as v,
7644
7656
  ue as w,
7645
- J as x,
7646
- hs as y,
7657
+ Y as x,
7658
+ ms as y,
7647
7659
  pe as z
7648
7660
  };