@ynput/ayon-frontend-shared 0.7.5 → 0.8.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 (74) hide show
  1. package/dist/DetailsPanel.es.js +471 -469
  2. package/dist/Feed.es.js +1 -1
  3. package/dist/ListTable.es.js +20 -20
  4. package/dist/NewEntity.es.js +7 -7
  5. package/dist/ProjectTreeTable.es.js +2523 -2502
  6. package/dist/ProjectsTable.es.js +5 -5
  7. package/dist/Slicer.es.js +28 -25
  8. package/dist/Views.es.js +150 -151
  9. package/dist/api.es.js +166 -165
  10. package/dist/chunks/Actions.es.js +9 -10
  11. package/dist/chunks/ColumnDropIndicator.es.js +4 -4
  12. package/dist/chunks/ColumnHeaderMenuUI.es.js +4 -5
  13. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +2 -2
  14. package/dist/chunks/DetailsDialog.es.js +3 -3
  15. package/dist/chunks/EmptyPlaceholder.es.js +7 -7
  16. package/dist/chunks/EntityPath.es.js +38 -39
  17. package/dist/chunks/EntityPickerDialog.es.js +482 -462
  18. package/dist/chunks/EntityTooltip.es.js +18 -19
  19. package/dist/chunks/Feed.es.js +1382 -1355
  20. package/dist/chunks/FilmstripEntityCard.es.js +5201 -0
  21. package/dist/chunks/FilterErrorActions.es.js +3 -4
  22. package/dist/chunks/GroupSettingsFallback.es.js +4 -4
  23. package/dist/chunks/Menu.es.js +242 -240
  24. package/dist/chunks/MetaWidget.es.js +1948 -1875
  25. package/dist/chunks/ProjectFoldersContext.es.js +237 -0
  26. package/dist/chunks/RepresentationsList.es.js +1 -1
  27. package/dist/chunks/ReviewablesSelector.es.js +1260 -1190
  28. package/dist/chunks/SimpleTable.es.js +303 -297
  29. package/dist/chunks/Slicer.es.js +420 -413
  30. package/dist/chunks/TableExportContextInstance.es.js +622 -378
  31. package/dist/chunks/TableSettingsFallback.es.js +3 -4
  32. package/dist/chunks/ThumbnailSimple.es.js +114 -99
  33. package/dist/chunks/ThumbnailUploaderContext.es.js +48 -0
  34. package/dist/chunks/VideoPlayer.es.js +8 -9
  35. package/dist/chunks/Watchers.es.js +929 -872
  36. package/dist/chunks/{ColumnDropIndicator.styled.es.js → addonColumnTags.es.js} +60 -47
  37. package/dist/chunks/expandRelativeDates.es.js +1 -1
  38. package/dist/chunks/getThumbnailUrl.es.js +33 -21
  39. package/dist/chunks/getUris.es.js +1580 -1610
  40. package/dist/chunks/queryFilterToClientFilter.es.js +1 -1
  41. package/dist/chunks/realtimeUpdatesUtils.es.js +15 -15
  42. package/dist/chunks/searchTerms.es.js +773 -696
  43. package/dist/chunks/useAttributeEnums.es.js +22 -22
  44. package/dist/chunks/useDateRangeFilter.es.js +1 -1
  45. package/dist/chunks/useHierarchySelection.es.js +3 -4
  46. package/dist/chunks/useLoadModule.es.js +3 -4
  47. package/dist/components.es.js +1391 -1253
  48. package/dist/context.es.js +645 -668
  49. package/dist/hooks.es.js +193 -171
  50. package/dist/index.es.js +4 -4
  51. package/dist/types/Actions.d.ts +10 -8
  52. package/dist/types/DetailsPanel.d.ts +54 -76
  53. package/dist/types/EntityPickerDialog.d.ts +51 -2
  54. package/dist/types/Feed.d.ts +24 -24
  55. package/dist/types/ListTable.d.ts +33 -27
  56. package/dist/types/NewEntity.d.ts +26 -39
  57. package/dist/types/ProjectTreeTable.d.ts +318 -212
  58. package/dist/types/ProjectsTable.d.ts +6 -6
  59. package/dist/types/RepresentationsList.d.ts +4 -0
  60. package/dist/types/Slicer.d.ts +63 -246
  61. package/dist/types/Views.d.ts +71 -298
  62. package/dist/types/api.d.ts +3164 -2363
  63. package/dist/types/components.d.ts +537 -497
  64. package/dist/types/context.d.ts +293 -572
  65. package/dist/types/hooks.d.ts +76 -47
  66. package/dist/types/index.d.ts +6 -0
  67. package/dist/types/util.d.ts +141 -120
  68. package/dist/util.es.js +71 -68
  69. package/package.json +6 -6
  70. package/dist/chunks/EntityUpdatesContext.es.js +0 -61
  71. package/dist/chunks/PlayableIcon.es.js +0 -5020
  72. package/dist/chunks/ProjectContext.es.js +0 -158
  73. package/dist/chunks/useQueryArgumentChangeLoading.es.js +0 -11
  74. package/dist/chunks/viewUpdateHelper.es.js +0 -153
@@ -1,54 +1,54 @@
1
- import { jsx as l, jsxs as k, Fragment as Ce } from "react/jsx-runtime";
2
- import en, { useMemo as S, useState as L, useEffect as G, lazy as vo, Suspense as bo, useCallback as qe, useRef as ge, forwardRef as ft, useId as wo, Fragment as xo } from "react";
3
- import { v4 as wn } from "uuid";
4
- import ee, { clsx as xn } from "clsx";
5
- import kn from "react-markdown";
6
- import An from "remark-emoji";
7
- import Fn from "remark-gfm";
8
- import ko from "remark-directive";
9
- import Ao from "remark-directive-rehype";
10
- import { toast as Fe } from "react-toastify";
11
- import { $createListItemNode as Fo, $createListNode as Co } from "@lexical/list";
12
- import { $getRoot as To } from "lexical";
13
- import { Button as ct, Dialog as Do, getFileSizeString as No, Icon as se, theme as Cn, getTextColor as _t, Dropdown as So, SaveButton as Io, UserImage as Tn, SEARCH_FILTER_ID as Dn, buildFilterId as tn, getFilterFromId as Eo, SearchFilter as Mo } from "@ynput/ayon-react-components";
14
- import { _ as Po, a1 as Nn, a2 as _o, H as Ro, a3 as Lo, a4 as nn, a5 as $o, a6 as Oo, a7 as Vo, y as jo, a8 as Uo, a9 as zo, aa as Bo, ab as Go, ac as Ho, ad as qo, ae as Wo, af as Qo, ag as Yo, ah as Jo, ai as Ko, O as Rt, W as Sn, T as Xo, aj as Zo, ak as ea, al as ta, am as na, an as oa, ao as aa, ap as ra, aq as on, ar as ia, b as sa, c as ca, i as la, as as da, S as ua, e as ma, L as pa } from "./PlayableIcon.es.js";
1
+ import { jsx as c, jsxs as x, Fragment as Te } from "react/jsx-runtime";
2
+ import nn, { useMemo as I, useState as L, useEffect as W, lazy as xo, Suspense as ko, useCallback as Je, useRef as pe, forwardRef as ft, useId as Ao, Fragment as Fo } from "react";
3
+ import { v4 as xn } from "uuid";
4
+ import ne, { clsx as kn } from "clsx";
5
+ import An from "react-markdown";
6
+ import Fn from "remark-emoji";
7
+ import Cn from "remark-gfm";
8
+ import Co from "remark-directive";
9
+ import To from "remark-directive-rehype";
10
+ import { toast as Ce } from "react-toastify";
11
+ import { $createListItemNode as Do, $createListNode as No } from "@lexical/list";
12
+ import { $getRoot as Io } from "lexical";
13
+ import { Button as st, Dialog as So, getFileSizeString as Eo, Icon as se, theme as Tn, getTextColor as Lt, Dropdown as Mo, SaveButton as Po, UserImage as Dn, SEARCH_FILTER_ID as Nn, buildFilterId as on, getFilterFromId as _o, SearchFilter as Ro } from "@ynput/ayon-react-components";
14
+ import { a8 as Lo, aa as In, ab as $o, P as Oo, ac as Vo, ad as an, ae as jo, af as Uo, ag as zo, J as Bo, ah as Go, ai as Ho, aj as qo, ak as Wo, al as Qo, am as Yo, an as Jo, ao as Ko, ap as Xo, aq as Zo, ar as ea, V as $t, a3 as Sn, a0 as ta, as as na, at as oa, au as aa, av as ra, aw as ia, ax as sa, ay as ca, az as rn, aA as la, b as da, c as ua, i as ma, aB as pa, _ as ga, e as ha, T as fa, S as ya, U as va } from "./FilmstripEntityCard.es.js";
15
15
  import "@lexical/code";
16
16
  import "@lexical/rich-text";
17
17
  import "@lexical/selection";
18
18
  import "@lexical/utils";
19
19
  import "@lexical/react/LexicalBlockWithAlignableContents";
20
20
  import "@lexical/react/LexicalDecoratorBlockNode";
21
- import F, { css as Lt } from "styled-components";
22
- import { C as ga } from "./CodeEditor.es.js";
23
- import { E as St } from "./EmptyPlaceholder.es.js";
21
+ import F, { css as Ot } from "styled-components";
22
+ import { C as ba } from "./CodeEditor.es.js";
23
+ import { E as It } from "./EmptyPlaceholder.es.js";
24
24
  import "./EmptyPlaceholderFlex.styled.es.js";
25
- import { a_ as ha, bt as an } from "./searchTerms.es.js";
26
- import { bk as fa, bn as ya, aJ as va, dn as ba, aW as wa, aQ as xa, b3 as ka, Q as Aa, bF as Fa, bm as Ca, bx as Ta, br as Da, bl as Na, cE as Sa, c1 as Ia } from "./getUris.es.js";
25
+ import { a_ as wa, bs as sn } from "./searchTerms.es.js";
26
+ import { bl as xa, bo as ka, aJ as Aa, dp as Fa, aW as Ca, aQ as Ta, b3 as Da, Q as Na, bG as Ia, bn as Sa, by as Ea, bs as Ma, bm as Pa, cF as _a, c2 as Ra } from "./getUris.es.js";
27
27
  import "primereact/confirmdialog";
28
- import { union as Ea, isEqual as Ma } from "lodash";
29
- import { b as Pa, F as _a, u as $e, a as In, T as Ra, C as La } from "./ThumbnailSimple.es.js";
28
+ import { union as La, isEqual as $a } from "lodash";
29
+ import { b as Oa, F as Va, u as $e, a as En, T as ja, C as Ua } from "./ThumbnailSimple.es.js";
30
30
  import "@module-federation/enhanced/runtime";
31
31
  import "@ynput/ayon-addon/host";
32
- import { v as ze, x as $a, a4 as yt, u as Oa } from "./TableExportContextInstance.es.js";
33
- import $t from "axios";
32
+ import Vt from "axios";
33
+ import { m as Be, q as za, a2 as yt, u as Ba } from "./TableExportContextInstance.es.js";
34
34
  import "semver";
35
35
  import "./ContextMenuContextInstance.es.js";
36
36
  import "react-dom";
37
- import "react-redux";
38
37
  import "react-router-dom";
39
- import { p as be } from "./parseFilename.es.js";
40
- import { b as rn } from "./colorUtils.es.js";
38
+ import { p as ve } from "./parseFilename.es.js";
39
+ import { b as cn } from "./colorUtils.es.js";
41
40
  import "./EntityTooltip.es.js";
42
- import { isValid as lt, isToday as Va, isSameYear as ja, isSameDay as Ua, isSameWeek as za, isSameMinute as Ba, format as sn, formatISO as Ga, differenceInMinutes as Ha, differenceInSeconds as qa, compareAsc as Wa } from "date-fns";
43
- import { a as Qa, M as Ya } from "./Menu.es.js";
44
- import { InView as Ja } from "react-intersection-observer";
45
- import { t as Ka, c as Xa } from "./queryFilterToClientFilter.es.js";
46
- import { r as Za, a as er, m as tr, u as nr } from "./useDateRangeFilter.es.js";
41
+ import { isValid as Ke, isToday as Ga, isSameYear as Ha, isSameDay as qa, isSameWeek as Wa, isSameMinute as Qa, format as St, formatISO as Ya, differenceInMinutes as Ja, differenceInSeconds as Ka, compareAsc as Xa } from "date-fns";
42
+ import "@ynput/ayon-addon";
43
+ import { a as Za, M as er } from "./Menu.es.js";
44
+ import { InView as tr } from "react-intersection-observer";
45
+ import { t as nr, c as or } from "./queryFilterToClientFilter.es.js";
46
+ import { r as ar, a as rr, m as ir, u as sr } from "./useDateRangeFilter.es.js";
47
47
  import "match-sorter";
48
- import { c as or } from "./confirmDelete.es.js";
49
- import { c as En } from "./copyToClipboard.es.js";
50
- import { g as cn } from "./realtimeUpdatesUtils.es.js";
51
- const ar = ({
48
+ import { c as cr } from "./confirmDelete.es.js";
49
+ import { c as Mn } from "./copyToClipboard.es.js";
50
+ import { g as ln } from "./realtimeUpdatesUtils.es.js";
51
+ const lr = ({
52
52
  entities: e,
53
53
  filter: t,
54
54
  backendFilter: o,
@@ -56,10 +56,10 @@ const ar = ({
56
56
  projectName: a,
57
57
  entityType: r
58
58
  }) => {
59
- const i = S(
60
- () => e.map((b) => ({ id: b.id, projectName: b.projectName, entityType: r })),
59
+ const i = I(
60
+ () => e.map((w) => ({ id: w.id, projectName: w.projectName, entityType: r })),
61
61
  [e]
62
- ).map((b) => b.id), c = !e.length || !t || !n || !a, m = {
62
+ ).map((w) => w.id), l = !e.length || !t || !n || !a, m = {
63
63
  entityIds: i,
64
64
  projectName: a,
65
65
  referenceTypes: ["origin", "mention", "relation"],
@@ -72,23 +72,23 @@ const ar = ({
72
72
  isLoading: g,
73
73
  isFetchingNextPage: u,
74
74
  currentData: h,
75
- fetchNextPage: v,
75
+ fetchNextPage: b,
76
76
  hasNextPage: y
77
- } = fa(m, { skip: c });
78
- const D = S(() => p?.pages ? p.pages.flatMap((b) => b.activities || []) : [], [p?.pages]), P = S(() => h?.pages ? h.pages.flatMap((b) => b.activities || []) : [], [h?.pages]), C = async () => {
77
+ } = xa(m, { skip: l });
78
+ const D = I(() => p?.pages ? p.pages.flatMap((w) => w.activities || []) : [], [p?.pages]), M = I(() => h?.pages ? h.pages.flatMap((w) => w.activities || []) : [], [h?.pages]), C = async () => {
79
79
  if (!y) {
80
80
  console.log("No more activities to load");
81
81
  return;
82
82
  }
83
- return console.log("loading next page..."), await v();
84
- }, f = S(() => {
83
+ return console.log("loading next page..."), await b();
84
+ }, f = I(() => {
85
85
  if (!g) return !1;
86
- const b = Ea(
87
- P?.flatMap((T) => T.entityId ? T.entityId : [])
86
+ const w = La(
87
+ M?.flatMap((A) => A.entityId ? A.entityId : [])
88
88
  );
89
- return !Ma(b, i);
90
- }, [P, i, g]);
91
- return c && (g = !0), {
89
+ return !$a(w, i);
90
+ }, [M, i, g]);
91
+ return l && (g = !0), {
92
92
  activitiesData: D,
93
93
  isLoadingActivities: g,
94
94
  isLoadingNew: f,
@@ -96,24 +96,24 @@ const ar = ({
96
96
  hasNextPage: y,
97
97
  loadNextPage: C
98
98
  };
99
- }, it = "__new__", Ic = ({ children: e, ...t }) => {
100
- const { isGuest: o } = ze(), { data: n = [] } = ya({ projects: [t.projectName] }), { data: a = [] } = ha.useGetTeamsQuery(
99
+ }, rt = "__new__", Mc = ({ children: e, ...t }) => {
100
+ const { isGuest: o } = Be(), { data: n = [] } = ka({ projects: [t.projectName] }), { data: a = [] } = wa.useGetTeamsQuery(
101
101
  { projectName: t.projectName, showMembers: !0 },
102
102
  { skip: !t.projectName }
103
- ), r = S(
104
- () => a.filter((U) => U.members?.some((de) => de.name === t.userName)).map((U) => U.name),
103
+ ), r = I(
104
+ () => a.filter((j) => j.members?.some((de) => de.name === t.userName)).map((j) => j.name),
105
105
  [a, t.userName]
106
106
  ), [s, i] = L({
107
107
  operator: "and",
108
108
  conditions: []
109
- }), [c, m] = L(""), p = t.feedFilter ?? s, g = t.setFeedFilter ?? i, [u, h] = L(null), [v, y] = L(null), [D, { isLoading: P }] = va(), [C, { isLoading: f }] = ba(), [b, { isLoading: T }] = wa(), I = P || f || T, _ = async (U) => await D(U).unwrap(), R = async (U) => await C(U).unwrap(), E = async (U) => await b(U).unwrap(), [N] = xa(), [Q] = ka(), Y = async (U) => await N(U).unwrap(), H = async (U) => await Q(U).unwrap(), J = Aa(p), q = S(() => Pa(p), [p]), $ = ar({
109
+ }), [l, m] = L(""), p = t.feedFilter ?? s, g = t.setFeedFilter ?? i, [u, h] = L(null), [b, y] = L(null), [D, { isLoading: M }] = Aa(), [C, { isLoading: f }] = Fa(), [w, { isLoading: A }] = Ca(), S = M || f || A, P = async (j) => await D(j).unwrap(), _ = async (j) => await C(j).unwrap(), E = async (j) => await w(j).unwrap(), [N] = Ta(), [G] = Da(), X = async (j) => await N(j).unwrap(), Q = async (j) => await G(j).unwrap(), Z = Na(p), Y = I(() => Oa(p), [p]), $ = lr({
110
110
  entities: t.entities,
111
111
  filter: p,
112
- backendFilter: q,
113
- activityTypes: J,
112
+ backendFilter: Y,
113
+ activityTypes: Z,
114
114
  projectName: t.projectName,
115
115
  entityType: t.entityType
116
- }), { data: te = {} } = Fa(
116
+ }), { data: oe = {} } = Ia(
117
117
  {
118
118
  suggestRequest: {
119
119
  entityType: t.entityType,
@@ -122,49 +122,49 @@ const ar = ({
122
122
  projectName: t.projectName
123
123
  },
124
124
  { skip: !u }
125
- ), { data: oe = [] } = Ca({
125
+ ), { data: ae = [] } = Sa({
126
126
  projectName: t.projectName
127
- }), { data: W } = Ta(
127
+ }), { data: J } = Ea(
128
128
  {
129
129
  projectName: t.projectName,
130
- entityIds: t.entities.map((U) => U.id)
130
+ entityIds: t.entities.map((j) => j.id)
131
131
  },
132
132
  { skip: !t.projectName || !t.entities.length }
133
133
  );
134
- return /* @__PURE__ */ l(
135
- _a.Provider,
134
+ return /* @__PURE__ */ c(
135
+ Va.Provider,
136
136
  {
137
137
  value: {
138
138
  ...t,
139
139
  ...$,
140
- mentionSuggestionsData: te,
141
- categories: oe,
142
- checklistCount: W,
140
+ mentionSuggestionsData: oe,
141
+ categories: ae,
142
+ checklistCount: J,
143
143
  users: n,
144
- isUpdatingActivity: I,
144
+ isUpdatingActivity: S,
145
145
  userTeamNames: r,
146
- refTooltip: v,
147
- activityTypes: J,
146
+ refTooltip: b,
147
+ activityTypes: Z,
148
148
  feedFilter: p,
149
149
  setFeedFilter: g,
150
- backendFilter: q,
151
- searchText: c,
150
+ backendFilter: Y,
151
+ searchText: l,
152
152
  setSearchText: m,
153
153
  isGuest: o,
154
154
  editingId: u,
155
155
  setEditingId: h,
156
156
  setRefTooltip: y,
157
157
  // Query functions
158
- createEntityActivity: _,
159
- updateActivity: R,
158
+ createEntityActivity: P,
159
+ updateActivity: _,
160
160
  deleteActivity: E,
161
- createReaction: Y,
162
- deleteReaction: H
161
+ createReaction: X,
162
+ deleteReaction: Q
163
163
  },
164
164
  children: e
165
165
  }
166
166
  );
167
- }, rr = F.div`
167
+ }, dr = F.div`
168
168
  display: grid;
169
169
  grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
170
170
  gap: var(--base-gap-large);
@@ -180,7 +180,7 @@ const ar = ({
180
180
  301px + var(--padding-s) + var(--padding-s) + var(--base-gap-large)+ var(--base-gap-large)
181
181
  );
182
182
  overflow: auto;
183
- `, ir = F.div`
183
+ `, ur = F.div`
184
184
  position: relative;
185
185
  display: flex;
186
186
  flex-direction: column;
@@ -226,7 +226,7 @@ const ar = ({
226
226
  .download-icon {
227
227
  color: var(--md-sys-color-outline);
228
228
  }
229
- `, sr = F.footer`
229
+ `, mr = F.footer`
230
230
  background-color: var(--md-sys-color-surface-container-low);
231
231
  display: flex;
232
232
  align-items: center;
@@ -326,7 +326,7 @@ const ar = ({
326
326
  }
327
327
  }
328
328
  }
329
- `, cr = F.div`
329
+ `, pr = F.div`
330
330
  position: relative;
331
331
  display: flex;
332
332
  justify-content: center;
@@ -363,7 +363,7 @@ const ar = ({
363
363
  &:hover .image-wrapper::after {
364
364
  opacity: 0.8;
365
365
  }
366
- `, ln = F.div`
366
+ `, dn = F.div`
367
367
  position: absolute;
368
368
  inset: 0;
369
369
  display: flex;
@@ -402,7 +402,7 @@ const ar = ({
402
402
  &.posterError {
403
403
  background-color: transparent;
404
404
  }
405
- `, lr = F.div`
405
+ `, gr = F.div`
406
406
  display: none;
407
407
  position: absolute;
408
408
  left: 0;
@@ -411,7 +411,7 @@ const ar = ({
411
411
  height: calc(100% - 20px);
412
412
  width: 100%;
413
413
  gap: 0;
414
- `, dn = F(ct)`
414
+ `, un = F(st)`
415
415
  height: 100%;
416
416
  width: 100%;
417
417
  border: none;
@@ -422,7 +422,7 @@ const ar = ({
422
422
  background: none;
423
423
  opacity: 1;
424
424
  }
425
- `, dr = F(Po)`
425
+ `, hr = F(Lo)`
426
426
  --icon-size: 32px;
427
427
  top: calc(50% - 10px);
428
428
  left: 50%;
@@ -434,7 +434,7 @@ const ar = ({
434
434
  .icon {
435
435
  font-size: var(--icon-size);
436
436
  }
437
- `, Ec = F(Do)`
437
+ `, Pc = F(So)`
438
438
  min-height: 90vh;
439
439
  max-height: 90vh;
440
440
  min-width: min(90vw, 100%);
@@ -519,7 +519,7 @@ const ar = ({
519
519
  &:focus-visible {
520
520
  outline: none;
521
521
  }
522
- `, ur = F.img`
522
+ `, fr = F.img`
523
523
  height: 100%;
524
524
  width: 100%;
525
525
 
@@ -529,7 +529,7 @@ const ar = ({
529
529
  max-width: 90vw;
530
530
  min-width: 300px;
531
531
  background-color: var(--md-sys-color-surface-container-lowest);
532
- `, Mc = F.div`
532
+ `, _c = F.div`
533
533
  &.scrollable {
534
534
  position: absolute;
535
535
  inset: 56px;
@@ -541,7 +541,7 @@ const ar = ({
541
541
  inset: 56px 0 0 0;
542
542
  display: flex;
543
543
  }
544
- `, un = F.div`
544
+ `, mn = F.div`
545
545
  position: relative;
546
546
  display: flex;
547
547
  flex: 1;
@@ -558,45 +558,45 @@ const ar = ({
558
558
  flex: 1;
559
559
  min-width: 0;
560
560
  }
561
- `, dt = (e, t) => `/api/projects/${t}/files/${e}`, mr = ({
561
+ `, ct = (e, t) => `/api/projects/${t}/files/${e}`, yr = ({
562
562
  file: e,
563
563
  fullPreviews: t = ["png", "jpg", "jpeg", "gif", "svg", "webp"]
564
564
  }) => {
565
565
  const { id: o, projectName: n, mime: a } = e;
566
- let r = dt(o, n);
567
- return t.some((i) => a.includes(i)) || (r += "/thumbnail"), /* @__PURE__ */ l(ur, { src: r, autoFocus: !0 });
568
- }, pr = F(ga)`
566
+ let r = ct(o, n);
567
+ return t.some((i) => a.includes(i)) || (r += "/thumbnail"), /* @__PURE__ */ c(fr, { src: r, autoFocus: !0 });
568
+ }, vr = F(ba)`
569
569
  border-radius: var(--border-radius-m);
570
570
  height: 100%;
571
571
  overflow: auto !important;
572
- `, gr = ({ file: e }) => {
573
- let t = dt(e.id, e.projectName);
572
+ `, br = ({ file: e }) => {
573
+ let t = ct(e.id, e.projectName);
574
574
  const [o, n] = L(""), [a, r] = L(null);
575
- return G(() => {
575
+ return W(() => {
576
576
  (async () => {
577
577
  try {
578
578
  const i = await fetch(t);
579
579
  if (!i.ok)
580
580
  throw new Error(`HTTP error! status: ${i.status}`);
581
- const c = await i.text();
582
- n(c);
581
+ const l = await i.text();
582
+ n(l);
583
583
  } catch (i) {
584
584
  r(i.message);
585
585
  }
586
586
  })();
587
- }, [e.projectName, e.id, t]), a ? /* @__PURE__ */ k("div", { children: [
587
+ }, [e.projectName, e.id, t]), a ? /* @__PURE__ */ x("div", { children: [
588
588
  "Error: ",
589
589
  a
590
- ] }) : e.mime?.includes("markdown") ? /* @__PURE__ */ l(kn, { remarkPlugins: [Fn, An], children: o }) : /* @__PURE__ */ l(pr, { value: o, language: e.extension, readOnly: !0 });
591
- }, Mn = () => import("./VideoPlayer.es.js"), hr = vo(Mn), fr = ({ duration: e, width: t, height: o }) => Number.isFinite(e) && e > 0 && t > 0 && o > 0, yr = 1e4, vr = (e) => e ? `code ${e.code}${e.message ? `: ${e.message}` : ""}` : "no MediaError", br = (e, t) => {
590
+ ] }) : e.mime?.includes("markdown") ? /* @__PURE__ */ c(An, { remarkPlugins: [Cn, Fn], children: o }) : /* @__PURE__ */ c(vr, { value: o, language: e.extension, readOnly: !0 });
591
+ }, Pn = () => import("./VideoPlayer.es.js"), wr = xo(Pn), xr = ({ duration: e, width: t, height: o }) => Number.isFinite(e) && e > 0 && t > 0 && o > 0, kr = 1e4, Ar = (e) => e ? `code ${e.code}${e.message ? `: ${e.message}` : ""}` : "no MediaError", Fr = (e, t) => {
592
592
  const [o, n] = L({ status: "loading" });
593
- return G(() => {
593
+ return W(() => {
594
594
  n({ status: "loading" });
595
595
  let a = !1, r = null, s;
596
596
  const i = () => {
597
- r && (r.removeEventListener("loadedmetadata", c), r.removeEventListener("error", m), r.removeAttribute("src"), r.load(), r = null);
597
+ r && (r.removeEventListener("loadedmetadata", l), r.removeEventListener("error", m), r.removeAttribute("src"), r.load(), r = null);
598
598
  };
599
- function c() {
599
+ function l() {
600
600
  if (a || !r) return;
601
601
  clearTimeout(s);
602
602
  const u = {
@@ -604,14 +604,14 @@ const ar = ({
604
604
  width: r.videoWidth,
605
605
  height: r.videoHeight
606
606
  };
607
- if (fr(u)) {
607
+ if (xr(u)) {
608
608
  i(), n({ status: "ready", metadata: u });
609
609
  return;
610
610
  }
611
611
  p(`unusable metadata ${JSON.stringify(u)}`);
612
612
  }
613
613
  function m() {
614
- a || (clearTimeout(s), p(vr(r?.error ?? null)));
614
+ a || (clearTimeout(s), p(Ar(r?.error ?? null)));
615
615
  }
616
616
  const p = (u) => {
617
617
  const h = r?.preload === "metadata";
@@ -622,7 +622,7 @@ const ar = ({
622
622
  console.warn(`[VideoMime] video cannot be played: ${u}`, e), n({ status: "error" });
623
623
  };
624
624
  function g(u) {
625
- r = document.createElement("video"), r.preload = u, r.muted = !0, r.playsInline = !0, s = setTimeout(() => !a && p("timed out"), yr), r.addEventListener("loadedmetadata", c), r.addEventListener("error", m), r.src = e;
625
+ r = document.createElement("video"), r.preload = u, r.muted = !0, r.playsInline = !0, s = setTimeout(() => !a && p("timed out"), kr), r.addEventListener("loadedmetadata", l), r.addEventListener("error", m), r.src = e;
626
626
  }
627
627
  return g("metadata"), () => {
628
628
  a = !0, clearTimeout(s), i();
@@ -638,18 +638,18 @@ const ar = ({
638
638
  codec: t?.codec
639
639
  }
640
640
  };
641
- }, wr = ({ file: e }) => {
642
- const { id: t, projectName: o, name: n, mediaInfo: a } = e, r = dt(t, o), s = br(r, a);
643
- if (G(() => {
644
- Mn();
641
+ }, Cr = ({ file: e }) => {
642
+ const { id: t, projectName: o, name: n, mediaInfo: a } = e, r = ct(t, o), s = Fr(r, a);
643
+ if (W(() => {
644
+ Pn();
645
645
  }, []), s.status === "error")
646
- return /* @__PURE__ */ l(un, { children: /* @__PURE__ */ l(St, { icon: "videocam_off", message: "This video cannot be played in the browser", children: /* @__PURE__ */ k("a", { href: r, target: "_blank", rel: "noopener noreferrer", children: [
646
+ return /* @__PURE__ */ c(mn, { children: /* @__PURE__ */ c(It, { icon: "videocam_off", message: "This video cannot be played in the browser", children: /* @__PURE__ */ x("a", { href: r, target: "_blank", rel: "noopener noreferrer", children: [
647
647
  "Download ",
648
648
  n
649
649
  ] }) }) });
650
- const i = /* @__PURE__ */ l(un, { children: /* @__PURE__ */ l(St, { icon: "hourglass_empty", message: "Loading video..." }) });
651
- return s.status === "loading" ? i : /* @__PURE__ */ l(bo, { fallback: i, children: /* @__PURE__ */ l(
652
- hr,
650
+ const i = /* @__PURE__ */ c(mn, { children: /* @__PURE__ */ c(It, { icon: "hourglass_empty", message: "Loading video..." }) });
651
+ return s.status === "loading" ? i : /* @__PURE__ */ c(ko, { fallback: i, children: /* @__PURE__ */ c(
652
+ wr,
653
653
  {
654
654
  id: t,
655
655
  name: n,
@@ -662,20 +662,20 @@ const ar = ({
662
662
  codec: s.metadata.codec
663
663
  }
664
664
  ) });
665
- }, xr = {
665
+ }, Tr = {
666
666
  image: {
667
- component: mr,
667
+ component: yr,
668
668
  mimeTypes: ["image/"],
669
669
  fullPreviews: ["png", "jpg", "jpeg", "gif", "svg", "webp"],
670
670
  id: "image"
671
671
  },
672
672
  video: {
673
- component: wr,
673
+ component: Cr,
674
674
  mimeTypes: ["video/"],
675
675
  id: "video"
676
676
  },
677
677
  text: {
678
- component: gr,
678
+ component: br,
679
679
  mimeTypes: ["text/", "application/json", "scss", "jsx"],
680
680
  id: "text"
681
681
  },
@@ -683,11 +683,11 @@ const ar = ({
683
683
  component: null,
684
684
  mimeTypes: ["pdf"],
685
685
  id: "pdf",
686
- callback: (e) => window.open(dt(e.id, e.projectName), "_blank")
686
+ callback: (e) => window.open(ct(e.id, e.projectName), "_blank")
687
687
  }
688
- }, vt = (e = "", t = "") => Object.values(xr).some(
688
+ }, vt = (e = "", t = "") => Object.values(Tr).some(
689
689
  ({ mimeTypes: o = [] }) => o.some((n) => (e || t)?.includes(n))
690
- ), kr = {
690
+ ), Dr = {
691
691
  // special cases
692
692
  description: ["doc"],
693
693
  folder_zip: ["zip"],
@@ -729,12 +729,12 @@ const ar = ({
729
729
  filter_none: ["sequence"],
730
730
  font_download: ["font"],
731
731
  deployed_code: ["model", ".obj", ".abc", ".stl", ".fbx", ".gltf", ".glb", ".usd"]
732
- }, Ar = (e) => {
733
- for (const [t, o] of Object.entries(kr))
732
+ }, Nr = (e) => {
733
+ for (const [t, o] of Object.entries(Dr))
734
734
  if (o.some((n) => e.includes(n)))
735
735
  return t;
736
736
  return "draft";
737
- }, Fr = ({
737
+ }, Ir = ({
738
738
  name: e,
739
739
  mime: t,
740
740
  src: o,
@@ -743,31 +743,31 @@ const ar = ({
743
743
  annotationFrameStart: r,
744
744
  size: s,
745
745
  progress: i,
746
- onRemove: c,
746
+ onRemove: l,
747
747
  isCompact: m,
748
748
  isDownloadable: p = !1,
749
749
  onExpand: g,
750
750
  disableExpand: u,
751
751
  onJumpTo: h,
752
- className: v,
752
+ className: b,
753
753
  ...y
754
754
  }) => {
755
- const D = i && i < 100, [P, C] = L(!1), [f, b] = L(!1), { feedAnnotationsEnabled: T } = ze(), { entities: I } = $e(), _ = e.split("."), R = _.pop() || "", E = _.join("."), N = vt(t || "." + R), Q = t?.includes("image/") || !!n, H = !!t?.includes("video/") && !n && o ? `${o}/thumbnail` : void 0, J = /* @__PURE__ */ k(Ce, { children: [
756
- /* @__PURE__ */ l("span", { className: "size", children: No(s) }),
757
- /* @__PURE__ */ l(se, { icon: "download", className: "download-icon" })
758
- ] }), q = S(
755
+ const D = i && i < 100, [M, C] = L(!1), [f, w] = L(!1), { feedAnnotationsEnabled: A } = Be(), { entities: S } = $e(), P = e.split("."), _ = P.pop() || "", E = P.join("."), N = vt(t || "." + _), G = t?.includes("image/") || !!n, Q = !!t?.includes("video/") && !n && o ? `${o}/thumbnail` : void 0, Z = /* @__PURE__ */ x(Te, { children: [
756
+ /* @__PURE__ */ c("span", { className: "size", children: Eo(s) }),
757
+ /* @__PURE__ */ c(se, { icon: "download", className: "download-icon" })
758
+ ] }), Y = I(
759
759
  () => n ?? a,
760
760
  [n, a]
761
- ), $ = S(() => I.at(0), [I]), te = S(() => {
762
- if (!q?.range)
761
+ ), $ = I(() => S.at(0), [S]), oe = I(() => {
762
+ if (!Y?.range)
763
763
  return [1, 1];
764
- const oe = r === void 0 ? $?.attrib?.frameStart : r;
765
- return Number.isFinite(oe) ? [oe - 1 + q.range[0], oe - 1 + q.range[1]] : q.range;
766
- }, [q, r, $]);
767
- return /* @__PURE__ */ k(
768
- ir,
764
+ const ae = r === void 0 ? $?.attrib?.frameStart : r;
765
+ return Number.isFinite(ae) ? [ae - 1 + Y.range[0], ae - 1 + Y.range[1]] : Y.range;
766
+ }, [Y, r, $]);
767
+ return /* @__PURE__ */ x(
768
+ ur,
769
769
  {
770
- className: ee(v, {
770
+ className: ne(b, {
771
771
  compact: m,
772
772
  isDownloadable: p,
773
773
  isPreviewable: N,
@@ -775,51 +775,51 @@ const ar = ({
775
775
  }),
776
776
  ...y,
777
777
  children: [
778
- /* @__PURE__ */ k(
779
- cr,
778
+ /* @__PURE__ */ x(
779
+ pr,
780
780
  {
781
- className: ee("content-wrapper", {
781
+ className: ne("content-wrapper", {
782
782
  isPreviewable: N,
783
783
  isUnsavedAnnotation: !!n
784
784
  }),
785
785
  children: [
786
- /* @__PURE__ */ l(se, { icon: Ar(t || "." + R), className: "type-icon" }),
787
- Q && o && /* @__PURE__ */ l(
788
- ln,
786
+ /* @__PURE__ */ c(se, { icon: Nr(t || "." + _), className: "type-icon" }),
787
+ G && o && /* @__PURE__ */ c(
788
+ dn,
789
789
  {
790
- className: ee({
790
+ className: ne({
791
791
  "image-wrapper": !0,
792
792
  isDownloadable: p || N || n
793
793
  }),
794
- children: /* @__PURE__ */ l(
794
+ children: /* @__PURE__ */ c(
795
795
  "img",
796
796
  {
797
797
  src: o,
798
798
  onError: () => C(!0),
799
799
  style: {
800
- display: P ? "none" : "block"
800
+ display: M ? "none" : "block"
801
801
  }
802
802
  }
803
803
  )
804
804
  }
805
805
  ),
806
- H && /* @__PURE__ */ k(
807
- ln,
806
+ Q && /* @__PURE__ */ x(
807
+ dn,
808
808
  {
809
- className: ee({
809
+ className: ne({
810
810
  "image-wrapper": !0,
811
811
  isDownloadable: p || N,
812
812
  posterError: f
813
813
  }),
814
814
  children: [
815
- !f && /* @__PURE__ */ l("img", { src: H, onError: () => b(!0) }),
816
- /* @__PURE__ */ l(dr, {})
815
+ !f && /* @__PURE__ */ c("img", { src: Q, onError: () => w(!0) }),
816
+ /* @__PURE__ */ c(hr, {})
817
817
  ]
818
818
  }
819
819
  ),
820
- /* @__PURE__ */ k(lr, { className: "expand-buttons", children: [
821
- N && !u && /* @__PURE__ */ l(
822
- dn,
820
+ /* @__PURE__ */ x(gr, { className: "expand-buttons", children: [
821
+ N && !u && /* @__PURE__ */ c(
822
+ un,
823
823
  {
824
824
  "data-tooltip": "Open preview",
825
825
  icon: "open_in_full",
@@ -827,8 +827,8 @@ const ar = ({
827
827
  onClick: g
828
828
  }
829
829
  ),
830
- (n || T && a) && /* @__PURE__ */ l(
831
- dn,
830
+ (n || A && a) && /* @__PURE__ */ c(
831
+ un,
832
832
  {
833
833
  "data-tooltip": "Jump to annotation",
834
834
  icon: "play_circle",
@@ -840,36 +840,36 @@ const ar = ({
840
840
  ]
841
841
  }
842
842
  ),
843
- /* @__PURE__ */ k(
844
- sr,
843
+ /* @__PURE__ */ x(
844
+ mr,
845
845
  {
846
- className: ee({
846
+ className: ne({
847
847
  inProgress: D,
848
848
  isPreviewable: N && !u,
849
849
  isDownloadable: p
850
850
  }),
851
851
  children: [
852
- /* @__PURE__ */ l("span", { className: "progress", style: { right: `${100 - i}%` } }),
853
- /* @__PURE__ */ l("div", { className: "name-wrapper", children: q ? /* @__PURE__ */ k("span", { className: "name", children: [
854
- /* @__PURE__ */ l(se, { icon: "draw" }),
855
- te[0],
856
- te[1] !== te[0] && ` - ${te[1]}`
857
- ] }) : /* @__PURE__ */ k("span", { className: "name", children: [
852
+ /* @__PURE__ */ c("span", { className: "progress", style: { right: `${100 - i}%` } }),
853
+ /* @__PURE__ */ c("div", { className: "name-wrapper", children: Y ? /* @__PURE__ */ x("span", { className: "name", children: [
854
+ /* @__PURE__ */ c(se, { icon: "draw" }),
855
+ oe[0],
856
+ oe[1] !== oe[0] && ` - ${oe[1]}`
857
+ ] }) : /* @__PURE__ */ x("span", { className: "name", children: [
858
858
  E,
859
- /* @__PURE__ */ k("span", { className: "extension", children: [
859
+ /* @__PURE__ */ x("span", { className: "extension", children: [
860
860
  ".",
861
- R
861
+ _
862
862
  ] })
863
863
  ] }) }),
864
- p && (c ? /* @__PURE__ */ l("div", { className: "download", children: J }) : /* @__PURE__ */ l("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "download", children: J }))
864
+ p && (l ? /* @__PURE__ */ c("div", { className: "download", children: Z }) : /* @__PURE__ */ c("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "download", children: Z }))
865
865
  ]
866
866
  }
867
867
  ),
868
- c && /* @__PURE__ */ l(ct, { className: "remove", onClick: c, icon: "close" })
868
+ l && /* @__PURE__ */ c(st, { className: "remove", onClick: l, icon: "close" })
869
869
  ]
870
870
  }
871
871
  );
872
- }, Pn = ({
872
+ }, _n = ({
873
873
  files: e = [],
874
874
  activityId: t,
875
875
  isCompact: o,
@@ -878,26 +878,26 @@ const ar = ({
878
878
  projectName: r,
879
879
  isDownloadable: s,
880
880
  onExpand: i,
881
- onAnnotationClick: c,
881
+ onAnnotationClick: l,
882
882
  pt: m,
883
883
  ...p
884
884
  }) => {
885
885
  if (!e.length) return null;
886
- const g = qe(
886
+ const g = Je(
887
887
  (u) => {
888
- const h = e.filter((y) => vt(y.mime, y.ext)), v = h.findIndex((y) => y.id === e[u].id);
889
- i?.({ files: h, index: v, activityId: t || "" });
888
+ const h = e.filter((y) => vt(y.mime, y.ext)), b = h.findIndex((y) => y.id === e[u].id);
889
+ i?.({ files: h, index: b, activityId: t || "" });
890
890
  },
891
891
  [i]
892
892
  );
893
- return /* @__PURE__ */ l(rr, { className: ee({ compact: o }), ...p, children: e.map((u, h) => /* @__PURE__ */ l(
894
- Fr,
893
+ return /* @__PURE__ */ c(dr, { className: ne({ compact: o }), ...p, children: e.map((u, h) => /* @__PURE__ */ c(
894
+ Ir,
895
895
  {
896
896
  id: u.id || u.name,
897
897
  name: u.name,
898
898
  mime: u.mime || u.type,
899
899
  size: u.size,
900
- src: u.unsavedAnnotation ? u.thumbnail : u.id ? dt(u.id, r) : void 0,
900
+ src: u.unsavedAnnotation ? u.thumbnail : u.id ? ct(u.id, r) : void 0,
901
901
  unsavedAnnotation: u.unsavedAnnotation,
902
902
  savedAnnotation: u.annotation,
903
903
  progress: u.progress,
@@ -905,13 +905,13 @@ const ar = ({
905
905
  isCompact: o,
906
906
  isDownloadable: s,
907
907
  onExpand: () => g(h),
908
- onJumpTo: () => c?.(u),
908
+ onJumpTo: () => l?.(u),
909
909
  disableExpand: n,
910
910
  ...m?.file
911
911
  },
912
912
  u.id || u.name
913
913
  )) });
914
- }, Cr = (e) => {
914
+ }, Sr = (e) => {
915
915
  const t = /!\[.*?\]\((.*?)\)/g, o = e.match(t);
916
916
  let n = e;
917
917
  return o && o.forEach((a) => {
@@ -919,46 +919,46 @@ const ar = ({
919
919
  const r = a.match(/\(([^)]+)\)/)[1], s = r.split("?")[0];
920
920
  n = e.replace(r, s);
921
921
  }), n;
922
- }, Tr = new AbortController(), Dr = $t.CancelToken, Nr = Dr.source(), We = (e, t, o) => new Promise((n, a) => {
922
+ }, Er = new AbortController(), Mr = Vt.CancelToken, Pr = Mr.source(), Xe = (e, t, o) => new Promise((n, a) => {
923
923
  new FormData().append("image", e);
924
924
  const s = {
925
- signal: Tr.signal,
926
- cancelToken: Nr.token,
925
+ signal: Er.signal,
926
+ cancelToken: Pr.token,
927
927
  onUploadProgress: (i) => o && o(i, e),
928
928
  headers: {
929
929
  "Content-Type": e.type,
930
- "x-file-name": be(e.name)
930
+ "x-file-name": ve(e.name)
931
931
  }
932
932
  };
933
- $t.post(`/api/projects/${t}/files`, e, s).then((i) => {
933
+ Vt.post(`/api/projects/${t}/files`, e, s).then((i) => {
934
934
  n({ file: e, data: i.data });
935
935
  }).catch((i) => {
936
936
  console.error(i), a({ message: "Upload failed: " + i.response.data.detail });
937
937
  });
938
- }), Sr = (e, t, o, n, a) => {
938
+ }), _r = (e, t, o, n, a) => {
939
939
  e.preventDefault(), e.stopPropagation();
940
940
  let r = e.dataTransfer.files;
941
941
  if (r?.length) {
942
942
  if (r.length === 0) return;
943
943
  for (const s of r)
944
- We(s, t, o).then(
944
+ Xe(s, t, o).then(
945
945
  (i) => n(i),
946
946
  (i) => {
947
- a && a(s), Fe.error(i.message), console.warn(i);
947
+ a && a(s), Ce.error(i.message), console.warn(i);
948
948
  }
949
949
  );
950
950
  }
951
- }, Ir = (e, t, o) => (t || console.warn("filterEntityAnnotations: entityId is empty"), Object.values(e).forEach((n) => {
951
+ }, Rr = (e, t, o) => (t || console.warn("filterEntityAnnotations: entityId is empty"), Object.values(e).forEach((n) => {
952
952
  n.versionId || console.warn("filterEntityAnnotations: annotation.versionId is empty", n);
953
953
  }), Object.values(e).filter(
954
- (n) => n.versionId === t && !o.some((a) => a.name === be(n.name))
954
+ (n) => n.versionId === t && !o.some((a) => a.name === ve(n.name))
955
955
  ).map((n) => ({
956
956
  ...n,
957
957
  unsavedAnnotation: n
958
- }))), Er = ({ entityId: e, filesUploading: t }) => {
959
- const { editingId: o, setEditingId: n, annotations: a, removeAnnotation: r } = $e(), { onGoToFrame: s } = ze(), i = Ir(a || [], e, t);
960
- return G(() => {
961
- i.length > 0 && !o && n(it);
958
+ }))), Lr = ({ entityId: e, filesUploading: t }) => {
959
+ const { editingId: o, setEditingId: n, annotations: a, removeAnnotation: r } = $e(), { onGoToFrame: s } = Be(), i = Rr(a || [], e, t);
960
+ return W(() => {
961
+ i.length > 0 && !o && n(rt);
962
962
  }, [i]), {
963
963
  annotations: i,
964
964
  goToAnnotation: (m) => {
@@ -967,101 +967,101 @@ const ar = ({
967
967
  },
968
968
  removeAnnotation: r
969
969
  };
970
- }, _n = (e) => S(() => {
970
+ }, Rn = (e) => I(() => {
971
971
  if (!e)
972
972
  return { primary: void 0, secondary: void 0 };
973
- const t = getComputedStyle(document.documentElement), o = t.getPropertyValue("--md-sys-color-surface-container").trim(), n = t.getPropertyValue("--md-sys-color-surface-container-high").trim(), a = o || e, r = n || e, s = rn(e, a, 0.1) || e, i = rn(e, r, 0.2) || e;
973
+ const t = getComputedStyle(document.documentElement), o = t.getPropertyValue("--md-sys-color-surface-container").trim(), n = t.getPropertyValue("--md-sys-color-surface-container-high").trim(), a = o || e, r = n || e, s = cn(e, a, 0.1) || e, i = cn(e, r, 0.2) || e;
974
974
  return {
975
975
  primary: s,
976
976
  secondary: i
977
977
  };
978
- }, [e]), Mr = ({ projectName: e, onSuccess: t, onProgress: o, onStart: n, onError: a }) => {
979
- const { exportAnnotationComposite: r } = $e(), s = async (c) => {
980
- const m = await r?.(c.id);
978
+ }, [e]), $r = ({ projectName: e, onSuccess: t, onProgress: o, onStart: n, onError: a }) => {
979
+ const { exportAnnotationComposite: r } = $e(), s = async (l) => {
980
+ const m = await r?.(l.id);
981
981
  if (!m)
982
- throw new Error(`Exporting composite image for annotation ${c.id} failed`);
983
- const p = new File([m], c.name, {
982
+ throw new Error(`Exporting composite image for annotation ${l.id} failed`);
983
+ const p = new File([m], l.name, {
984
984
  type: "image/png"
985
- }), g = await fetch(c.annotationData).then((P) => P.blob()), u = new File([g], `annotation-${c.name}`, {
985
+ }), g = await fetch(l.annotationData).then((M) => M.blob()), u = new File([g], `annotation-${l.name}`, {
986
986
  type: "image/png"
987
987
  }), h = await Promise.all([
988
- We(p, e, o),
989
- We(u, e, () => {
988
+ Xe(p, e, o),
989
+ Xe(u, e, () => {
990
990
  })
991
- ]), [v, y] = h, D = [t(v), t(y, !0)];
992
- return { annotation: c, uploads: h, files: D };
991
+ ]), [b, y] = h, D = [t(b), t(y, !0)];
992
+ return { annotation: l, uploads: h, files: D };
993
993
  };
994
- return async (c) => {
994
+ return async (l) => {
995
995
  try {
996
- const m = c.map(async (h) => {
996
+ const m = l.map(async (h) => {
997
997
  n?.(h);
998
998
  try {
999
999
  return await s(h);
1000
- } catch (v) {
1001
- throw a?.(h), v;
1000
+ } catch (b) {
1001
+ throw a?.(h), b;
1002
1002
  }
1003
1003
  }), p = await Promise.allSettled(m), g = [], u = [];
1004
1004
  return p.forEach((h) => {
1005
1005
  if (h.status === "fulfilled") {
1006
- const { uploads: v, annotation: y, files: D } = h.value;
1006
+ const { uploads: b, annotation: y, files: D } = h.value;
1007
1007
  g.push(...D), u.push({
1008
1008
  range: y.range,
1009
1009
  id: y.id,
1010
- composite: v[0].data.id,
1011
- transparent: v[1].data.id
1010
+ composite: b[0].data.id,
1011
+ transparent: b[1].data.id
1012
1012
  });
1013
1013
  } else
1014
- Fe.error("Upload failed: " + h.reason.message);
1014
+ Ce.error("Upload failed: " + h.reason.message);
1015
1015
  }), { files: g, metadata: u };
1016
1016
  } catch (m) {
1017
- return Fe.error("Upload failed: " + m.message), { files: [], metadata: [] };
1017
+ return Ce.error("Upload failed: " + m.message), { files: [], metadata: [] };
1018
1018
  }
1019
1019
  };
1020
- }, Rn = "ayon-comment-draft/", Ln = 720 * 60 * 60 * 1e3, Pr = (e) => !e.text.trim() && !e.files.length && !e.uploadedAnnotations.length, $n = (e) => {
1020
+ }, Ln = "ayon-comment-draft/", $n = 720 * 60 * 60 * 1e3, Or = (e) => !e.text.trim() && !e.files.length && !e.uploadedAnnotations.length, On = (e) => {
1021
1021
  try {
1022
1022
  const t = localStorage.getItem(e);
1023
1023
  return t ? JSON.parse(t) : null;
1024
1024
  } catch {
1025
1025
  return null;
1026
1026
  }
1027
- }, _r = (e, t) => {
1027
+ }, Vr = (e, t) => {
1028
1028
  try {
1029
- Pr(t) ? localStorage.removeItem(e) : localStorage.setItem(e, JSON.stringify({ ...t, savedAt: Date.now() }));
1029
+ Or(t) ? localStorage.removeItem(e) : localStorage.setItem(e, JSON.stringify({ ...t, savedAt: Date.now() }));
1030
1030
  } catch (o) {
1031
1031
  console.warn("Could not save comment draft", o);
1032
1032
  }
1033
- }, Rr = () => {
1033
+ }, jr = () => {
1034
1034
  try {
1035
1035
  const e = Date.now();
1036
1036
  for (const t of Object.keys(localStorage)) {
1037
- if (!t.startsWith(Rn)) continue;
1038
- const o = $n(t);
1039
- (!o || e - o.savedAt > Ln) && localStorage.removeItem(t);
1037
+ if (!t.startsWith(Ln)) continue;
1038
+ const o = On(t);
1039
+ (!o || e - o.savedAt > $n) && localStorage.removeItem(t);
1040
1040
  }
1041
1041
  } catch {
1042
1042
  }
1043
- }, Lr = (e, t, o) => e && t && o.length ? `${Rn}${e}/${t}/${[...o].sort().join(",")}` : null, $r = ({ draftKey: e, draft: t, paused: o, restore: n }) => {
1044
- const a = ge(null), r = ge(!1);
1045
- G(() => {
1043
+ }, Ur = (e, t, o) => e && t && o.length ? `${Ln}${e}/${t}/${[...o].sort().join(",")}` : null, zr = ({ draftKey: e, draft: t, paused: o, restore: n }) => {
1044
+ const a = pe(null), r = pe(!1);
1045
+ W(() => {
1046
1046
  if (!e || o) return;
1047
1047
  const s = a.current;
1048
1048
  if (a.current = e, s === e) return;
1049
- s || Rr();
1050
- const i = $n(e);
1051
- i && Date.now() - i.savedAt <= Ln ? (r.current = !0, n({
1049
+ s || jr();
1050
+ const i = On(e);
1051
+ i && Date.now() - i.savedAt <= $n ? (r.current = !0, n({
1052
1052
  text: i.text ?? "",
1053
1053
  files: i.files ?? [],
1054
1054
  uploadedAnnotations: i.uploadedAnnotations ?? [],
1055
1055
  category: i.category ?? null
1056
1056
  })) : s && (r.current = !0, n({ text: "", files: [], uploadedAnnotations: [], category: t.category }));
1057
- }, [e, o]), G(() => {
1057
+ }, [e, o]), W(() => {
1058
1058
  if (r.current) {
1059
1059
  r.current = !1;
1060
1060
  return;
1061
1061
  }
1062
- !e || o || _r(e, t);
1062
+ !e || o || Vr(e, t);
1063
1063
  }, [e, o, t.text, t.files, t.uploadedAnnotations, t.category]);
1064
- }, Or = "Category", Vr = F.div`
1064
+ }, Br = "Category", Gr = F.div`
1065
1065
  display: flex;
1066
1066
  padding: 2px 4px;
1067
1067
  justify-content: center;
@@ -1087,7 +1087,7 @@ const ar = ({
1087
1087
 
1088
1088
  &.compact {
1089
1089
  padding: 1px 2px;
1090
- ${Cn.labelMedium}
1090
+ ${Tn.labelMedium}
1091
1091
  }
1092
1092
 
1093
1093
  &.editing {
@@ -1110,13 +1110,13 @@ const ar = ({
1110
1110
  color: var(--md-sys-color-tertiary);
1111
1111
  }
1112
1112
  }
1113
- `, st = ft(
1114
- ({ value: e, color: t, isCompact: o, isEditing: n, isPower: a, isDisabled: r, style: s, className: i, ...c }, m) => /* @__PURE__ */ l(
1115
- Vr,
1113
+ `, it = ft(
1114
+ ({ value: e, color: t, isCompact: o, isEditing: n, isPower: a, isDisabled: r, style: s, className: i, ...l }, m) => /* @__PURE__ */ c(
1115
+ Gr,
1116
1116
  {
1117
- ...c,
1117
+ ...l,
1118
1118
  ref: m,
1119
- className: ee(i, {
1119
+ className: ne(i, {
1120
1120
  none: !e,
1121
1121
  compact: o,
1122
1122
  editing: n,
@@ -1128,13 +1128,13 @@ const ar = ({
1128
1128
  ...t && {
1129
1129
  backgroundColor: t,
1130
1130
  borderColor: t,
1131
- color: _t(t)
1131
+ color: Lt(t)
1132
1132
  }
1133
1133
  },
1134
- children: e || Or
1134
+ children: e || Br
1135
1135
  }
1136
1136
  )
1137
- ), jr = F.span`
1137
+ ), Hr = F.span`
1138
1138
  display: flex;
1139
1139
  justify-content: flex-start;
1140
1140
  align-items: center;
@@ -1153,7 +1153,7 @@ const ar = ({
1153
1153
  color: var(--md-sys-color-on-surface) !important;
1154
1154
  }
1155
1155
  }
1156
- `, Ur = ft(
1156
+ `, qr = ft(
1157
1157
  ({
1158
1158
  label: e,
1159
1159
  color: t,
@@ -1163,18 +1163,18 @@ const ar = ({
1163
1163
  endContent: r,
1164
1164
  isClear: s,
1165
1165
  style: i,
1166
- className: c,
1166
+ className: l,
1167
1167
  ...m
1168
- }, p) => /* @__PURE__ */ k(
1169
- jr,
1168
+ }, p) => /* @__PURE__ */ x(
1169
+ Hr,
1170
1170
  {
1171
1171
  ...m,
1172
- className: ee(c, { selected: n }),
1173
- style: { backgroundColor: n && t ? t : "", color: _t(n && t ? t : ""), ...i },
1172
+ className: ne(l, { selected: n }),
1173
+ style: { backgroundColor: n && t ? t : "", color: Lt(n && t ? t : ""), ...i },
1174
1174
  ref: p,
1175
1175
  children: [
1176
1176
  a,
1177
- /* @__PURE__ */ l(
1177
+ /* @__PURE__ */ c(
1178
1178
  se,
1179
1179
  {
1180
1180
  icon: o || (s ? "clear" : "crop_square"),
@@ -1186,7 +1186,7 @@ const ar = ({
1186
1186
  ]
1187
1187
  }
1188
1188
  )
1189
- ), zr = "1.3.0", Br = F(So)`
1189
+ ), Wr = "1.3.0", Qr = F(Mo)`
1190
1190
  button {
1191
1191
  /* remove all styles and just use a wrapper */
1192
1192
  background-color: unset !important;
@@ -1197,7 +1197,7 @@ const ar = ({
1197
1197
  width: unset !important;
1198
1198
  color: var(--md-sys-color-on-surface) !important;
1199
1199
  }
1200
- `, Gr = ({
1200
+ `, Yr = ({
1201
1201
  value: e,
1202
1202
  categories: t,
1203
1203
  readonly: o,
@@ -1206,34 +1206,34 @@ const ar = ({
1206
1206
  hasPowerpack: r,
1207
1207
  onPowerFeature: s,
1208
1208
  onChange: i,
1209
- ...c
1209
+ ...l
1210
1210
  }) => {
1211
1211
  if (n) return null;
1212
1212
  const m = t.find((u) => u.name === e), { color: p } = m || {};
1213
1213
  if (!r)
1214
- return /* @__PURE__ */ l(
1215
- st,
1214
+ return /* @__PURE__ */ c(
1215
+ it,
1216
1216
  {
1217
1217
  value: null,
1218
1218
  isPower: !0,
1219
1219
  isDisabled: !0,
1220
- style: c.style,
1220
+ style: l.style,
1221
1221
  onClick: () => s?.("commentCategories"),
1222
1222
  "data-tooltip": "Comment categories is a Powerpack feature"
1223
1223
  }
1224
1224
  );
1225
1225
  if (o)
1226
- return /* @__PURE__ */ l(st, { value: e, color: p, isCompact: a, style: c.style });
1226
+ return /* @__PURE__ */ c(it, { value: e, color: p, isCompact: a, style: l.style });
1227
1227
  if (!t.length)
1228
- return /* @__PURE__ */ l(
1229
- st,
1228
+ return /* @__PURE__ */ c(
1229
+ it,
1230
1230
  {
1231
1231
  value: e,
1232
1232
  color: p,
1233
1233
  isCompact: a,
1234
- style: c.style,
1235
- onClick: () => Fe.warning(
1236
- `No categories found. Ensure they are set in the Powerpack settings and the version is at least ${zr}.`
1234
+ style: l.style,
1235
+ onClick: () => Ce.warning(
1236
+ `No categories found. Ensure they are set in the Powerpack settings and the version is at least ${Wr}.`
1237
1237
  )
1238
1238
  }
1239
1239
  );
@@ -1246,48 +1246,48 @@ const ar = ({
1246
1246
  icon: null
1247
1247
  }))
1248
1248
  ];
1249
- return /* @__PURE__ */ l(
1250
- Br,
1249
+ return /* @__PURE__ */ c(
1250
+ Qr,
1251
1251
  {
1252
1252
  options: g,
1253
1253
  value: e ? [e] : [],
1254
1254
  onChange: (u) => i(u[0]),
1255
- valueTemplate: () => /* @__PURE__ */ l(st, { value: e, color: p, isCompact: a, isEditing: !0 }),
1256
- itemTemplate: (u, h, v, y) => /* @__PURE__ */ l(
1257
- Ur,
1255
+ valueTemplate: () => /* @__PURE__ */ c(it, { value: e, color: p, isCompact: a, isEditing: !0 }),
1256
+ itemTemplate: (u, h, b, y) => /* @__PURE__ */ c(
1257
+ qr,
1258
1258
  {
1259
1259
  label: u.label,
1260
1260
  color: u.color,
1261
- isSelected: v,
1261
+ isSelected: b,
1262
1262
  isClear: u.value === null
1263
1263
  },
1264
1264
  y
1265
1265
  ),
1266
- ...c
1266
+ ...l
1267
1267
  }
1268
1268
  );
1269
- }, Hr = (e, { isGuest: t, isAdmin: o }) => !!(t || !e.length && !o), qr = ["tip", "status"], Wr = ["textDirective", "leafDirective", "containerDirective"], On = (e) => ({ type: "text", value: e }), Ft = (e) => ({ type: "paragraph", children: [On(e)] }), Qr = (e, t) => {
1269
+ }, Jr = (e, { isGuest: t, isAdmin: o }) => !!(t || !e.length && !o), Kr = ["tip", "status"], Xr = ["textDirective", "leafDirective", "containerDirective"], Vn = (e) => ({ type: "text", value: e }), Ft = (e) => ({ type: "paragraph", children: [Vn(e)] }), Zr = (e, t) => {
1270
1270
  const o = e.position?.start.offset, n = e.position?.end.offset;
1271
1271
  return o === void 0 || n === void 0 ? null : t.slice(o, n);
1272
- }, Yr = (e, t) => {
1273
- const o = Qr(e, t);
1272
+ }, ei = (e, t) => {
1273
+ const o = Zr(e, t);
1274
1274
  if (o === null) return null;
1275
- if (e.type === "textDirective") return [On(o)];
1275
+ if (e.type === "textDirective") return [Vn(o)];
1276
1276
  if (e.type === "leafDirective") return [Ft(o)];
1277
1277
  const [n, ...a] = o.split(`
1278
1278
  `), r = a.length ? a[a.length - 1].match(/:{3,}\s*$/) : null;
1279
1279
  return [Ft(n), ...e.children || [], ...r ? [Ft(r[0])] : []];
1280
- }, Vn = (e, t, o) => {
1280
+ }, jn = (e, t, o) => {
1281
1281
  if (!e.children) return;
1282
1282
  const n = [];
1283
1283
  for (const a of e.children) {
1284
- const s = Wr.includes(a.type) && !o.includes(a.name || "") ? Yr(a, t) : null;
1284
+ const s = Xr.includes(a.type) && !o.includes(a.name || "") ? ei(a, t) : null;
1285
1285
  n.push(...s || [a]);
1286
1286
  }
1287
- e.children = n, n.forEach((a) => Vn(a, t, o));
1288
- }, Jr = (e = qr) => (t, o) => {
1289
- Vn(t, String(o.value ?? ""), e);
1290
- }, jn = 1e4, Kr = F.span`
1287
+ e.children = n, n.forEach((a) => jn(a, t, o));
1288
+ }, ti = (e = Kr) => (t, o) => {
1289
+ jn(t, String(o.value ?? ""), e);
1290
+ }, Un = 1e4, ni = F.span`
1291
1291
  margin-left: auto;
1292
1292
  color: var(--md-sys-color-outline);
1293
1293
  user-select: none;
@@ -1300,99 +1300,99 @@ const ar = ({
1300
1300
  min-width: 0;
1301
1301
  max-width: fit-content;
1302
1302
 
1303
- ${Cn.bodySmall}
1304
- `, ut = ({ date: e, isExact: t, exactTooltip: o = !1, ...n }) => {
1303
+ ${Tn.bodySmall}
1304
+ `, lt = ({ date: e, isExact: t, exactTooltip: o = !1, ...n }) => {
1305
1305
  const [a, r] = L(!0), [s, i] = L(/* @__PURE__ */ new Date());
1306
1306
  if (!e) return null;
1307
- const c = new Date(e);
1308
- if (!lt(c)) return null;
1309
- G(() => {
1310
- const b = setInterval(
1307
+ const l = new Date(e);
1308
+ if (!Ke(l)) return null;
1309
+ W(() => {
1310
+ const w = setInterval(
1311
1311
  () => i(/* @__PURE__ */ new Date()),
1312
- jn
1312
+ Un
1313
1313
  );
1314
- return () => clearInterval(b);
1314
+ return () => clearInterval(w);
1315
1315
  }, []);
1316
- const m = Va(c), p = ja(c, s), g = Ua(c, new Date(s.setDate(s.getDate() - 1))), u = za(c, s), h = Ba(c, s), v = g ? "" : p ? u ? "E" : "MMM d" : "MMM d yyyy", y = "h:mm a", D = S(() => Nn(c), [c]), P = S(() => m ? sn(c, `${v}, ${y}`) : sn(c, `EEEE, dd MMM yyyy ${y}`), [c, m]);
1317
- let C = a && !t ? D : P;
1316
+ const m = Ga(l), p = Ha(l, s), g = qa(l, new Date(s.setDate(s.getDate() - 1))), u = Wa(l, s), h = Qa(l, s), b = g ? "" : p ? u ? "E" : "MMM d" : "MMM d yyyy", y = "h:mm a", D = I(() => In(l), [l]), M = I(() => m ? St(l, `${b}, ${y}`) : St(l, `EEEE, dd MMM yyyy ${y}`), [l, m]);
1317
+ let C = a && !t ? D : M;
1318
1318
  g && a && !t && (C = `Yesterday${C}`), h && (C = "Just now");
1319
1319
  const f = () => {
1320
1320
  r(!a);
1321
1321
  };
1322
- return /* @__PURE__ */ l(
1323
- Kr,
1322
+ return /* @__PURE__ */ c(
1323
+ ni,
1324
1324
  {
1325
- className: ee("date"),
1325
+ className: ne("date"),
1326
1326
  ...n,
1327
1327
  onClick: f,
1328
1328
  onMouseOver: () => !o && r(!1),
1329
1329
  onMouseOut: () => !o && r(!0),
1330
- "data-tooltip": o ? P : null,
1330
+ "data-tooltip": o ? M : null,
1331
1331
  "data-tooltip-delay": 0,
1332
1332
  children: C
1333
1333
  }
1334
1334
  );
1335
1335
  };
1336
- var Ne = /* @__PURE__ */ ((e) => (e.APPROVE = "approve", e.REQUEST_CHANGES = "request_changes", e))(Ne || {});
1337
- const Un = (e) => {
1336
+ var Se = /* @__PURE__ */ ((e) => (e.APPROVE = "approve", e.REQUEST_CHANGES = "request_changes", e))(Se || {});
1337
+ const zn = (e) => {
1338
1338
  switch (e) {
1339
- case Ne.REQUEST_CHANGES:
1339
+ case Se.REQUEST_CHANGES:
1340
1340
  return "requested changes";
1341
- case Ne.APPROVE:
1341
+ case Se.APPROVE:
1342
1342
  default:
1343
1343
  return "approved this";
1344
1344
  }
1345
- }, Xr = (e, t) => {
1345
+ }, oi = (e, t) => {
1346
1346
  switch (e) {
1347
- case Ne.REQUEST_CHANGES:
1347
+ case Se.REQUEST_CHANGES:
1348
1348
  return "Requested changes on " + t;
1349
- case Ne.APPROVE:
1349
+ case Se.APPROVE:
1350
1350
  default:
1351
1351
  return "Approved " + t;
1352
1352
  }
1353
- }, zn = (e) => {
1353
+ }, Bn = (e) => {
1354
1354
  switch (e) {
1355
- case Ne.REQUEST_CHANGES:
1355
+ case Se.REQUEST_CHANGES:
1356
1356
  return "refresh";
1357
- case Ne.APPROVE:
1357
+ case Se.APPROVE:
1358
1358
  default:
1359
1359
  return "task_alt";
1360
1360
  }
1361
- }, Zr = ({ lastOwnVersionReview: e }) => {
1361
+ }, ai = ({ lastOwnVersionReview: e }) => {
1362
1362
  const [t, o] = L(/* @__PURE__ */ new Date());
1363
- G(() => {
1364
- const r = setInterval(() => o(/* @__PURE__ */ new Date()), jn);
1363
+ W(() => {
1364
+ const r = setInterval(() => o(/* @__PURE__ */ new Date()), Un);
1365
1365
  return () => clearInterval(r);
1366
1366
  }, []);
1367
- const n = S(() => e?.activityData?.feedback, [e]), a = S(() => e?.createdAt ? Nn(new Date(e?.createdAt)).toLowerCase() : "", [e?.createdAt, t]);
1368
- return /* @__PURE__ */ k(_o, { className: xn(n), children: [
1369
- /* @__PURE__ */ l(se, { icon: zn(n) }),
1367
+ const n = I(() => e?.activityData?.feedback, [e]), a = I(() => e?.createdAt ? In(new Date(e?.createdAt)).toLowerCase() : "", [e?.createdAt, t]);
1368
+ return /* @__PURE__ */ x($o, { className: kn(n), children: [
1369
+ /* @__PURE__ */ c(se, { icon: Bn(n) }),
1370
1370
  "You last ",
1371
- Un(n),
1371
+ zn(n),
1372
1372
  " ",
1373
1373
  a,
1374
1374
  " ",
1375
1375
  a === "just now" ? "" : "ago"
1376
1376
  ] });
1377
- }, mn = (e) => {
1377
+ }, pn = (e) => {
1378
1378
  const t = /^(\d+)(?:\s*-\s*(\d+))?$/.exec(e.trim());
1379
1379
  if (!t) return null;
1380
1380
  const o = Number(t[1]), n = t[2] ? Number(t[2]) : o;
1381
1381
  return Number.isSafeInteger(o) && o > 0 && Number.isSafeInteger(n) && n >= o ? { startFrame: o, endFrame: n } : null;
1382
- }, It = (e) => typeof e == "number" && Number.isFinite(e) ? e - 1 : 0, Bn = (e, t) => String(e + It(t)), ei = (e, t) => {
1382
+ }, Et = (e) => typeof e == "number" && Number.isFinite(e) ? e - 1 : 0, Gn = (e, t) => String(e + Et(t)), ri = (e, t) => {
1383
1383
  if (!e) return null;
1384
- const o = e.startFrame - It(t), n = e.endFrame - It(t);
1384
+ const o = e.startFrame - Et(t), n = e.endFrame - Et(t);
1385
1385
  return o > 0 ? { startFrame: o, endFrame: n } : null;
1386
- }, pn = async (e, t, o, n, a) => {
1387
- const { data: r } = await $t.get(`/api/projects/${e}/files/${t}`, {
1386
+ }, gn = async (e, t, o, n, a) => {
1387
+ const { data: r } = await Vt.get(`/api/projects/${e}/files/${t}`, {
1388
1388
  responseType: "blob"
1389
1389
  }), s = new File([r], o, { type: n || r.type });
1390
- return We(s, e, a);
1391
- }, gn = (e, t) => `/api/projects/${e}/files/${t}`, hn = (e, t) => !!e && Rt(t).has(e), ti = [
1390
+ return Xe(s, e, a);
1391
+ }, hn = (e, t) => `/api/projects/${e}/files/${t}`, fn = (e, t) => !!e && $t(t).has(e), ii = [
1392
1392
  { trigger: "@", icon: "person", tooltip: "Mention user" },
1393
1393
  { trigger: "@@", icon: "layers", tooltip: "Mention version" },
1394
1394
  { trigger: "@@@", icon: "check_circle", tooltip: "Mention task" }
1395
- ], Gn = ({
1395
+ ], Hn = ({
1396
1396
  initValue: e,
1397
1397
  initFiles: t = [],
1398
1398
  annotationFrameStart: o,
@@ -1401,440 +1401,440 @@ const Un = (e) => {
1401
1401
  activityId: r,
1402
1402
  versionReview: s,
1403
1403
  lastOwnVersionReview: i,
1404
- onSubmit: c,
1404
+ onSubmit: l,
1405
1405
  onReview: m,
1406
1406
  duplicate: p,
1407
1407
  onDuplicateHandled: g,
1408
1408
  isEditing: u,
1409
1409
  disabled: h,
1410
- isLoading: v,
1410
+ isLoading: b,
1411
1411
  isOpen: y,
1412
1412
  onOpen: D,
1413
- onClose: P,
1413
+ onClose: M,
1414
1414
  saveDraft: C = !0
1415
1415
  }) => {
1416
1416
  const {
1417
1417
  projectName: f,
1418
- entities: b,
1419
- projectInfo: T,
1420
- feedFilter: I,
1421
- mentionSuggestionsData: _,
1422
- categories: R,
1418
+ entities: w,
1419
+ projectInfo: A,
1420
+ feedFilter: S,
1421
+ mentionSuggestionsData: P,
1422
+ categories: _,
1423
1423
  isGuest: E,
1424
1424
  userName: N,
1425
- editingId: Q
1426
- } = $e(), { hasLicense: Y, onPowerFeature: H, user: J, openSlideOut: q, commentFrameLink: $ } = ze(), te = J?.data?.isAdmin, oe = $a(), [, W] = In(), [U, de] = L(e || ""), [ae, ne] = L(
1425
+ editingId: G
1426
+ } = $e(), { hasLicense: X, onPowerFeature: Q, user: Z, openSlideOut: Y, commentFrameLink: $ } = Be(), oe = Z?.data?.isAdmin, ae = za(), [, J] = En(), [j, de] = L(e || ""), [H, ee] = L(
1427
1427
  () => t.map(
1428
- (d) => hn(d.id, e || "") ? { ...d, isInline: !0 } : d
1428
+ (d) => fn(d.id, e || "") ? { ...d, isInline: !0 } : d
1429
1429
  )
1430
- ), [Qe, we] = L(0), xe = ge(/* @__PURE__ */ new Map()), [ke, he] = L([]), [Me, K] = L(!1), [Te, Oe] = L(!1), [Se, De] = L([]), [Ye, Ve] = L([]), { annotations: fe, removeAnnotation: Be, goToAnnotation: Ge } = Er({
1431
- entityId: b[0]?.id,
1432
- filesUploading: ke
1433
- }), re = b.length === 1 && b[0].entityType === "version" ? b[0] : void 0, Je = $?.draft && $.draft.entityId === re?.id ? $.draft : null, [Pe, He] = L(
1430
+ ), [Oe, De] = L(0), Ve = pe(/* @__PURE__ */ new Map()), [be, ge] = L([]), [Ge, ue] = L(!1), [xe, he] = L(!1), [Ne, Ie] = L([]), [Ze, Re] = L([]), { annotations: fe, removeAnnotation: He, goToAnnotation: qe } = Lr({
1431
+ entityId: w[0]?.id,
1432
+ filesUploading: be
1433
+ }), re = w.length === 1 && w[0].entityType === "version" ? w[0] : void 0, et = $?.draft && $.draft.entityId === re?.id ? $.draft : null, [je, We] = L(
1434
1434
  () => u && Number.isSafeInteger(a?.startFrame) && a.startFrame > 0 ? {
1435
1435
  startFrame: a.startFrame,
1436
1436
  endFrame: Number.isSafeInteger(a.endFrame) && a.endFrame >= a.startFrame ? a.endFrame : a.startFrame
1437
1437
  } : null
1438
- ), _e = (d) => He(d && { ...d, entityId: re?.id }), je = u || Pe?.entityId === re?.id ? Pe : null, [Ae, Re] = L(!1), w = u ? je : je ?? Je, M = u ? !!re || !!je : !!$ && !!re, O = $?.formatFrame, X = O ?? ((d) => Bn(d, o)), ue = (d) => O ? mn(d) : ei(mn(d), o), A = w ? w.endFrame > w.startFrame ? `${X(w.startFrame)}-${X(w.endFrame)}` : X(w.startFrame) : void 0, [me, ye] = L(A ?? ""), Ie = ge(!1), Ee = ge(null), Le = (d) => {
1438
+ ), Ee = (d) => We(d && { ...d, entityId: re?.id }), Ue = u || je?.entityId === re?.id ? je : null, [ke, Me] = L(!1), q = u ? Ue : Ue ?? et, Pe = u ? !!re || !!Ue : !!$ && !!re, T = $?.formatFrame, R = T ?? ((d) => Gn(d, o)), U = (d) => T ? pn(d) : ri(pn(d), o), v = q ? q.endFrame > q.startFrame ? `${R(q.startFrame)}-${R(q.endFrame)}` : R(q.startFrame) : void 0, [K, we] = L(v ?? ""), Ae = pe(!1), Fe = pe(null), Le = (d) => {
1439
1439
  if (!re) return;
1440
- const x = d ? { ...d, entityId: re.id } : null;
1440
+ const k = d ? { ...d, entityId: re.id } : null;
1441
1441
  if (!u) {
1442
- $?.setDraft(x);
1442
+ $?.setDraft(k);
1443
1443
  return;
1444
1444
  }
1445
1445
  r && $?.setEditPreview({
1446
1446
  activityId: r,
1447
- link: x
1447
+ link: k
1448
1448
  });
1449
- }, Ke = (d) => {
1450
- ye(d);
1451
- const x = ue(d);
1452
- x && Le(x);
1449
+ }, jt = (d) => {
1450
+ we(d);
1451
+ const k = U(d);
1452
+ k && Le(k);
1453
1453
  };
1454
- G(() => {
1455
- Ae || ye(A ?? "");
1456
- }, [A, Ae]), G(
1454
+ W(() => {
1455
+ ke || we(v ?? "");
1456
+ }, [v, ke]), W(
1457
1457
  () => () => {
1458
1458
  u && $?.setEditPreview(null);
1459
1459
  },
1460
1460
  [u, $?.setEditPreview]
1461
1461
  );
1462
- const Xe = () => {
1463
- if (Ie.current) {
1464
- Ie.current = !1, ye(A ?? ""), Le(Ee.current), Re(!1);
1462
+ const dt = () => {
1463
+ if (Ae.current) {
1464
+ Ae.current = !1, we(v ?? ""), Le(Fe.current), Me(!1);
1465
1465
  return;
1466
1466
  }
1467
- const d = ue(me);
1468
- d ? (_e(d), Le(d)) : (ye(A ?? ""), Le(Ee.current)), Re(!1);
1469
- }, mt = () => {
1470
- _e(null), u ? Le(null) : $?.unlink();
1471
- }, Ze = () => {
1472
- !u && $ && re ? $.link(re.id) : (ye(""), Re(!0));
1473
- }, et = () => w ? mt() : Ze(), bt = S(() => {
1474
- if (!M || !u && !$ || !re) return;
1467
+ const d = U(K);
1468
+ d ? (Ee(d), Le(d)) : (we(v ?? ""), Le(Fe.current)), Me(!1);
1469
+ }, Qe = () => {
1470
+ Ee(null), u ? Le(null) : $?.unlink();
1471
+ }, Ye = () => {
1472
+ !u && $ && re ? $.link(re.id) : (we(""), Me(!0));
1473
+ }, bt = () => q ? Qe() : Ye(), ut = I(() => {
1474
+ if (!Pe || !u && !$ || !re) return;
1475
1475
  const d = ["frame", "time", "timecode", "link", "range"];
1476
1476
  return [
1477
- w ? {
1477
+ q ? {
1478
1478
  id: "frame-link",
1479
1479
  label: "Remove frame link",
1480
1480
  icon: "timer_off",
1481
1481
  keywords: [...d, "unlink", "remove"],
1482
- hint: A,
1483
- run: mt
1482
+ hint: v,
1483
+ run: Qe
1484
1484
  } : {
1485
1485
  id: "frame-link",
1486
1486
  label: u ? "Add frame link" : "Link to current frame",
1487
1487
  icon: "timer",
1488
1488
  keywords: d,
1489
- run: Ze
1489
+ run: Ye
1490
1490
  }
1491
1491
  ];
1492
- }, [M, u, $, re?.id, !!w, A]), [tt, Ot] = L(n);
1493
- $r({
1494
- draftKey: C && !u ? Lr(
1492
+ }, [Pe, u, $, re?.id, !!q, v]), [_e, mt] = L(n);
1493
+ zr({
1494
+ draftKey: C && !u ? Ur(
1495
1495
  f,
1496
1496
  N,
1497
- b.map((d) => d.id)
1497
+ w.map((d) => d.id)
1498
1498
  ) : null,
1499
- draft: { text: U, files: ae, uploadedAnnotations: Se, category: tt },
1500
- paused: Te,
1499
+ draft: { text: j, files: H, uploadedAnnotations: Ne, category: _e },
1500
+ paused: xe,
1501
1501
  restore: (d) => {
1502
- de(d.text), ne(d.files), De(d.uploadedAnnotations), Ot(d.category), (d.text.trim() || d.files.length || d.uploadedAnnotations.length) && !y && !Q && D?.();
1502
+ de(d.text), ee(d.files), Ie(d.uploadedAnnotations), mt(d.category), (d.text.trim() || d.files.length || d.uploadedAnnotations.length) && !y && !G && D?.();
1503
1503
  }
1504
1504
  });
1505
- const Vt = R.filter((d) => d.accessLevel >= 20), jt = R.find((d) => d.name === tt), Ut = _n(jt?.color), nt = ge(null), zt = ge(null), Bt = ge(null), pt = !!U.trim(), Zn = !pt && !ae.length && !ke.length && !Qe && !Se.length && !fe.length && !Te, Gt = !!I?.conditions?.some(
1505
+ const Ut = _.filter((d) => d.accessLevel >= 20), zt = _.find((d) => d.name === _e), Bt = Rn(zt?.color), tt = pe(null), Gt = pe(null), Ht = pe(null), pt = !!j.trim(), no = !pt && !H.length && !be.length && !Oe && !Ne.length && !fe.length && !xe, qt = !!S?.conditions?.some(
1506
1506
  (d) => "key" in d && d.key === "checklists" && d.value === !0
1507
1507
  );
1508
- G(() => {
1509
- if (!y || u || !Gt) return;
1510
- const d = nt.current;
1508
+ W(() => {
1509
+ if (!y || u || !qt) return;
1510
+ const d = tt.current;
1511
1511
  !d || !d.isEmpty() || d.getEditor().update(() => {
1512
- const x = Fo(!1);
1513
- To().clear().append(Co("check").append(x)), x.select();
1512
+ const k = Do(!1);
1513
+ Io().clear().append(No("check").append(k)), k.select();
1514
1514
  });
1515
- }, [y, u, Gt]);
1516
- const Ht = b[0]?.entityType, qt = oe?.productTypes, eo = S(
1515
+ }, [y, u, qt]);
1516
+ const Wt = w[0]?.entityType, Qt = ae?.productTypes, oo = I(
1517
1517
  () => E ? void 0 : {
1518
- ...Ro({
1519
- suggestions: _,
1520
- project: { productTypes: qt },
1521
- taskTypes: T?.taskTypes,
1522
- entityType: Ht
1518
+ ...Oo({
1519
+ suggestions: P,
1520
+ project: { productTypes: Qt },
1521
+ taskTypes: A?.taskTypes,
1522
+ entityType: Wt
1523
1523
  }),
1524
1524
  // keep the picker short
1525
1525
  limit: 5
1526
1526
  },
1527
- [E, _, qt, T?.taskTypes, Ht]
1528
- ), to = ({ type: d, id: x }) => {
1529
- d === "user" || d === "team" || q({ entityId: x, entityType: d, projectName: f });
1530
- }, no = ({ type: d, id: x, label: V }, j) => {
1531
- const { x: z, y: ce, width: le } = j.getBoundingClientRect();
1532
- W({ id: x, name: x, type: d, label: V, pos: { left: z + le / 2, top: ce } });
1533
- }, [oo, wt] = L(!1);
1534
- G(() => {
1527
+ [E, P, Qt, A?.taskTypes, Wt]
1528
+ ), ao = ({ type: d, id: k }) => {
1529
+ d === "user" || d === "team" || Y({ entityId: k, entityType: d, projectName: f });
1530
+ }, ro = ({ type: d, id: k, label: O }, V) => {
1531
+ const { x: z, y: ce, width: le } = V.getBoundingClientRect();
1532
+ J({ id: k, name: k, type: d, label: O, pos: { left: z + le / 2, top: ce } });
1533
+ }, [io, wt] = L(!1);
1534
+ W(() => {
1535
1535
  y || wt(!1);
1536
1536
  }, [y]);
1537
- const ao = () => {
1537
+ const so = () => {
1538
1538
  y || h || (wt(!0), D && D());
1539
- }, Wt = () => {
1540
- u && $?.setEditPreview(null), (!pt || u) && de(""), P && P(), Bt.current?.closest("#viewer-dialog")?.focus();
1541
- }, ot = ({ file: d, data: x }, V = !1) => {
1542
- const j = be(d.name), z = {
1543
- id: x.id,
1544
- name: j,
1539
+ }, Yt = () => {
1540
+ u && $?.setEditPreview(null), (!pt || u) && de(""), M && M(), Ht.current?.closest("#viewer-dialog")?.focus();
1541
+ }, nt = ({ file: d, data: k }, O = !1) => {
1542
+ const V = ve(d.name), z = {
1543
+ id: k.id,
1544
+ name: V,
1545
1545
  mime: d.type,
1546
1546
  size: d.size,
1547
- order: ae.length,
1548
- isAnnotationLayer: V
1547
+ order: H.length,
1548
+ isAnnotationLayer: O
1549
1549
  };
1550
- return ne((ce) => [...ce, z]), he(
1551
- (ce) => ce.filter((le) => be(le.name) !== j)
1550
+ return ee((ce) => [...ce, z]), ge(
1551
+ (ce) => ce.filter((le) => ve(le.name) !== V)
1552
1552
  ), z;
1553
- }, ro = (d, x, V) => {
1554
- V ? Be?.(d) : (ne((j) => j.filter((z) => z.id !== d)), he((j) => j.filter((z) => be(z.name) !== be(x))));
1555
- }, at = (d, x) => {
1556
- const V = Math.round(d.loaded * 100 / d.total);
1557
- if (V !== 100) {
1558
- const j = be(x.name);
1559
- he((z) => {
1560
- const ce = z.find((B) => be(B.name) === j), le = z.filter((B) => be(B.name) !== j), Ue = {
1561
- name: j,
1562
- progress: V,
1563
- type: x.type,
1564
- order: ce?.order ?? ae.length + z.length
1553
+ }, co = (d, k, O) => {
1554
+ O ? He?.(d) : (ee((V) => V.filter((z) => z.id !== d)), ge((V) => V.filter((z) => ve(z.name) !== ve(k))));
1555
+ }, ot = (d, k) => {
1556
+ const O = Math.round(d.loaded * 100 / d.total);
1557
+ if (O !== 100) {
1558
+ const V = ve(k.name);
1559
+ ge((z) => {
1560
+ const ce = z.find((B) => ve(B.name) === V), le = z.filter((B) => ve(B.name) !== V), ze = {
1561
+ name: V,
1562
+ progress: O,
1563
+ type: k.type,
1564
+ order: ce?.order ?? H.length + z.length
1565
1565
  };
1566
- return [...le, Ue];
1566
+ return [...le, ze];
1567
1567
  });
1568
1568
  }
1569
1569
  }, gt = (d) => {
1570
- he((x) => x.filter((V) => V.name !== be(d)));
1571
- }, Qt = (d) => {
1572
- for (const x of d) {
1573
- const V = We(x, f, at);
1574
- xe.current.set(x, V), V.then(
1575
- (j) => ot(j),
1576
- (j) => {
1577
- gt(x.name), Fe.error(j.message), console.warn(j);
1570
+ ge((k) => k.filter((O) => O.name !== ve(d)));
1571
+ }, Jt = (d) => {
1572
+ for (const k of d) {
1573
+ const O = Xe(k, f, ot);
1574
+ Ve.current.set(k, O), O.then(
1575
+ (V) => nt(V),
1576
+ (V) => {
1577
+ gt(k.name), Ce.error(V.message), console.warn(V);
1578
1578
  }
1579
1579
  );
1580
1580
  }
1581
- }, io = async (d) => {
1582
- we((x) => x + 1);
1581
+ }, lo = async (d) => {
1582
+ De((k) => k + 1);
1583
1583
  try {
1584
- const x = xe.current.get(d);
1585
- if (x) {
1586
- const { data: z } = await x;
1587
- return ne((ce) => ce.map((le) => le.id === z.id ? { ...le, isInline: !0 } : le)), {
1588
- src: gn(f, z.id),
1589
- name: be(d.name),
1584
+ const k = Ve.current.get(d);
1585
+ if (k) {
1586
+ const { data: z } = await k;
1587
+ return ee((ce) => ce.map((le) => le.id === z.id ? { ...le, isInline: !0 } : le)), {
1588
+ src: hn(f, z.id),
1589
+ name: ve(d.name),
1590
1590
  mime: d.type
1591
1591
  };
1592
1592
  }
1593
- const { data: V } = await We(d, f, void 0), j = be(d.name);
1594
- return ne((z) => [
1593
+ const { data: O } = await Xe(d, f, void 0), V = ve(d.name);
1594
+ return ee((z) => [
1595
1595
  ...z,
1596
- { id: V.id, name: j, mime: d.type, size: d.size, order: z.length, isInline: !0 }
1597
- ]), { src: gn(f, V.id), name: j, mime: d.type };
1598
- } catch (x) {
1599
- throw xe.current.has(d) || Fe.error(x?.message || "Upload failed"), x;
1596
+ { id: O.id, name: V, mime: d.type, size: d.size, order: z.length, isInline: !0 }
1597
+ ]), { src: hn(f, O.id), name: V, mime: d.type };
1598
+ } catch (k) {
1599
+ throw Ve.current.has(d) || Ce.error(k?.message || "Upload failed"), k;
1600
1600
  } finally {
1601
- we((x) => x - 1);
1601
+ De((k) => k - 1);
1602
1602
  }
1603
- }, so = (d) => {
1604
- K(!1), !d.defaultPrevented && Sr(
1603
+ }, uo = (d) => {
1604
+ ue(!1), !d.defaultPrevented && _r(
1605
1605
  d,
1606
1606
  f,
1607
- at,
1608
1607
  ot,
1609
- (x) => gt(x.name)
1608
+ nt,
1609
+ (k) => gt(k.name)
1610
1610
  );
1611
- }, co = (d) => {
1612
- d.preventDefault(), d.stopPropagation(), K(!0);
1613
- }, Yt = ge(null), lo = async ({ activity: d }) => {
1614
- const x = yt(d);
1615
- x && x.entityId === re?.id && (_e({ startFrame: x.startFrame, endFrame: x.endFrame }), $?.setDraft(x));
1616
- const V = Sn(d.body || ""), j = d.files || [], z = Rt(V), ce = b.length === 1 && b[0].id === (d.origin?.id ?? d.entityId), le = (B) => {
1617
- const pe = d.origin ?? (d.entityId && d.entityType ? { id: d.entityId, type: d.entityType } : void 0), ie = `[Source](${Xo(d.activityId, pe)})`, Z = [B.trim(), ie].filter(Boolean).join(`
1611
+ }, mo = (d) => {
1612
+ d.preventDefault(), d.stopPropagation(), ue(!0);
1613
+ }, Kt = pe(null), po = async ({ activity: d }) => {
1614
+ const k = yt(d);
1615
+ k && k.entityId === re?.id && (Ee({ startFrame: k.startFrame, endFrame: k.endFrame }), $?.setDraft(k));
1616
+ const O = Sn(d.body || ""), V = d.files || [], z = $t(O), ce = w.length === 1 && w[0].id === (d.origin?.id ?? d.entityId), le = (B) => {
1617
+ const me = d.origin ?? (d.entityId && d.entityType ? { id: d.entityId, type: d.entityType } : void 0), ie = `[Source](${ta(d.activityId, me)})`, te = [B.trim(), ie].filter(Boolean).join(`
1618
1618
 
1619
1619
  `);
1620
- de((ve) => ve.trim() ? `${ve.trim()}
1620
+ de((ye) => ye.trim() ? `${ye.trim()}
1621
1621
 
1622
- ${Z}` : Z), nt.current?.focus();
1623
- }, Ue = async (B) => {
1624
- const pe = z.has(B.id);
1622
+ ${te}` : te), tt.current?.focus();
1623
+ }, ze = async (B) => {
1624
+ const me = z.has(B.id);
1625
1625
  try {
1626
- const ie = await pn(
1626
+ const ie = await gn(
1627
1627
  f,
1628
1628
  B.id,
1629
1629
  B.name,
1630
1630
  B.mime,
1631
- pe ? void 0 : at
1631
+ me ? void 0 : ot
1632
1632
  );
1633
- if (pe) {
1634
- const { file: ve, data: rt } = ie, ht = be(ve.name);
1635
- ne((Zt) => [
1636
- ...Zt,
1637
- { id: rt.id, name: ht, mime: ve.type, size: ve.size, order: Zt.length, isInline: pe }
1633
+ if (me) {
1634
+ const { file: ye, data: at } = ie, ht = ve(ye.name);
1635
+ ee((tn) => [
1636
+ ...tn,
1637
+ { id: at.id, name: ht, mime: ye.type, size: ye.size, order: tn.length, isInline: me }
1638
1638
  ]);
1639
- } else ot(ie);
1640
- const Z = B.annotation;
1641
- if (Z && ce) {
1642
- const ve = await pn(
1639
+ } else nt(ie);
1640
+ const te = B.annotation;
1641
+ if (te && ce) {
1642
+ const ye = await gn(
1643
1643
  f,
1644
- Z.transparent,
1644
+ te.transparent,
1645
1645
  `annotation-${B.name}`,
1646
1646
  "image/png"
1647
1647
  );
1648
- ot(ve, !0), De((rt) => [
1649
- ...rt,
1648
+ nt(ye, !0), Ie((at) => [
1649
+ ...at,
1650
1650
  {
1651
- ...Z,
1652
- id: `${Z.id}-${wn()}`,
1651
+ ...te,
1652
+ id: `${te.id}-${xn()}`,
1653
1653
  composite: ie.data.id,
1654
- transparent: ve.data.id
1654
+ transparent: ye.data.id
1655
1655
  }
1656
1656
  ]);
1657
1657
  }
1658
1658
  return [B.id, ie.data.id];
1659
1659
  } catch (ie) {
1660
- return gt(B.name), Fe.error(`Could not copy ${B.name}`), console.warn(ie), null;
1660
+ return gt(B.name), Ce.error(`Could not copy ${B.name}`), console.warn(ie), null;
1661
1661
  }
1662
1662
  };
1663
- we((B) => B + 1);
1663
+ De((B) => B + 1);
1664
1664
  try {
1665
- const B = j.filter((Z) => z.has(Z.id)), pe = j.filter((Z) => !z.has(Z.id)), ie = Promise.all(pe.map(Ue));
1665
+ const B = V.filter((te) => z.has(te.id)), me = V.filter((te) => !z.has(te.id)), ie = Promise.all(me.map(ze));
1666
1666
  if (B.length) {
1667
- const Z = new Map(
1668
- (await Promise.all(B.map(Ue))).filter(
1669
- (ve) => !!ve
1667
+ const te = new Map(
1668
+ (await Promise.all(B.map(ze))).filter(
1669
+ (ye) => !!ye
1670
1670
  )
1671
1671
  );
1672
1672
  le(
1673
- V.replace(
1673
+ O.replace(
1674
1674
  /(\/api\/projects\/[^/]+\/files\/)([\w-]+)/g,
1675
- (ve, rt, ht) => Z.has(ht) ? rt + Z.get(ht) : ve
1675
+ (ye, at, ht) => te.has(ht) ? at + te.get(ht) : ye
1676
1676
  )
1677
1677
  );
1678
- } else le(V);
1678
+ } else le(O);
1679
1679
  await ie;
1680
1680
  } finally {
1681
- we((B) => B - 1);
1681
+ De((B) => B - 1);
1682
1682
  }
1683
1683
  };
1684
- G(() => {
1685
- !p || Yt.current === p.key || (Yt.current = p.key, wt(!0), g?.(), lo(p));
1684
+ W(() => {
1685
+ !p || Kt.current === p.key || (Kt.current = p.key, wt(!0), g?.(), po(p));
1686
1686
  }, [p?.key]);
1687
- const uo = Mr({
1687
+ const go = $r({
1688
1688
  projectName: f,
1689
- onSuccess: ot,
1690
- onProgress: at,
1689
+ onSuccess: nt,
1690
+ onProgress: ot,
1691
1691
  // seed progress so the card switches to uploading before the export finishes
1692
- onStart: (d) => at({ loaded: 1, total: 100 }, { name: d.name, type: "image/png" }),
1692
+ onStart: (d) => ot({ loaded: 1, total: 100 }, { name: d.name, type: "image/png" }),
1693
1693
  onError: (d) => gt(d.name)
1694
- }), mo = ke.length > 0 || Qe > 0, xt = Te || mo, kt = async () => {
1694
+ }), ho = be.length > 0 || Oe > 0, xt = xe || ho, kt = async () => {
1695
1695
  if (!xt)
1696
1696
  try {
1697
- Oe(!0);
1698
- let d = [], x = Se, V = [];
1697
+ he(!0);
1698
+ let d = [], k = Ne, O = [];
1699
1699
  if (fe.length) {
1700
- Ve(fe.map((Z) => Z.id));
1701
- const { files: pe, metadata: ie } = await uo(fe);
1702
- d = pe, x = [...x, ...ie], V = ie.map((Z) => Z.id), Ve(V);
1700
+ Re(fe.map((te) => te.id));
1701
+ const { files: me, metadata: ie } = await go(fe);
1702
+ d = me, k = [...k, ...ie], O = ie.map((te) => te.id), Re(O);
1703
1703
  }
1704
- const { annotations: j = [] } = a || {}, z = x.length ? [...j, ...x] : void 0, ce = Cr(nt.current?.getMarkdown() ?? U), le = ae.filter((pe) => !pe.isInline || hn(pe.id, ce)), Ue = [...le, ...d], B = {
1704
+ const { annotations: V = [] } = a || {}, z = k.length ? [...V, ...k] : void 0, ce = Sr(tt.current?.getMarkdown() ?? j), le = H.filter((me) => !me.isInline || fn(me.id, ce)), ze = [...le, ...d], B = {
1705
1705
  ...a,
1706
1706
  annotations: z,
1707
1707
  // could be undefined
1708
- category: E ? null : tt,
1708
+ category: E ? null : _e,
1709
1709
  // guests cannot set category (it is done by default on backend)
1710
1710
  // one frame link per comment, stored as metadata rather than in the text
1711
- startFrame: w?.startFrame ?? void 0,
1712
- endFrame: w?.endFrame ?? void 0
1711
+ startFrame: q?.startFrame ?? void 0,
1712
+ endFrame: q?.endFrame ?? void 0
1713
1713
  };
1714
- if ((ce || Ue.length) && c) {
1715
- const pe = U;
1716
- de(""), ne([]);
1714
+ if ((ce || ze.length) && l) {
1715
+ const me = j;
1716
+ de(""), ee([]);
1717
1717
  try {
1718
- await c(ce, Ue, B), V.forEach((ie) => Be?.(ie)), u && $?.setEditPreview(null), De([]), !u && w && $?.unlink(), u || _e(null);
1718
+ await l(ce, ze, B), O.forEach((ie) => He?.(ie)), u && $?.setEditPreview(null), Ie([]), !u && q && $?.unlink(), u || Ee(null);
1719
1719
  } catch {
1720
- de(pe), ne(le), De(Se);
1720
+ de(me), ee(le), Ie(Ne);
1721
1721
  return;
1722
1722
  }
1723
1723
  }
1724
1724
  } catch (d) {
1725
- console.error(d), Fe.error("Something went wrong");
1725
+ console.error(d), Ce.error("Something went wrong");
1726
1726
  } finally {
1727
- Ve([]), Oe(!1);
1727
+ Re([]), he(!1);
1728
1728
  }
1729
- }, Jt = [
1730
- ...fe.filter((d) => !Ye.includes(d.id)),
1731
- ...(ae || []).filter((d) => !d.isAnnotationLayer && !d.isInline),
1732
- ...ke
1733
- ].sort((d, x) => d.order - x.order), po = Jt.length > 3, Kt = (d) => h ? E ? "You do not have permission to comment." : "Commenting is disabled across multiple projects." : E || !d ? "Leave a comment" : "Comment, or type / to add mentions, checklists, code and more...", Xt = async (d) => {
1729
+ }, Xt = [
1730
+ ...fe.filter((d) => !Ze.includes(d.id)),
1731
+ ...(H || []).filter((d) => !d.isAnnotationLayer && !d.isInline),
1732
+ ...be
1733
+ ].sort((d, k) => d.order - k.order), fo = Xt.length > 3, Zt = (d) => h ? E ? "You do not have permission to comment." : "Commenting is disabled across multiple projects." : E || !d ? "Leave a comment" : "Comment, or type / to add mentions, checklists, code and more...", en = async (d) => {
1734
1734
  if (m)
1735
1735
  try {
1736
- (pt || ae.length > 0 || fe.length > 0) && await kt(), m(d);
1737
- } catch (x) {
1738
- console.error(x), Fe.error("Something went wrong while submitting the review");
1736
+ (pt || H.length > 0 || fe.length > 0) && await kt(), m(d);
1737
+ } catch (k) {
1738
+ console.error(k), Ce.error("Something went wrong while submitting the review");
1739
1739
  }
1740
- }, go = s && m && !h && /* @__PURE__ */ k(Lo, { className: ee("version-review-buttons", { guest: E }), children: [
1741
- /* @__PURE__ */ l(
1742
- nn,
1740
+ }, yo = s && m && !h && /* @__PURE__ */ x(Vo, { className: ne("version-review-buttons", { guest: E }), children: [
1741
+ /* @__PURE__ */ c(
1742
+ an,
1743
1743
  {
1744
1744
  icon: "check",
1745
1745
  variant: "tertiary",
1746
1746
  "data-tooltip": "Approve",
1747
- onClick: () => Xt(Ne.APPROVE),
1748
- children: /* @__PURE__ */ l("span", { className: "label", children: "Approve" })
1747
+ onClick: () => en(Se.APPROVE),
1748
+ children: /* @__PURE__ */ c("span", { className: "label", children: "Approve" })
1749
1749
  }
1750
1750
  ),
1751
- /* @__PURE__ */ l(
1752
- nn,
1751
+ /* @__PURE__ */ c(
1752
+ an,
1753
1753
  {
1754
1754
  icon: "refresh",
1755
1755
  variant: "danger",
1756
1756
  "data-tooltip": "Request changes",
1757
- onClick: () => Xt(Ne.REQUEST_CHANGES),
1758
- children: /* @__PURE__ */ l("span", { className: "label", children: "Request changes" })
1757
+ onClick: () => en(Se.REQUEST_CHANGES),
1758
+ children: /* @__PURE__ */ c("span", { className: "label", children: "Request changes" })
1759
1759
  }
1760
1760
  )
1761
- ] }), At = !E && /* @__PURE__ */ l(
1762
- Gr,
1761
+ ] }), At = !E && /* @__PURE__ */ c(
1762
+ Yr,
1763
1763
  {
1764
- value: tt,
1765
- categories: Vt,
1766
- onChange: (d) => Ot(d),
1764
+ value: _e,
1765
+ categories: Ut,
1766
+ onChange: (d) => mt(d),
1767
1767
  isCompact: u,
1768
- hasPowerpack: Y,
1769
- onPowerFeature: H,
1770
- isHidden: Hr(Vt, { isGuest: E, isAdmin: te })
1768
+ hasPowerpack: X,
1769
+ onPowerFeature: Q,
1770
+ isHidden: Jr(Ut, { isGuest: E, isAdmin: oe })
1771
1771
  }
1772
- ), ho = /* @__PURE__ */ k(Ce, { children: [
1773
- /* @__PURE__ */ l(
1774
- ct,
1772
+ ), vo = /* @__PURE__ */ x(Te, { children: [
1773
+ /* @__PURE__ */ c(
1774
+ st,
1775
1775
  {
1776
1776
  icon: "attach_file",
1777
1777
  variant: "text",
1778
1778
  className: "md-toolbar-button",
1779
1779
  "data-tooltip": "Attach files",
1780
1780
  onMouseDown: (d) => d.preventDefault(),
1781
- onClick: () => zt.current?.click()
1781
+ onClick: () => Gt.current?.click()
1782
1782
  }
1783
1783
  ),
1784
- /* @__PURE__ */ l(
1784
+ /* @__PURE__ */ c(
1785
1785
  "input",
1786
1786
  {
1787
- ref: zt,
1787
+ ref: Gt,
1788
1788
  type: "file",
1789
1789
  multiple: !0,
1790
1790
  hidden: !0,
1791
1791
  onChange: (d) => {
1792
- Qt(Array.from(d.target.files || [])), d.target.value = "";
1792
+ Jt(Array.from(d.target.files || [])), d.target.value = "";
1793
1793
  }
1794
1794
  }
1795
1795
  )
1796
- ] }), fo = u || oo, yo = `calc(${Math.max((Ae ? me || "Frame or range" : A || "").length, 1) + 2}ch + 16px)`;
1797
- return /* @__PURE__ */ l(Ce, { children: /* @__PURE__ */ k(
1798
- $o,
1796
+ ] }), bo = u || io, wo = `calc(${Math.max((ke ? K || "Frame or range" : v || "").length, 1) + 2}ch + 16px)`;
1797
+ return /* @__PURE__ */ c(Te, { children: /* @__PURE__ */ x(
1798
+ jo,
1799
1799
  {
1800
- ref: Bt,
1801
- className: ee("comment-container", "md-mention-anchor", { isOpen: y, isEditing: u }),
1802
- onDragOver: co,
1803
- onDragLeave: () => K(!1),
1804
- onDrop: so,
1805
- onClick: () => K(!1),
1800
+ ref: Ht,
1801
+ className: ne("comment-container", "md-mention-anchor", { isOpen: y, isEditing: u }),
1802
+ onDragOver: mo,
1803
+ onDragLeave: () => ue(!1),
1804
+ onDrop: uo,
1805
+ onClick: () => ue(!1),
1806
1806
  onKeyDown: (d) => {
1807
- const x = d.key === "ArrowUp" || d.key === "ArrowDown", V = d.target.isContentEditable;
1808
- x && V && Zn && !u || d.stopPropagation();
1807
+ const k = d.key === "ArrowUp" || d.key === "ArrowDown", O = d.target.isContentEditable;
1808
+ k && O && no && !u || d.stopPropagation();
1809
1809
  },
1810
1810
  children: [
1811
- s && i && /* @__PURE__ */ l(Zr, { lastOwnVersionReview: i }),
1812
- /* @__PURE__ */ k(
1813
- Oo,
1811
+ s && i && /* @__PURE__ */ c(ai, { lastOwnVersionReview: i }),
1812
+ /* @__PURE__ */ x(
1813
+ Uo,
1814
1814
  {
1815
- className: ee("block-shortcuts", {
1815
+ className: ne("block-shortcuts", {
1816
1816
  isOpen: y,
1817
1817
  isClosed: !y || h,
1818
1818
  isEditing: u,
1819
- isDropping: Me,
1819
+ isDropping: Ge,
1820
1820
  disabled: h,
1821
- isLoading: v,
1822
- isSubmitting: Te,
1823
- category: !!tt && !E
1821
+ isLoading: b,
1822
+ isSubmitting: xe,
1823
+ category: !!_e && !E
1824
1824
  }),
1825
- onClick: ao,
1826
- $categoryPrimary: jt?.color,
1827
- $categoryTertiary: Ut.primary,
1828
- $categorySecondary: Ut.secondary,
1825
+ onClick: so,
1826
+ $categoryPrimary: zt?.color,
1827
+ $categoryTertiary: Bt.primary,
1828
+ $categorySecondary: Bt.secondary,
1829
1829
  children: [
1830
- y && /* @__PURE__ */ l(
1831
- Pn,
1830
+ y && /* @__PURE__ */ c(
1831
+ _n,
1832
1832
  {
1833
- files: Jt,
1834
- isCompact: po || u,
1835
- onRemove: ro,
1833
+ files: Xt,
1834
+ isCompact: fo || u,
1835
+ onRemove: co,
1836
1836
  projectName: f,
1837
- onAnnotationClick: Ge,
1837
+ onAnnotationClick: qe,
1838
1838
  style: {
1839
1839
  borderBottom: "1px solid var(--md-sys-color-outline-variant)",
1840
1840
  height: "100%"
@@ -1850,131 +1850,131 @@ ${Z}` : Z), nt.current?.focus();
1850
1850
  }
1851
1851
  }
1852
1852
  ),
1853
- y && !h ? /* @__PURE__ */ k(Ce, { children: [
1854
- u && At && /* @__PURE__ */ l(Vo, { children: At }),
1855
- /* @__PURE__ */ l(
1856
- jo,
1853
+ y && !h ? /* @__PURE__ */ x(Te, { children: [
1854
+ u && At && /* @__PURE__ */ c(zo, { children: At }),
1855
+ /* @__PURE__ */ c(
1856
+ Bo,
1857
1857
  {
1858
- ref: nt,
1858
+ ref: tt,
1859
1859
  className: "comment-editor",
1860
- value: U,
1860
+ value: j,
1861
1861
  onChange: de,
1862
- placeholder: Kt(!0),
1863
- mentions: eo,
1862
+ placeholder: Zt(!0),
1863
+ mentions: oo,
1864
1864
  mentionPlacement: u ? "inline" : "top",
1865
- onMentionClick: to,
1866
- onMentionHover: no,
1865
+ onMentionClick: ao,
1866
+ onMentionHover: ro,
1867
1867
  onSubmit: kt,
1868
- onEscape: Wt,
1869
- onFiles: Qt,
1870
- onUploadMedia: io,
1871
- commands: bt,
1868
+ onEscape: Yt,
1869
+ onFiles: Jt,
1870
+ onUploadMedia: lo,
1871
+ commands: ut,
1872
1872
  toolbar: !u,
1873
1873
  floatingToolbar: u,
1874
1874
  toolbarStart: At,
1875
- toolbarEnd: /* @__PURE__ */ k(Ce, { children: [
1876
- /* @__PURE__ */ l(Uo, {}),
1877
- ho
1875
+ toolbarEnd: /* @__PURE__ */ x(Te, { children: [
1876
+ /* @__PURE__ */ c(Go, {}),
1877
+ vo
1878
1878
  ] }),
1879
1879
  bordered: !1,
1880
- autoFocus: fo,
1880
+ autoFocus: bo,
1881
1881
  minHeight: u ? 40 : 88,
1882
1882
  maxHeight: 259
1883
1883
  }
1884
1884
  )
1885
- ] }) : /* @__PURE__ */ l(zo, { children: Kt() }),
1886
- /* @__PURE__ */ k(Bo, { children: [
1887
- (!E || M) && /* @__PURE__ */ k(Go, { children: [
1888
- !E && ti.map(({ trigger: d, icon: x, tooltip: V }) => /* @__PURE__ */ l(
1889
- ct,
1885
+ ] }) : /* @__PURE__ */ c(Ho, { children: Zt() }),
1886
+ /* @__PURE__ */ x(qo, { children: [
1887
+ (!E || Pe) && /* @__PURE__ */ x(Wo, { children: [
1888
+ !E && ii.map(({ trigger: d, icon: k, tooltip: O }) => /* @__PURE__ */ c(
1889
+ st,
1890
1890
  {
1891
- icon: x,
1891
+ icon: k,
1892
1892
  variant: "text",
1893
- onMouseDown: (j) => j.preventDefault(),
1894
- onClick: () => nt.current?.insertMentionTrigger(d),
1895
- "data-tooltip": V,
1893
+ onMouseDown: (V) => V.preventDefault(),
1894
+ onClick: () => tt.current?.insertMentionTrigger(d),
1895
+ "data-tooltip": O,
1896
1896
  "data-shortcut": d
1897
1897
  },
1898
1898
  d
1899
1899
  )),
1900
- M && /* @__PURE__ */ k(
1901
- Ho,
1900
+ Pe && /* @__PURE__ */ x(
1901
+ Qo,
1902
1902
  {
1903
- className: ee("frame-link", { selected: !!w || Ae }),
1903
+ className: ne("frame-link", { selected: !!q || ke }),
1904
1904
  children: [
1905
- /* @__PURE__ */ l(
1906
- qo,
1905
+ /* @__PURE__ */ c(
1906
+ Yo,
1907
1907
  {
1908
1908
  icon: "timer",
1909
1909
  variant: "text",
1910
- onClick: et,
1911
- "aria-label": w ? "Remove frame link" : "Add frame link",
1912
- "data-tooltip": w ? "Remove frame link" : u ? "Add frame link" : "Link to current frame",
1910
+ onClick: bt,
1911
+ "aria-label": q ? "Remove frame link" : "Add frame link",
1912
+ "data-tooltip": q ? "Remove frame link" : u ? "Add frame link" : "Link to current frame",
1913
1913
  "data-testid": "comment-frame-link"
1914
1914
  }
1915
1915
  ),
1916
- (w || Ae) && (Ae ? /* @__PURE__ */ l(
1917
- Wo,
1916
+ (q || ke) && (ke ? /* @__PURE__ */ c(
1917
+ Jo,
1918
1918
  {
1919
1919
  autoFocus: !0,
1920
1920
  "aria-label": "Linked frame or range",
1921
- value: me,
1921
+ value: K,
1922
1922
  placeholder: "Frame",
1923
1923
  onFocus: (d) => {
1924
- Ee.current = w, d.currentTarget.select();
1924
+ Fe.current = q, d.currentTarget.select();
1925
1925
  },
1926
- onChange: (d) => Ke(d.target.value),
1927
- onBlur: Xe,
1928
- style: { width: yo },
1926
+ onChange: (d) => jt(d.target.value),
1927
+ onBlur: dt,
1928
+ style: { width: wo },
1929
1929
  onKeyDown: (d) => {
1930
- d.key === "Enter" && (d.preventDefault(), d.currentTarget.blur()), d.key === "Escape" && (Ie.current = !0, d.currentTarget.blur());
1930
+ d.key === "Enter" && (d.preventDefault(), d.currentTarget.blur()), d.key === "Escape" && (Ae.current = !0, d.currentTarget.blur());
1931
1931
  },
1932
1932
  "data-testid": "comment-frame-link-input"
1933
1933
  }
1934
- ) : /* @__PURE__ */ l(
1935
- Qo,
1934
+ ) : /* @__PURE__ */ c(
1935
+ Ko,
1936
1936
  {
1937
1937
  variant: "text",
1938
- "aria-label": `Edit linked frame ${A ?? ""}`,
1939
- onClick: () => Re(!0),
1938
+ "aria-label": `Edit linked frame ${v ?? ""}`,
1939
+ onClick: () => Me(!0),
1940
1940
  "data-tooltip": "Edit linked frame or range",
1941
- children: A || "Frame or range"
1941
+ children: v || "Frame or range"
1942
1942
  }
1943
1943
  ))
1944
1944
  ]
1945
1945
  }
1946
1946
  )
1947
1947
  ] }),
1948
- /* @__PURE__ */ k(Yo, { children: [
1949
- u && /* @__PURE__ */ l(ct, { variant: "text", onClick: Wt, children: "Cancel" }),
1950
- /* @__PURE__ */ l(
1951
- Io,
1948
+ /* @__PURE__ */ x(Xo, { children: [
1949
+ u && /* @__PURE__ */ c(st, { variant: "text", onClick: Yt, children: "Cancel" }),
1950
+ /* @__PURE__ */ c(
1951
+ Po,
1952
1952
  {
1953
1953
  label: u ? "Save" : "Comment",
1954
1954
  className: "comment",
1955
- active: pt || !!ae.length,
1955
+ active: pt || !!H.length,
1956
1956
  onClick: kt,
1957
- disabled: v || xt,
1957
+ disabled: b || xt,
1958
1958
  saving: xt
1959
1959
  }
1960
1960
  )
1961
1961
  ] })
1962
1962
  ] }),
1963
- /* @__PURE__ */ l(Jo, { className: ee({ show: Me && y }), children: /* @__PURE__ */ l(se, { icon: "cloud_upload" }) })
1963
+ /* @__PURE__ */ c(Zo, { className: ne({ show: Ge && y }), children: /* @__PURE__ */ c(se, { icon: "cloud_upload" }) })
1964
1964
  ]
1965
1965
  }
1966
1966
  ),
1967
- /* @__PURE__ */ l(Ko, {}),
1968
- go
1967
+ /* @__PURE__ */ c(ea, {}),
1968
+ yo
1969
1969
  ]
1970
1970
  }
1971
1971
  ) });
1972
- }, ni = (e, t, o) => e && Lt`
1972
+ }, si = (e, t, o) => e && Ot`
1973
1973
  --reaction-border-color: ${e};
1974
1974
  --reaction-active-bg: ${t};
1975
1975
  --reaction-hover-bg: ${t};
1976
1976
  --reaction-active-border: ${e};
1977
- `, oi = F.div`
1977
+ `, ci = F.div`
1978
1978
  /* VARS */
1979
1979
  --reaction-border-color: var(--md-sys-color-outline-variant);
1980
1980
  --reaction-hover-bg: var(--md-sys-color-surface-container-high-hover);
@@ -1987,7 +1987,7 @@ ${Z}` : Z), nt.current?.focus();
1987
1987
  --reaction-compact-active-hover-bg: var(--md-sys-color-primary-container-hover);
1988
1988
 
1989
1989
  /* CATEGORY */
1990
- ${({ $categoryPrimary: e, $categorySecondary: t, $categoryTertiary: o }) => ni(e, t)}
1990
+ ${({ $categoryPrimary: e, $categorySecondary: t, $categoryTertiary: o }) => si(e, t)}
1991
1991
 
1992
1992
  display: flex;
1993
1993
  justify-content: center;
@@ -2038,23 +2038,23 @@ ${Z}` : Z), nt.current?.focus();
2038
2038
  position: relative;
2039
2039
  height: 19px;
2040
2040
  }
2041
- `, ai = F.div`
2041
+ `, li = F.div`
2042
2042
  outline: 'solid 1px red';
2043
2043
  display: flex;
2044
2044
  gap: 8px;
2045
- `, ri = F.div`
2045
+ `, di = F.div`
2046
2046
  position: fixed;
2047
2047
  top: 0;
2048
2048
  bottom: 0;
2049
2049
  left: 0;
2050
2050
  right: 0;
2051
2051
  z-index: 55;
2052
- `, ii = F.div`
2052
+ `, ui = F.div`
2053
2053
  /* VARS */
2054
2054
  --panel-bg: var(--md-sys-color-surface-container-high);
2055
2055
 
2056
2056
  /* CATEGORY */
2057
- ${({ $categoryPrimary: e, $categorySecondary: t }) => t && Lt`
2057
+ ${({ $categoryPrimary: e, $categorySecondary: t }) => t && Ot`
2058
2058
  --panel-bg: ${t};
2059
2059
  `}
2060
2060
 
@@ -2070,14 +2070,14 @@ ${Z}` : Z), nt.current?.focus();
2070
2070
  padding: 4px;
2071
2071
  border-radius: 4px;
2072
2072
  box-shadow: 0px 0px 6px 2px rgba(0, 0, 0, 0.15);
2073
- `, si = F.div`
2073
+ `, mi = F.div`
2074
2074
  /* VARS */
2075
2075
  --opener-bg: var(--md-sys-color-surface-container-high);
2076
2076
  --opener-hover-bg: var(--md-sys-color-surface-container-high-hover);
2077
2077
  --opener-color: var(--md-sys-color-outline);
2078
2078
 
2079
2079
  /* CATEGORY */
2080
- ${({ $categoryPrimary: e, $categorySecondary: t }) => t && Lt`
2080
+ ${({ $categoryPrimary: e, $categorySecondary: t }) => t && Ot`
2081
2081
  --opener-bg: ${t};
2082
2082
  --opener-hover-bg: ${t};
2083
2083
  --opener-color: ${e};
@@ -2100,31 +2100,31 @@ ${Z}` : Z), nt.current?.focus();
2100
2100
  filter: ${({ $categoryPrimary: e }) => e ? "brightness(1.2)" : "none"};
2101
2101
  }
2102
2102
  }
2103
- `, ci = F.div`
2103
+ `, pi = F.div`
2104
2104
  display: flex;
2105
2105
  gap: 8px;
2106
2106
  position: relative;
2107
- `, li = [
2107
+ `, gi = [
2108
2108
  { key: "thumb_up", value: "👍" },
2109
2109
  { key: "thumb_down", value: "👎" },
2110
2110
  { key: "heart_plus", value: "❤" },
2111
2111
  { key: "celebration", value: "🎉" },
2112
2112
  { key: "notes", value: "📝" }
2113
- ], di = {
2113
+ ], hi = {
2114
2114
  thumb_up: "👍",
2115
2115
  thumb_down: "👎",
2116
2116
  heart_plus: "❤️",
2117
2117
  celebration: "🎉",
2118
2118
  notes: "📝"
2119
- }, Et = [
2119
+ }, Mt = [
2120
2120
  "thumb_up",
2121
2121
  "thumb_down",
2122
2122
  "heart_plus",
2123
2123
  "celebration",
2124
2124
  "notes"
2125
- ], ui = (e) => [...e].sort(
2126
- (o, n) => Et.indexOf(o.type) - Et.indexOf(n.type)
2127
- ), Hn = ({
2125
+ ], fi = (e) => [...e].sort(
2126
+ (o, n) => Mt.indexOf(o.type) - Mt.indexOf(n.type)
2127
+ ), qn = ({
2128
2128
  reaction: e,
2129
2129
  variant: t = "standard",
2130
2130
  onClick: o,
@@ -2133,29 +2133,29 @@ ${Z}` : Z), nt.current?.focus();
2133
2133
  categoryTertiary: r
2134
2134
  }) => {
2135
2135
  const s = e.users?.join(", ") || void 0;
2136
- return /* @__PURE__ */ k(
2137
- oi,
2136
+ return /* @__PURE__ */ x(
2137
+ ci,
2138
2138
  {
2139
- className: ee(t, { active: e.isActive }),
2139
+ className: ne(t, { active: e.isActive }),
2140
2140
  onClick: o,
2141
2141
  "data-tooltip": s,
2142
2142
  $categoryPrimary: n,
2143
2143
  $categorySecondary: a,
2144
2144
  $categoryTertiary: r,
2145
2145
  children: [
2146
- /* @__PURE__ */ l("span", { className: "emoji", children: di[e.type] }),
2147
- e.users && /* @__PURE__ */ l("span", { children: e.users.length })
2146
+ /* @__PURE__ */ c("span", { className: "emoji", children: hi[e.type] }),
2147
+ e.users && /* @__PURE__ */ c("span", { children: e.users.length })
2148
2148
  ]
2149
2149
  }
2150
2150
  );
2151
- }, mi = ({
2151
+ }, yi = ({
2152
2152
  reactions: e,
2153
2153
  changeHandler: t,
2154
2154
  categoryPrimary: o,
2155
2155
  categorySecondary: n,
2156
2156
  categoryTertiary: a
2157
- }) => /* @__PURE__ */ l(ai, { children: e.map((r) => /* @__PURE__ */ l(
2158
- Hn,
2157
+ }) => /* @__PURE__ */ c(li, { children: e.map((r) => /* @__PURE__ */ c(
2158
+ qn,
2159
2159
  {
2160
2160
  reaction: r,
2161
2161
  isActive: r.isActive,
@@ -2167,22 +2167,22 @@ ${Z}` : Z), nt.current?.focus();
2167
2167
  categoryTertiary: a
2168
2168
  },
2169
2169
  r.type
2170
- )) }), pi = ({
2170
+ )) }), vi = ({
2171
2171
  reactions: e,
2172
2172
  changeHandler: t,
2173
2173
  categoryPrimary: o,
2174
2174
  categorySecondary: n,
2175
2175
  categoryTertiary: a
2176
2176
  }) => {
2177
- const [r, s] = L(!1), i = e.filter((c) => c.isActive).map((c) => c.type);
2178
- return /* @__PURE__ */ k(
2179
- si,
2177
+ const [r, s] = L(!1), i = e.filter((l) => l.isActive).map((l) => l.type);
2178
+ return /* @__PURE__ */ x(
2179
+ mi,
2180
2180
  {
2181
2181
  $categoryPrimary: o,
2182
2182
  $categorySecondary: n,
2183
2183
  $categoryTertiary: a,
2184
2184
  children: [
2185
- /* @__PURE__ */ l(
2185
+ /* @__PURE__ */ c(
2186
2186
  se,
2187
2187
  {
2188
2188
  icon: "add_reaction",
@@ -2190,21 +2190,21 @@ ${Z}` : Z), nt.current?.focus();
2190
2190
  onClick: () => s(!r)
2191
2191
  }
2192
2192
  ),
2193
- r && /* @__PURE__ */ k(Ce, { children: [
2194
- /* @__PURE__ */ l(ri, { onClick: () => s(!1) }),
2195
- /* @__PURE__ */ l(
2196
- ii,
2193
+ r && /* @__PURE__ */ x(Te, { children: [
2194
+ /* @__PURE__ */ c(di, { onClick: () => s(!1) }),
2195
+ /* @__PURE__ */ c(
2196
+ ui,
2197
2197
  {
2198
2198
  $categoryPrimary: o,
2199
2199
  $categorySecondary: n,
2200
2200
  $categoryTertiary: a,
2201
- children: li.map((c) => {
2201
+ children: gi.map((l) => {
2202
2202
  const m = {
2203
- type: c.key,
2204
- isActive: i.includes(c.key)
2203
+ type: l.key,
2204
+ isActive: i.includes(l.key)
2205
2205
  };
2206
- return /* @__PURE__ */ l(
2207
- Hn,
2206
+ return /* @__PURE__ */ c(
2207
+ qn,
2208
2208
  {
2209
2209
  reaction: m,
2210
2210
  variant: "compact",
@@ -2224,7 +2224,7 @@ ${Z}` : Z), nt.current?.focus();
2224
2224
  ]
2225
2225
  }
2226
2226
  );
2227
- }, gi = ({
2227
+ }, bi = ({
2228
2228
  reactions: e,
2229
2229
  changeHandler: t,
2230
2230
  readOnly: o,
@@ -2234,27 +2234,27 @@ ${Z}` : Z), nt.current?.focus();
2234
2234
  categoryTertiary: s
2235
2235
  }) => {
2236
2236
  const i = n ? { categoryPrimary: a, categorySecondary: r, categoryTertiary: s } : {};
2237
- return /* @__PURE__ */ k(ci, { children: [
2238
- !o && /* @__PURE__ */ l(
2239
- pi,
2237
+ return /* @__PURE__ */ x(pi, { children: [
2238
+ !o && /* @__PURE__ */ c(
2239
+ vi,
2240
2240
  {
2241
2241
  reactions: e,
2242
2242
  changeHandler: t,
2243
2243
  ...i
2244
2244
  }
2245
2245
  ),
2246
- /* @__PURE__ */ l(mi, { reactions: e, changeHandler: t, ...i })
2246
+ /* @__PURE__ */ c(yi, { reactions: e, changeHandler: t, ...i })
2247
2247
  ] });
2248
- }, hi = (e = "") => (e.match(/\((.*?)\)/g) || []).flatMap((o) => {
2248
+ }, wi = (e = "") => (e.match(/\((.*?)\)/g) || []).flatMap((o) => {
2249
2249
  if (o.includes("http")) return [];
2250
2250
  const n = o.match(/\(([^)]+)\)/), a = n ? n[1].split(":") : [];
2251
2251
  return { type: a[0], id: a[1] };
2252
- }), fi = (e) => e.replace(/@(?=@|\[)/g, ""), yi = {
2252
+ }), xi = (e) => e.replace(/@(?=@|\[)/g, ""), ki = {
2253
2253
  "&": "&amp;",
2254
2254
  "<": "&lt;",
2255
2255
  ">": "&gt;",
2256
2256
  '"': "&quot;"
2257
- }, Ct = (e) => e.replace(/[&<>"]/g, (t) => yi[t]), vi = (e) => e.replaceAll(" ", "%20"), bi = (e, t) => {
2257
+ }, Ct = (e) => e.replace(/[&<>"]/g, (t) => ki[t]), Ai = (e) => e.replaceAll(" ", "%20"), Fi = (e, t) => {
2258
2258
  const o = t.cloneContents();
2259
2259
  if (!o.querySelector("[data-mention-value]")) return null;
2260
2260
  let n = "", a = "";
@@ -2269,11 +2269,11 @@ ${Z}` : Z), nt.current?.focus();
2269
2269
  return;
2270
2270
  }
2271
2271
  if (s.nodeType !== Node.ELEMENT_NODE) return;
2272
- const i = s, c = i.getAttribute("data-mention-value");
2273
- if (c) {
2272
+ const i = s, l = i.getAttribute("data-mention-value");
2273
+ if (l) {
2274
2274
  const m = i.getAttribute("data-mention-label") || (i.textContent || "").trim();
2275
2275
  if (m) {
2276
- const p = vi(c);
2276
+ const p = Ai(l);
2277
2277
  n += `[${m}](${p})`, a += `<a href="@${Ct(p)}">@${Ct(m)}</a>`;
2278
2278
  }
2279
2279
  return;
@@ -2292,37 +2292,37 @@ ${Z}` : Z), nt.current?.focus();
2292
2292
  s.childNodes.forEach(r);
2293
2293
  };
2294
2294
  return r(o), n ? { text: n, html: a } : null;
2295
- }, wi = ({ children: e }) => {
2296
- const t = en.Children.map(e, (n) => {
2297
- if (!en.isValidElement(n)) return n;
2295
+ }, Ci = ({ children: e }) => {
2296
+ const t = nn.Children.map(e, (n) => {
2297
+ if (!nn.isValidElement(n)) return n;
2298
2298
  const a = n.props.children;
2299
2299
  return typeof a != "string" ? n : {
2300
2300
  ...n,
2301
2301
  props: {
2302
2302
  ...n.props,
2303
- children: fi(a)
2303
+ children: xi(a)
2304
2304
  }
2305
2305
  };
2306
- }), o = qe((n) => {
2306
+ }), o = Je((n) => {
2307
2307
  const a = window.getSelection();
2308
2308
  if (!a || a.rangeCount === 0 || a.isCollapsed) return;
2309
2309
  const r = a.getRangeAt(0), s = n.currentTarget;
2310
2310
  if (!s.contains(r.startContainer) || !s.contains(r.endContainer)) return;
2311
- const i = bi(s, r);
2311
+ const i = Fi(s, r);
2312
2312
  i && (n.preventDefault(), n.clipboardData.setData("text/plain", i.text), n.clipboardData.setData("text/html", i.html));
2313
2313
  }, []);
2314
- return /* @__PURE__ */ l("div", { className: "comment-text", onCopy: o, children: t });
2315
- }, xi = (e = [], t) => {
2314
+ return /* @__PURE__ */ c("div", { className: "comment-text", onCopy: o, children: t });
2315
+ }, Ti = (e = [], t) => {
2316
2316
  let o = {};
2317
2317
  return e.forEach((n) => {
2318
2318
  const a = n.reaction;
2319
- Et.includes(a) && (o[a] === void 0 && (o[a] = { type: a, isActive: !1, users: [] }), t == n.userName && (o[a].isActive = !0), o[a].users?.push(n.fullName || n.userName));
2320
- }), ui(Object.values(o));
2321
- }, ki = F.div`
2319
+ Mt.includes(a) && (o[a] === void 0 && (o[a] = { type: a, isActive: !1, users: [] }), t == n.userName && (o[a].isActive = !0), o[a].users?.push(n.fullName || n.userName));
2320
+ }), fi(Object.values(o));
2321
+ }, Di = F.div`
2322
2322
  display: flex;
2323
2323
  align-items: center;
2324
2324
  gap: var(--base-gap-small);
2325
- `, Ai = F.span`
2325
+ `, Ni = F.span`
2326
2326
  border-radius: var(--border-radius-m);
2327
2327
  padding: 2px 6px;
2328
2328
  margin: 0 2px;
@@ -2339,19 +2339,19 @@ ${Z}` : Z), nt.current?.focus();
2339
2339
  font-size: 16px;
2340
2340
  font-variation-settings: 'FILL' 1;
2341
2341
  }
2342
- `, Fi = ({ name: e, statuses: t, children: o }) => {
2343
- const n = Ci(e, t);
2344
- return /* @__PURE__ */ k(ki, { children: [
2342
+ `, Ii = ({ name: e, statuses: t, children: o }) => {
2343
+ const n = Si(e, t);
2344
+ return /* @__PURE__ */ x(Di, { children: [
2345
2345
  o,
2346
- /* @__PURE__ */ k(Ai, { $color: _t(n.color), style: { backgroundColor: n.color }, children: [
2347
- n.icon && /* @__PURE__ */ l(se, { icon: n.icon }),
2346
+ /* @__PURE__ */ x(Ni, { $color: Lt(n.color), style: { backgroundColor: n.color }, children: [
2347
+ n.icon && /* @__PURE__ */ c(se, { icon: n.icon }),
2348
2348
  e
2349
2349
  ] })
2350
2350
  ] });
2351
- }, Ci = (e, t) => {
2351
+ }, Si = (e, t) => {
2352
2352
  const o = { name: e, color: "var(--md-sys-color-primary)", icon: void 0 };
2353
2353
  return t.find((n) => n.name === e) || o;
2354
- }, Ti = F.header`
2354
+ }, Ei = F.header`
2355
2355
  display: flex;
2356
2356
  align-items: flex-end;
2357
2357
  gap: var(--base-gap-small);
@@ -2363,7 +2363,7 @@ ${Z}` : Z), nt.current?.focus();
2363
2363
  margin-left: 4px;
2364
2364
  font-weight: 800;
2365
2365
  }
2366
- `, Di = F.div`
2366
+ `, Mi = F.div`
2367
2367
  display: flex;
2368
2368
  gap: var(--base-gap-small);
2369
2369
  align-items: center;
@@ -2392,7 +2392,7 @@ const Tt = F.span`
2392
2392
  strong {
2393
2393
  font-weight: 800;
2394
2394
  }
2395
- `, Ni = F.li`
2395
+ `, Pi = F.li`
2396
2396
  list-style: none;
2397
2397
  margin: var(--padding-s) var(--padding-m);
2398
2398
  padding: var(--padding-s) var(--padding-m) var(--padding-s) 0;
@@ -2419,7 +2419,7 @@ const Tt = F.span`
2419
2419
  &.request_changes .date, {
2420
2420
  color: var(--md-sys-color-error);
2421
2421
  }
2422
- `, Si = F.div`
2422
+ `, _i = F.div`
2423
2423
  display: flex;
2424
2424
  flex-wrap: nowrap;
2425
2425
  align-items: center;
@@ -2438,7 +2438,7 @@ const Tt = F.span`
2438
2438
  color: var(--md-sys-color-outline);
2439
2439
  opacity: 0.5;
2440
2440
  }
2441
- `, Ii = F.span`
2441
+ `, Ri = F.span`
2442
2442
  white-space: nowrap;
2443
2443
  font-size: 12px;
2444
2444
  text-overflow: ellipsis;
@@ -2449,16 +2449,16 @@ const Tt = F.span`
2449
2449
  font-size: 12px;
2450
2450
  font-weight: 800;
2451
2451
  }
2452
- `, Ei = "#c5c5c5";
2453
- function qn(e) {
2454
- const { categories: t } = $e(), { categoryData: o, categoryNotFound: n } = S(() => {
2452
+ `, Li = "#c5c5c5";
2453
+ function Wn(e) {
2454
+ const { categories: t } = $e(), { categoryData: o, categoryNotFound: n } = I(() => {
2455
2455
  let a = !1;
2456
2456
  if (e) {
2457
2457
  const r = t.find((s) => s.name === e);
2458
2458
  return r || (a = !0), {
2459
2459
  categoryData: r || {
2460
2460
  name: e,
2461
- color: Ei
2461
+ color: Li
2462
2462
  },
2463
2463
  categoryNotFound: a
2464
2464
  };
@@ -2470,21 +2470,21 @@ function qn(e) {
2470
2470
  }, [e, t]);
2471
2471
  return { categoryData: o, categoryNotFound: n };
2472
2472
  }
2473
- const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (e) => !e || !e.name ? _i : e.name === Mi && !e.label ? Pi : e.label ? e.label : e.name, Mt = "anonymous.guest", Ri = ({ isGuest: e, activity: t }) => {
2474
- const { authorName: o, authorFullName: n, createdAt: a, activityData: r } = t || {}, s = S(
2473
+ const $i = "anonymous.guest", Oi = "Anonymous User", Vi = "unknown.user", Qn = (e) => !e || !e.name ? Vi : e.name === $i && !e.label ? Oi : e.label ? e.label : e.name, Pt = "anonymous.guest", ji = ({ isGuest: e, activity: t }) => {
2474
+ const { authorName: o, authorFullName: n, createdAt: a, activityData: r } = t || {}, s = I(
2475
2475
  () => [
2476
- Wn({ name: o, label: n }),
2477
- Un(r?.feedback ?? Ne.APPROVE)
2476
+ Qn({ name: o, label: n }),
2477
+ zn(r?.feedback ?? Se.APPROVE)
2478
2478
  ].join(" "),
2479
2479
  [n, o, r?.feedback, a]
2480
- ), { categoryData: i, categoryNotFound: c } = qn(r?.category), m = S(() => {
2481
- if (!o?.startsWith(Mt))
2480
+ ), { categoryData: i, categoryNotFound: l } = Wn(r?.category), m = I(() => {
2481
+ if (!o?.startsWith(Pt))
2482
2482
  return `/api/users/${o}/avatar`;
2483
2483
  }, [o]);
2484
2484
  if (r?.feedback)
2485
- return /* @__PURE__ */ l(Ni, { className: xn(r.feedback), children: /* @__PURE__ */ k(Si, { children: [
2486
- o && /* @__PURE__ */ l(
2487
- Tn,
2485
+ return /* @__PURE__ */ c(Pi, { className: kn(r.feedback), children: /* @__PURE__ */ x(_i, { children: [
2486
+ o && /* @__PURE__ */ c(
2487
+ Dn,
2488
2488
  {
2489
2489
  name: o,
2490
2490
  fullName: n,
@@ -2492,21 +2492,21 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
2492
2492
  size: 22
2493
2493
  }
2494
2494
  ),
2495
- /* @__PURE__ */ l(se, { icon: zn(r.feedback) }),
2496
- i && !e && /* @__PURE__ */ l(
2497
- st,
2495
+ /* @__PURE__ */ c(se, { icon: Bn(r.feedback) }),
2496
+ i && !e && /* @__PURE__ */ c(
2497
+ it,
2498
2498
  {
2499
2499
  value: i.name,
2500
2500
  color: i.color,
2501
2501
  isCompact: !0,
2502
- "data-tooltip": c ? "Category not found. It may have been deleted." : void 0,
2502
+ "data-tooltip": l ? "Category not found. It may have been deleted." : void 0,
2503
2503
  "data-tooltip-delay": 0
2504
2504
  }
2505
2505
  ),
2506
- /* @__PURE__ */ l(Ii, { children: s }),
2507
- /* @__PURE__ */ l(ut, { date: a, exactTooltip: !0 })
2506
+ /* @__PURE__ */ c(Ri, { children: s }),
2507
+ /* @__PURE__ */ c(lt, { date: a, exactTooltip: !0 })
2508
2508
  ] }) });
2509
- }, Qn = ({
2509
+ }, Yn = ({
2510
2510
  name: e,
2511
2511
  fullName: t,
2512
2512
  date: o,
@@ -2515,34 +2515,34 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
2515
2515
  children: r,
2516
2516
  projectName: s,
2517
2517
  entityType: i,
2518
- onReferenceClick: c,
2518
+ onReferenceClick: l,
2519
2519
  onReferenceTooltip: m
2520
2520
  }) => {
2521
- const { referenceType: p, origin: g, activityType: u, versions: h, activityId: v } = a, y = p === "mention", D = u === "version.publish", C = h && h?.length > 1 ? "published versions" : "published a version", f = y ? "mentioned" : "commented", b = y ? ` ${i} on` : "on", T = e?.startsWith("guest.") || e?.startsWith(Mt), I = (a.author?.deleted || !a.author?.active) && !T, _ = S(() => {
2522
- if (!e?.startsWith(Mt))
2521
+ const { referenceType: p, origin: g, activityType: u, versions: h, activityId: b } = a, y = p === "mention", D = u === "version.publish", C = h && h?.length > 1 ? "published versions" : "published a version", f = y ? "mentioned" : "commented", w = y ? ` ${i} on` : "on", A = e?.startsWith("guest.") || e?.startsWith(Pt), S = (a.author?.deleted || !a.author?.active) && !A, P = I(() => {
2522
+ if (!e?.startsWith(Pt))
2523
2523
  return `/api/users/${e}/avatar`;
2524
2524
  }, [e]);
2525
- return /* @__PURE__ */ k(Ti, { children: [
2526
- /* @__PURE__ */ k(Di, { children: [
2527
- e && !I && /* @__PURE__ */ l(Tn, { name: e, fullName: t, src: _, size: 22 }),
2528
- I && /* @__PURE__ */ l(se, { icon: "account_circle" }),
2529
- /* @__PURE__ */ l("h5", { children: t || a.activityData?.author || "Unknown" }),
2530
- n && /* @__PURE__ */ k(Ce, { children: [
2531
- /* @__PURE__ */ l(Tt, { children: /* @__PURE__ */ l("strong", { children: f }) }),
2532
- /* @__PURE__ */ l(Tt, { style: { overflow: "hidden", textOverflow: "ellipsis" }, children: b }),
2533
- g && /* @__PURE__ */ l(
2534
- Zo,
2525
+ return /* @__PURE__ */ x(Ei, { children: [
2526
+ /* @__PURE__ */ x(Mi, { children: [
2527
+ e && !S && /* @__PURE__ */ c(Dn, { name: e, fullName: t, src: P, size: 22 }),
2528
+ S && /* @__PURE__ */ c(se, { icon: "account_circle" }),
2529
+ /* @__PURE__ */ c("h5", { children: t || a.activityData?.author || "Unknown" }),
2530
+ n && /* @__PURE__ */ x(Te, { children: [
2531
+ /* @__PURE__ */ c(Tt, { children: /* @__PURE__ */ c("strong", { children: f }) }),
2532
+ /* @__PURE__ */ c(Tt, { style: { overflow: "hidden", textOverflow: "ellipsis" }, children: w }),
2533
+ g && /* @__PURE__ */ c(
2534
+ na,
2535
2535
  {
2536
2536
  id: g.id,
2537
2537
  type: g.type,
2538
2538
  variant: "text",
2539
- onClick: () => c?.({
2539
+ onClick: () => l?.({
2540
2540
  entityId: g.id,
2541
2541
  entityType: g.type,
2542
2542
  projectName: s,
2543
- activityId: v
2543
+ activityId: b
2544
2544
  }),
2545
- onMouseEnter: (R, E) => m?.({
2545
+ onMouseEnter: (_, E) => m?.({
2546
2546
  type: g.type,
2547
2547
  id: g.id,
2548
2548
  label: g.label,
@@ -2553,13 +2553,13 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
2553
2553
  }
2554
2554
  )
2555
2555
  ] }),
2556
- D && /* @__PURE__ */ l(Tt, { children: C }),
2556
+ D && /* @__PURE__ */ c(Tt, { children: C }),
2557
2557
  r
2558
2558
  ] }),
2559
- /* @__PURE__ */ l(ut, { date: o })
2559
+ /* @__PURE__ */ c(lt, { date: o })
2560
2560
  ] });
2561
- }, Li = ({ flags: e }) => e.length ? /* @__PURE__ */ l(ea, { children: e.map(({ id: t, label: o, icon: n, tooltip: a, onClick: r, disabled: s, testId: i }) => /* @__PURE__ */ k(
2562
- ta,
2561
+ }, Ui = ({ flags: e }) => e.length ? /* @__PURE__ */ c(oa, { children: e.map(({ id: t, label: o, icon: n, tooltip: a, onClick: r, disabled: s, testId: i }) => /* @__PURE__ */ x(
2562
+ aa,
2563
2563
  {
2564
2564
  as: r ? "button" : "span",
2565
2565
  type: r ? "button" : void 0,
@@ -2569,12 +2569,12 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
2569
2569
  "data-tooltip-delay": 0,
2570
2570
  "data-testid": i,
2571
2571
  children: [
2572
- n && /* @__PURE__ */ l(se, { icon: n }),
2572
+ n && /* @__PURE__ */ c(se, { icon: n }),
2573
2573
  o
2574
2574
  ]
2575
2575
  },
2576
2576
  t
2577
- )) }) : null, $i = ({
2577
+ )) }) : null, zi = ({
2578
2578
  category: e,
2579
2579
  categoryNotFound: t,
2580
2580
  frameLink: o,
@@ -2601,7 +2601,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
2601
2601
  testId: "comment-frame-link-chip"
2602
2602
  }
2603
2603
  ] : []
2604
- ], Oi = ({
2604
+ ], Bi = ({
2605
2605
  onDelete: e,
2606
2606
  onEdit: t,
2607
2607
  onCopyText: o,
@@ -2611,37 +2611,37 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
2611
2611
  projectName: s,
2612
2612
  entity: i
2613
2613
  }) => {
2614
- const c = [], m = (p) => () => {
2614
+ const l = [], m = (p) => () => {
2615
2615
  a?.(), p();
2616
2616
  };
2617
- return t && c.push({
2617
+ return t && l.push({
2618
2618
  id: "edit",
2619
2619
  label: "Edit",
2620
2620
  icon: "edit_square",
2621
2621
  onClick: m(t)
2622
- }), o && c.push({
2622
+ }), o && l.push({
2623
2623
  id: "copy-text",
2624
2624
  label: "Copy text",
2625
2625
  icon: "content_copy",
2626
2626
  onClick: m(o)
2627
- }), n && c.push({
2627
+ }), n && l.push({
2628
2628
  id: "duplicate",
2629
2629
  label: "Duplicate",
2630
2630
  icon: "library_add",
2631
2631
  onClick: m(n)
2632
- }), c.push({
2632
+ }), l.push({
2633
2633
  id: "copy-link",
2634
2634
  label: "Copy link",
2635
2635
  icon: "link",
2636
- onClick: m(() => En(na(s, r, i)))
2637
- }), e && c.push({
2636
+ onClick: m(() => Mn(ra(s, r, i)))
2637
+ }), e && l.push({
2638
2638
  id: "delete",
2639
2639
  label: "Delete",
2640
2640
  icon: "delete",
2641
2641
  onClick: m(e),
2642
2642
  danger: !0
2643
- }), /* @__PURE__ */ l(Qa, { menu: c });
2644
- }, Vi = ({
2643
+ }), /* @__PURE__ */ c(Za, { menu: l });
2644
+ }, Gi = ({
2645
2645
  activity: e = {},
2646
2646
  annotationFrameStart: t,
2647
2647
  onCheckChange: o,
@@ -2650,277 +2650,277 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
2650
2650
  onDuplicate: r,
2651
2651
  projectInfo: s,
2652
2652
  editProps: i,
2653
- projectName: c,
2653
+ projectName: l,
2654
2654
  entityType: m,
2655
2655
  onReferenceClick: p,
2656
2656
  onFileExpand: g,
2657
2657
  showOrigin: u,
2658
2658
  isHighlighted: h,
2659
- readOnly: v,
2659
+ readOnly: b,
2660
2660
  statuses: y = []
2661
2661
  }) => {
2662
2662
  const {
2663
2663
  userName: D,
2664
- createReaction: P,
2664
+ createReaction: M,
2665
2665
  deleteReaction: C,
2666
2666
  editingId: f,
2667
- setEditingId: b,
2668
- isGuest: T,
2669
- userTeamNames: I
2670
- } = $e(), _ = ge(null), { toggleMenuOpen: R, menuOpen: E } = Oa(), { categoryData: N, categoryNotFound: Q } = qn(e?.activityData?.category), Y = _n(N?.color);
2667
+ setEditingId: w,
2668
+ isGuest: A,
2669
+ userTeamNames: S
2670
+ } = $e(), P = pe(null), { toggleMenuOpen: _, menuOpen: E } = Ba(), { categoryData: N, categoryNotFound: G } = Wn(e?.activityData?.category), X = Rn(N?.color);
2671
2671
  let {
2672
- body: H,
2673
- authorName: J,
2674
- authorFullName: q,
2672
+ body: Q,
2673
+ authorName: Z,
2674
+ authorFullName: Y,
2675
2675
  createdAt: $,
2676
- referenceType: te,
2677
- entityId: oe,
2678
- activityId: W,
2679
- author: U,
2676
+ referenceType: oe,
2677
+ entityId: ae,
2678
+ activityId: J,
2679
+ author: j,
2680
2680
  isOwner: de,
2681
- files: ae = [],
2682
- origin: ne
2681
+ files: H = [],
2682
+ origin: ee
2683
2683
  } = e;
2684
- J || (J = U?.name || ""), q = Wn({ name: J, label: q });
2685
- const Qe = wo(), we = `activity-comment-menu-${W}-${Qe}`, xe = E === we, { onGoToFrame: ke, setHighlightedActivities: he, user: Me, commentFrameLink: K } = ze(), Te = !!Me?.data?.isAdmin, Oe = de || Te, Se = de || Te, De = () => {
2686
- b(W);
2687
- }, Ye = () => {
2688
- b(null);
2689
- }, Ve = async (A, me, ye) => {
2690
- await a?.(A, me, void 0, ye), b(null);
2691
- }, fe = f === W, Be = ({ activityId: A, url: me }) => {
2692
- document.getElementById(A) ? he([A]) : window.open(me, "_blank", "noreferrer");
2693
- }, Ge = te !== "origin" || u, re = async () => {
2694
- const A = hi(H);
2695
- Ge && ne && A.push({ id: ne.id, type: ne.type }), n && await n(W, oe, A);
2696
- }, Je = () => {
2697
- or({
2684
+ Z || (Z = j?.name || ""), Y = Qn({ name: Z, label: Y });
2685
+ const Oe = Ao(), De = `activity-comment-menu-${J}-${Oe}`, Ve = E === De, { onGoToFrame: be, setHighlightedActivities: ge, user: Ge, commentFrameLink: ue } = Be(), xe = !!Ge?.data?.isAdmin, he = de || xe, Ne = de || xe, Ie = () => {
2686
+ w(J);
2687
+ }, Ze = () => {
2688
+ w(null);
2689
+ }, Re = async (v, K, we) => {
2690
+ await a?.(v, K, void 0, we), w(null);
2691
+ }, fe = f === J, He = ({ activityId: v, url: K }) => {
2692
+ document.getElementById(v) ? ge([v]) : window.open(K, "_blank", "noreferrer");
2693
+ }, qe = oe !== "origin" || u, re = async () => {
2694
+ const v = wi(Q);
2695
+ qe && ee && v.push({ id: ee.id, type: ee.type }), n && await n(J, ae, v);
2696
+ }, et = () => {
2697
+ cr({
2698
2698
  title: "Delete comment",
2699
2699
  message: "Are you sure you want to delete this comment?",
2700
2700
  accept: async () => {
2701
2701
  await re();
2702
2702
  }
2703
2703
  });
2704
- }, [, Pe] = In(), He = S(
2705
- () => xi(e.reactions, D),
2704
+ }, [, je] = En(), We = I(
2705
+ () => Ti(e.reactions, D),
2706
2706
  [[...e.reactions || []]]
2707
- ), _e = (A) => {
2708
- A.isActive ? P({
2709
- projectName: c,
2707
+ ), Ee = (v) => {
2708
+ v.isActive ? M({
2709
+ projectName: l,
2710
2710
  // @ts-ignore exposed endpoint doesn't need the username, we still need to pass it for the optimistic update
2711
2711
  userName: D,
2712
- activityId: W,
2712
+ activityId: J,
2713
2713
  createReactionModel: {
2714
- reaction: A.type
2714
+ reaction: v.type
2715
2715
  }
2716
2716
  }) : C({
2717
- projectName: c,
2717
+ projectName: l,
2718
2718
  // @ts-ignore exposed endpoint doesn't need the username, we still need to pass it for the optimistic update
2719
2719
  userName: D,
2720
- activityId: W,
2721
- reaction: A.type
2720
+ activityId: J,
2721
+ reaction: v.type
2722
2722
  });
2723
- }, je = qe(
2724
- (A) => {
2725
- A.annotation && (ke?.(A.annotation.range[0]), he([W]));
2723
+ }, Ue = Je(
2724
+ (v) => {
2725
+ v.annotation && (be?.(v.annotation.range[0]), ge([J]));
2726
2726
  },
2727
- [ke]
2728
- ), Ae = S(() => Rt(H), [H]), Re = S(
2729
- () => (ae || []).filter((A) => !Ae.has(A.id)),
2730
- [ae, Ae]
2731
- ), w = (A) => {
2732
- const me = ua(A), ye = (ae || []).filter((Ee) => vt(Ee.mime, Ee.ext)), Ie = ye.findIndex((Ee) => Ee.id === me);
2733
- Ie !== -1 && g?.({ files: ye, index: Ie, activityId: W });
2734
- }, M = S(() => Sn(H || ""), [H]), O = S(() => yt(e), [e]), X = K?.formatFrame ?? ((A) => Bn(A, t)), ue = () => {
2735
- O && (K ? K.goTo(O) : ke?.(O.startFrame), he([W]));
2727
+ [be]
2728
+ ), ke = I(() => $t(Q), [Q]), Me = I(
2729
+ () => (H || []).filter((v) => !ke.has(v.id)),
2730
+ [H, ke]
2731
+ ), q = (v) => {
2732
+ const K = ga(v), we = (H || []).filter((Fe) => vt(Fe.mime, Fe.ext)), Ae = we.findIndex((Fe) => Fe.id === K);
2733
+ Ae !== -1 && g?.({ files: we, index: Ae, activityId: J });
2734
+ }, Pe = I(() => Sn(Q || ""), [Q]), T = I(() => yt(e), [e]), R = ue?.formatFrame ?? ((v) => Gn(v, t)), U = () => {
2735
+ T && (ue ? ue.goTo(T) : be?.(T.startFrame), ge([J]));
2736
2736
  };
2737
- return /* @__PURE__ */ k(Ce, { children: [
2738
- /* @__PURE__ */ k(
2739
- oa,
2737
+ return /* @__PURE__ */ x(Te, { children: [
2738
+ /* @__PURE__ */ x(
2739
+ ia,
2740
2740
  {
2741
- className: ee("comment", {
2741
+ className: ne("comment", {
2742
2742
  isOwner: de,
2743
2743
  isEditing: fe,
2744
2744
  isHighlighted: h,
2745
- category: !!N && !T,
2746
- menuOpen: xe
2745
+ category: !!N && !A,
2746
+ menuOpen: Ve
2747
2747
  }),
2748
- id: W,
2748
+ id: J,
2749
2749
  $categoryPrimary: N?.color,
2750
- $categoryTertiary: Y.primary,
2751
- $categorySecondary: Y.secondary,
2750
+ $categoryTertiary: X.primary,
2751
+ $categorySecondary: X.secondary,
2752
2752
  children: [
2753
- /* @__PURE__ */ l(
2754
- Qn,
2753
+ /* @__PURE__ */ c(
2754
+ Yn,
2755
2755
  {
2756
- name: J,
2757
- fullName: q,
2756
+ name: Z,
2757
+ fullName: Y,
2758
2758
  date: $,
2759
- isRef: Ge,
2759
+ isRef: qe,
2760
2760
  activity: e,
2761
- projectName: c,
2761
+ projectName: l,
2762
2762
  entityType: m,
2763
2763
  onReferenceClick: p,
2764
- onReferenceTooltip: Pe,
2764
+ onReferenceTooltip: je,
2765
2765
  children: void 0
2766
2766
  }
2767
2767
  ),
2768
- /* @__PURE__ */ k(aa, { className: ee("comment-body", { isEditing: fe }), children: [
2769
- !v && /* @__PURE__ */ k(ra, { className: "tools", children: [
2770
- Se && /* @__PURE__ */ l(on, { icon: "edit_square", onClick: De, variant: "text" }),
2771
- /* @__PURE__ */ l(
2772
- on,
2768
+ /* @__PURE__ */ x(sa, { className: ne("comment-body", { isEditing: fe }), children: [
2769
+ !b && /* @__PURE__ */ x(ca, { className: "tools", children: [
2770
+ Ne && /* @__PURE__ */ c(rn, { icon: "edit_square", onClick: Ie, variant: "text" }),
2771
+ /* @__PURE__ */ c(
2772
+ rn,
2773
2773
  {
2774
2774
  icon: "more_horiz",
2775
- ref: _,
2776
- onClick: (A) => {
2777
- A.stopPropagation(), R(we);
2775
+ ref: P,
2776
+ onClick: (v) => {
2777
+ v.stopPropagation(), _(De);
2778
2778
  },
2779
- className: xe ? "active" : ""
2779
+ className: Ve ? "active" : ""
2780
2780
  }
2781
2781
  )
2782
2782
  ] }),
2783
- fe ? /* @__PURE__ */ l(
2784
- Gn,
2783
+ fe ? /* @__PURE__ */ c(
2784
+ Hn,
2785
2785
  {
2786
- initValue: H,
2787
- initFiles: ae,
2786
+ initValue: Q,
2787
+ initFiles: H,
2788
2788
  annotationFrameStart: t,
2789
2789
  initCategory: N?.name,
2790
2790
  data: e.activityData,
2791
- activityId: W,
2791
+ activityId: J,
2792
2792
  versionReview: !1,
2793
2793
  isEditing: !0,
2794
- onClose: Ye,
2795
- onSubmit: Ve,
2794
+ onClose: Ze,
2795
+ onSubmit: Re,
2796
2796
  isOpen: !0,
2797
2797
  ...i
2798
2798
  }
2799
- ) : /* @__PURE__ */ k(Ce, { children: [
2800
- /* @__PURE__ */ l(
2801
- Li,
2799
+ ) : /* @__PURE__ */ x(Te, { children: [
2800
+ /* @__PURE__ */ c(
2801
+ Ui,
2802
2802
  {
2803
- flags: $i({
2803
+ flags: zi({
2804
2804
  category: N,
2805
- categoryNotFound: Q,
2806
- frameLink: O,
2807
- formatFrame: X,
2808
- onFrameLinkClick: ue,
2809
- canNavigateToFrame: !!K || !!ke,
2810
- isGuest: T
2805
+ categoryNotFound: G,
2806
+ frameLink: T,
2807
+ formatFrame: R,
2808
+ onFrameLinkClick: U,
2809
+ canNavigateToFrame: !!ue || !!be,
2810
+ isGuest: A
2811
2811
  })
2812
2812
  }
2813
2813
  ),
2814
- /* @__PURE__ */ l(wi, { children: /* @__PURE__ */ l(
2815
- kn,
2814
+ /* @__PURE__ */ c(Ci, { children: /* @__PURE__ */ c(
2815
+ An,
2816
2816
  {
2817
2817
  remarkPlugins: [
2818
+ Cn,
2818
2819
  Fn,
2819
- An,
2820
- ko,
2821
- Jr,
2822
- Ao
2820
+ Co,
2821
+ ti,
2822
+ To
2823
2823
  ],
2824
- urlTransform: (A) => A,
2824
+ urlTransform: (v) => v,
2825
2825
  components: {
2826
2826
  // a links
2827
2827
  // @ts-ignore
2828
- a: (A) => (
2828
+ a: (v) => (
2829
2829
  // @ts-ignore
2830
- da(A, {
2831
- entityId: ne?.id ?? oe,
2832
- entityType: ne?.type ?? m,
2830
+ pa(v, {
2831
+ entityId: ee?.id ?? ae,
2832
+ entityType: ee?.type ?? m,
2833
2833
  userName: D,
2834
- userTeamNames: I,
2835
- projectName: c,
2834
+ userTeamNames: S,
2835
+ projectName: l,
2836
2836
  onReferenceClick: p,
2837
- onReferenceTooltip: Pe,
2838
- activityId: W,
2837
+ onReferenceTooltip: je,
2838
+ activityId: J,
2839
2839
  categoryPrimary: N?.color,
2840
- categorySecondary: Y.secondary,
2841
- onActivityLinkClick: Be
2840
+ categorySecondary: X.secondary,
2841
+ onActivityLinkClick: He
2842
2842
  })
2843
2843
  ),
2844
2844
  // checkbox inputs
2845
2845
  // @ts-ignore
2846
- input: (A) => la(A, { activity: e, onCheckChange: o }),
2846
+ input: (v) => ma(v, { activity: e, onCheckChange: o }),
2847
2847
  // code syntax highlighting
2848
2848
  // eslint-disable-next-line
2849
2849
  // @ts-ignore
2850
- code: (A) => ca(A),
2850
+ code: (v) => ua(v),
2851
2851
  // @ts-ignore
2852
- blockquote: (A) => sa(A),
2852
+ blockquote: (v) => da(v),
2853
2853
  // @ts-ignore
2854
- tip: (A) => /* @__PURE__ */ k(ia, { children: [
2855
- /* @__PURE__ */ l(se, { icon: "info" }),
2856
- A.children
2854
+ tip: (v) => /* @__PURE__ */ x(la, { children: [
2855
+ /* @__PURE__ */ c(se, { icon: "info" }),
2856
+ v.children
2857
2857
  ] }),
2858
2858
  // a video url on its own line is an embedded video
2859
2859
  // @ts-ignore
2860
- p: (A) => Za(A, { onOpen: w }) ?? er(A) ?? /* @__PURE__ */ l("p", { children: A.children }),
2860
+ p: (v) => ar(v, { onOpen: q }) ?? rr(v) ?? /* @__PURE__ */ c("p", { children: v.children }),
2861
2861
  // @ts-ignore
2862
- status: (A) => /* @__PURE__ */ l(Fi, { name: A.id, statuses: y, children: A.children })
2862
+ status: (v) => /* @__PURE__ */ c(Ii, { name: v.id, statuses: y, children: v.children })
2863
2863
  },
2864
- children: M
2864
+ children: Pe
2865
2865
  }
2866
2866
  ) }),
2867
- /* @__PURE__ */ l(
2868
- Pn,
2867
+ /* @__PURE__ */ c(
2868
+ _n,
2869
2869
  {
2870
- files: Re,
2871
- isCompact: Re.length > 6,
2872
- activityId: W,
2873
- projectName: c,
2870
+ files: Me,
2871
+ isCompact: Me.length > 6,
2872
+ activityId: J,
2873
+ projectName: l,
2874
2874
  isDownloadable: !0,
2875
2875
  onExpand: g,
2876
- onAnnotationClick: je,
2876
+ onAnnotationClick: Ue,
2877
2877
  pt: { file: { annotationFrameStart: t } },
2878
2878
  onRemove: void 0
2879
2879
  }
2880
2880
  )
2881
2881
  ] }),
2882
- !fe && /* @__PURE__ */ l("div", { style: { marginTop: "16px" }, children: He && /* @__PURE__ */ l(
2883
- gi,
2882
+ !fe && /* @__PURE__ */ c("div", { style: { marginTop: "16px" }, children: We && /* @__PURE__ */ c(
2883
+ bi,
2884
2884
  {
2885
- reactions: He,
2886
- changeHandler: _e,
2887
- readOnly: v,
2888
- category: N && !T ? N.name : void 0,
2885
+ reactions: We,
2886
+ changeHandler: Ee,
2887
+ readOnly: b,
2888
+ category: N && !A ? N.name : void 0,
2889
2889
  categoryPrimary: N?.color,
2890
- categorySecondary: Y.secondary,
2891
- categoryTertiary: Y.primary
2890
+ categorySecondary: X.secondary,
2891
+ categoryTertiary: X.primary
2892
2892
  }
2893
2893
  ) })
2894
2894
  ] })
2895
2895
  ]
2896
2896
  }
2897
2897
  ),
2898
- /* @__PURE__ */ l(
2899
- Ya,
2898
+ /* @__PURE__ */ c(
2899
+ er,
2900
2900
  {
2901
- target: _.current,
2902
- id: we,
2901
+ target: P.current,
2902
+ id: De,
2903
2903
  align: "right",
2904
- onClose: (A) => {
2905
- A?.stopPropagation(), R(!1);
2904
+ onClose: (v) => {
2905
+ v?.stopPropagation(), _(!1);
2906
2906
  },
2907
- children: /* @__PURE__ */ l(
2908
- Oi,
2907
+ children: /* @__PURE__ */ c(
2908
+ Bi,
2909
2909
  {
2910
- onDelete: Oe && n ? Je : void 0,
2911
- onEdit: Se ? De : void 0,
2912
- onCopyText: M ? () => En(M) : void 0,
2910
+ onDelete: he && n ? et : void 0,
2911
+ onEdit: Ne ? Ie : void 0,
2912
+ onCopyText: Pe ? () => Mn(Pe) : void 0,
2913
2913
  onDuplicate: r ? () => r(e) : void 0,
2914
- activityId: W,
2915
- onSelect: () => R(!1),
2916
- projectName: c,
2917
- entity: ne ?? (oe ? { id: oe, type: m } : void 0)
2914
+ activityId: J,
2915
+ onSelect: () => _(!1),
2916
+ projectName: l,
2917
+ entity: ee ?? (ae ? { id: ae, type: m } : void 0)
2918
2918
  }
2919
2919
  )
2920
2920
  }
2921
2921
  )
2922
2922
  ] });
2923
- }, ji = F.li`
2923
+ }, Hi = F.li`
2924
2924
  list-style: none;
2925
2925
  margin: 0;
2926
2926
  padding: 0;
@@ -2930,7 +2930,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
2930
2930
  padding: 4px 8px;
2931
2931
  border-radius: var(--border-radius-m);
2932
2932
  user-select: none;
2933
- `, Ui = F.div`
2933
+ `, qi = F.div`
2934
2934
  display: flex;
2935
2935
  flex-wrap: wrap;
2936
2936
  align-items: center;
@@ -2953,10 +2953,10 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
2953
2953
  font-size: 12px;
2954
2954
  font-weight: 800;
2955
2955
  }
2956
- `, zi = (e, t) => {
2956
+ `, Wi = (e, t) => {
2957
2957
  let o = [], n = {};
2958
2958
  return e.activityData.origin.type == "folder" && !n.folder && (n.folder = !0, o.push(e.activityData.origin.name)), e.activityData.origin.type == "task" && !n.task && (n.task = !0, o.push(e.activityData.origin.name)), (t == "version" || e.activityData.origin.type == "version") && (n.product || (n.product = !0, o.push(e.activityData.parents?.find((a) => a.type == "product")?.name)), n.version || (n.version = !0, o.push(e.activityData.origin.name))), o;
2959
- }, Bi = F.div`
2959
+ }, Qi = F.div`
2960
2960
  display: inline-flex;
2961
2961
  align-items: center;
2962
2962
  gap: var(--base-gap-small);
@@ -2965,7 +2965,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
2965
2965
  font-variation-settings: 'FILL' 1;
2966
2966
  font-size: 16px;
2967
2967
  }
2968
- `, Gi = F.span`
2968
+ `, Yi = F.span`
2969
2969
  color: var(--md-sys-color-outline);
2970
2970
  font-size: 12px;
2971
2971
  max-width: 300px;
@@ -2975,37 +2975,37 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
2975
2975
  span {
2976
2976
  font-size: inherit;
2977
2977
  }
2978
- `, Pt = ft(
2979
- ({ icon: e, color: t, name: o, items: n, ...a }, r) => /* @__PURE__ */ k(Bi, { ...a, ref: r, children: [
2980
- e && /* @__PURE__ */ l(se, { icon: e, style: { color: t } }),
2981
- /* @__PURE__ */ l(Gi, { title: o, children: n ? n.map((s, i) => /* @__PURE__ */ k(xo, { children: [
2982
- /* @__PURE__ */ l("span", { style: { color: s.color }, children: s.label }),
2978
+ `, _t = ft(
2979
+ ({ icon: e, color: t, name: o, items: n, ...a }, r) => /* @__PURE__ */ x(Qi, { ...a, ref: r, children: [
2980
+ e && /* @__PURE__ */ c(se, { icon: e, style: { color: t } }),
2981
+ /* @__PURE__ */ c(Yi, { title: o, children: n ? n.map((s, i) => /* @__PURE__ */ x(Fo, { children: [
2982
+ /* @__PURE__ */ c("span", { style: { color: s.color }, children: s.label }),
2983
2983
  i < n.length - 1 && ", "
2984
2984
  ] }, i)) : o })
2985
2985
  ] })
2986
- ), Hi = (e) => {
2986
+ ), Ji = (e) => {
2987
2987
  const t = typeof e.icon == "string" ? e.icon : e.icon?.name, o = e.color ?? (typeof e.icon == "object" ? e.icon?.color : void 0);
2988
2988
  return { name: e.label, icon: t, color: o };
2989
- }, qi = (e, t) => {
2989
+ }, Ki = (e, t) => {
2990
2990
  const o = t?.data.enum?.find((n) => n.value === e)?.label;
2991
2991
  if (o) return o;
2992
2992
  if (t?.data.type === "datetime") {
2993
2993
  const n = new Date(String(e));
2994
- if (!isNaN(n.getTime())) return ma(n, "dd-MM-yyyy");
2994
+ if (!isNaN(n.getTime())) return ha(n, "dd-MM-yyyy");
2995
2995
  }
2996
2996
  return String(e);
2997
- }, Wi = (e, t) => e === "description" || t?.data.widget === "markdown", Qi = (e, t, o) => {
2997
+ }, Xi = (e, t) => e === "description" || t?.data.widget === "markdown", Zi = (e, t, o) => {
2998
2998
  if (e == null || e === "" || Array.isArray(e) && !e.length) return { name: "none" };
2999
- if (typeof e == "string" && Wi(o, t))
3000
- return { name: tr(e) || "none" };
2999
+ if (typeof e == "string" && Xi(o, t))
3000
+ return { name: ir(e) || "none" };
3001
3001
  if (t?.data.type === "boolean") return { name: e ? "Checked" : "Unchecked" };
3002
3002
  const a = Array.isArray(e) ? e : [e];
3003
3003
  if (a.length === 1) {
3004
3004
  const r = t?.data.enum?.find((s) => s.value === a[0]);
3005
- if (r) return Hi(r);
3005
+ if (r) return Ji(r);
3006
3006
  }
3007
- return { name: a.map((r) => qi(r, t)).join(", ") };
3008
- }, Yi = ({
3007
+ return { name: a.map((r) => Ki(r, t)).join(", ") };
3008
+ }, es = ({
3009
3009
  entityType: e,
3010
3010
  projectInfo: t,
3011
3011
  activity: o = {}
@@ -3016,37 +3016,37 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3016
3016
  authorFullName: r,
3017
3017
  createdAt: s,
3018
3018
  oldStatus: i,
3019
- newStatus: c,
3019
+ newStatus: l,
3020
3020
  activityData: m = {}
3021
- } = o, { key: p, oldValue: g, newValue: u } = m, h = zi(o, e), v = n === "attrib.change", y = n === "tags.change", D = n === "subtype.change", { data: P = [] } = Da(void 0, { skip: !v }), C = S(() => P.find((N) => N.name === p), [P, p]), f = v ? C?.data.title || p : y ? "Tags" : D ? "Type" : void 0, b = (N) => ({
3021
+ } = o, { key: p, oldValue: g, newValue: u } = m, h = Wi(o, e), b = n === "attrib.change", y = n === "tags.change", D = n === "subtype.change", { data: M = [] } = Ma(void 0, { skip: !b }), C = I(() => M.find((N) => N.name === p), [M, p]), f = b ? C?.data.title || p : y ? "Tags" : D ? "Type" : void 0, w = (N) => ({
3022
3022
  name: N?.name || "",
3023
3023
  icon: N?.icon,
3024
3024
  color: N?.color
3025
- }), T = (N) => {
3026
- const Q = Array.isArray(N) ? N.map(String) : [];
3027
- if (!Q.length) return { name: "none" };
3028
- const Y = Q.map((H) => ({
3029
- label: H,
3030
- color: t?.tags?.find((J) => J.name === H)?.color
3025
+ }), A = (N) => {
3026
+ const G = Array.isArray(N) ? N.map(String) : [];
3027
+ if (!G.length) return { name: "none" };
3028
+ const X = G.map((Q) => ({
3029
+ label: Q,
3030
+ color: t?.tags?.find((Z) => Z.name === Q)?.color
3031
3031
  }));
3032
- return { name: Q.join(", "), items: Y };
3033
- }, I = n === "status.change", _ = (N, Q) => I ? b(Q) : y ? T(N) : Qi(N, C, p), R = _(g, i), E = _(u, c);
3034
- return /* @__PURE__ */ k(ji, { children: [
3035
- /* @__PURE__ */ k(Ui, { children: [
3036
- /* @__PURE__ */ l(Dt, { children: r || a }),
3037
- /* @__PURE__ */ k(Dt, { children: [
3032
+ return { name: G.join(", "), items: X };
3033
+ }, S = n === "status.change", P = (N, G) => S ? w(G) : y ? A(N) : Zi(N, C, p), _ = P(g, i), E = P(u, l);
3034
+ return /* @__PURE__ */ x(Hi, { children: [
3035
+ /* @__PURE__ */ x(qi, { children: [
3036
+ /* @__PURE__ */ c(Dt, { children: r || a }),
3037
+ /* @__PURE__ */ x(Dt, { children: [
3038
3038
  "- ",
3039
3039
  h.join(" / "),
3040
3040
  " -"
3041
3041
  ] }),
3042
- f && /* @__PURE__ */ l(Dt, { children: /* @__PURE__ */ l("strong", { children: f }) }),
3043
- /* @__PURE__ */ l(Pt, { ...R }),
3044
- /* @__PURE__ */ l(se, { icon: "trending_flat" }),
3045
- /* @__PURE__ */ l(Pt, { ...E })
3042
+ f && /* @__PURE__ */ c(Dt, { children: /* @__PURE__ */ c("strong", { children: f }) }),
3043
+ /* @__PURE__ */ c(_t, { ..._ }),
3044
+ /* @__PURE__ */ c(se, { icon: "trending_flat" }),
3045
+ /* @__PURE__ */ c(_t, { ...E })
3046
3046
  ] }),
3047
- /* @__PURE__ */ l(ut, { date: s })
3047
+ /* @__PURE__ */ c(lt, { date: s })
3048
3048
  ] });
3049
- }, Ji = F.li`
3049
+ }, Jn = F.li`
3050
3050
  /* reset default */
3051
3051
  list-style: none;
3052
3052
  margin: 0;
@@ -3059,7 +3059,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3059
3059
  padding: 4px 8px;
3060
3060
  border-radius: var(--border-radius-m);
3061
3061
  user-select: none;
3062
- `, Ki = F.div`
3062
+ `, Kn = F.div`
3063
3063
  display: flex;
3064
3064
  flex-wrap: nowrap;
3065
3065
  align-items: start;
@@ -3067,18 +3067,18 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3067
3067
  gap: var(--base-gap-small);
3068
3068
  padding: 0px 4px;
3069
3069
  overflow: hidden;
3070
- `, Xi = F.span`
3070
+ `, Rt = F.span`
3071
3071
  color: var(--md-sys-color-outline);
3072
3072
  white-space: wrap;
3073
3073
  font-size: 12px;
3074
- `, fn = ({ activity: e, isAdding: t }) => {
3074
+ `, yn = ({ activity: e, isAdding: t }) => {
3075
3075
  const { authorFullName: o, createdAt: n, activityData: a, authorName: r } = e || {}, { assignee: s } = a || {};
3076
3076
  let i = o || r;
3077
- return i += t ? " added " : " removed ", i += "assignee: " + s, /* @__PURE__ */ l(Ji, { children: /* @__PURE__ */ k(Ki, { children: [
3078
- /* @__PURE__ */ l(Xi, { children: i }),
3079
- /* @__PURE__ */ l(ut, { date: n })
3077
+ return i += t ? " added " : " removed ", i += "assignee: " + s, /* @__PURE__ */ c(Jn, { children: /* @__PURE__ */ x(Kn, { children: [
3078
+ /* @__PURE__ */ c(Rt, { children: i }),
3079
+ /* @__PURE__ */ c(lt, { date: n })
3080
3080
  ] }) });
3081
- }, Zi = F.li`
3081
+ }, ts = F.li`
3082
3082
  /* reset default */
3083
3083
  list-style: none;
3084
3084
  margin: 0;
@@ -3090,7 +3090,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3090
3090
 
3091
3091
  width: 100%;
3092
3092
  padding: 8px;
3093
- `, es = F.div`
3093
+ `, ns = F.div`
3094
3094
  border-radius: var(--border-radius-m);
3095
3095
  padding: var(--padding-m);
3096
3096
 
@@ -3106,7 +3106,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3106
3106
  display: inline;
3107
3107
  }
3108
3108
  }
3109
- `, ts = F.div`
3109
+ `, os = F.div`
3110
3110
  display: flex;
3111
3111
  flex-direction: row;
3112
3112
  justify-content: space-between;
@@ -3120,7 +3120,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3120
3120
  min-width: 0;
3121
3121
  overflow: hidden;
3122
3122
  }
3123
- `, yn = F.div`
3123
+ `, vn = F.div`
3124
3124
  display: flex;
3125
3125
  align-items: center;
3126
3126
  justify-content: space-between;
@@ -3144,7 +3144,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3144
3144
  display: none;
3145
3145
  flex: 1;
3146
3146
  }
3147
- `, ns = F(Ra)`
3147
+ `, as = F(ja)`
3148
3148
  width: 74px;
3149
3149
  min-width: 74px;
3150
3150
  height: unset;
@@ -3158,23 +3158,23 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3158
3158
  img {
3159
3159
  object-fit: cover;
3160
3160
  }
3161
- `, os = F.span`
3161
+ `, rs = F.span`
3162
3162
  overflow: hidden;
3163
3163
  text-overflow: ellipsis;
3164
3164
  white-space: nowrap;
3165
3165
  display: block;
3166
3166
  min-width: 0;
3167
- `, as = F.div`
3167
+ `, is = F.div`
3168
3168
  margin-top: var(--base-gap-small);
3169
3169
  color: var(--md-sys-color-outline);
3170
3170
  word-break: break-word;
3171
- `, rs = F.li`
3171
+ `, ss = F.li`
3172
3172
  /* reset default */
3173
3173
  list-style: none;
3174
3174
  margin: 0;
3175
3175
  padding: 0;
3176
3176
  padding: 0px 8px;
3177
- `, Yn = F.div`
3177
+ `, Xn = F.div`
3178
3178
  width: 100%;
3179
3179
  display: flex;
3180
3180
  align-items: center;
@@ -3197,7 +3197,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3197
3197
  &:hover {
3198
3198
  background-color: var(--md-sys-color-surface-container-hover);
3199
3199
  }
3200
- `, is = ({
3200
+ `, cs = ({
3201
3201
  activity: e,
3202
3202
  projectName: t,
3203
3203
  entityType: o,
@@ -3205,15 +3205,24 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3205
3205
  filter: a,
3206
3206
  statuses: r = []
3207
3207
  }) => {
3208
- const { onOpenViewer: s } = ze();
3209
- let { authorName: i, authorFullName: c, createdAt: m, versions: p = [] } = e;
3210
- const g = a === "versions" || a && typeof a == "object" && a.conditions?.some((C) => C.key === "versions" && C.value === !0), [u, h] = L(g), v = 2, [y, D] = L(!1), P = (C, f) => s?.({ versionIds: [C], productId: f, projectName: t });
3211
- return /* @__PURE__ */ k(Zi, { children: [
3212
- /* @__PURE__ */ l(
3213
- Qn,
3208
+ const { onOpenViewer: s } = Be();
3209
+ let { authorName: i, authorFullName: l, createdAt: m, versions: p = [] } = e;
3210
+ const g = a === "versions" || a && typeof a == "object" && a.conditions?.some((C) => C.key === "versions" && C.value === !0), [u, h] = L(g), b = 2, [y, D] = L(!1), M = (C, f, w) => {
3211
+ const A = fa(C);
3212
+ s?.({
3213
+ versionIds: [f],
3214
+ productId: w,
3215
+ projectName: t,
3216
+ reviewableIds: A && [A.fileId],
3217
+ goToPosition: A?.position
3218
+ });
3219
+ };
3220
+ return /* @__PURE__ */ x(ts, { children: [
3221
+ /* @__PURE__ */ c(
3222
+ Yn,
3214
3223
  {
3215
3224
  name: i,
3216
- fullName: c || i,
3225
+ fullName: l || i,
3217
3226
  date: m,
3218
3227
  activity: e,
3219
3228
  projectName: t,
@@ -3222,19 +3231,19 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3222
3231
  }
3223
3232
  ),
3224
3233
  p.flatMap((C, f) => {
3225
- const { name: b, id: T, productId: I, productName: _, thumbnailHash: R, comment: E } = C, N = r.find((Q) => Q.name === C.status);
3226
- return (f < v || u) && /* @__PURE__ */ k(es, { onClick: () => P(T, I), children: [
3227
- /* @__PURE__ */ k(ts, { children: [
3228
- /* @__PURE__ */ k("div", { children: [
3229
- /* @__PURE__ */ k(yn, { children: [
3230
- /* @__PURE__ */ l("span", { children: _ }),
3231
- /* @__PURE__ */ l(ut, { date: m, isExact: !0 })
3234
+ const { name: w, id: A, productId: S, productName: P, thumbnailHash: _, comment: E } = C, N = r.find((G) => G.name === C.status);
3235
+ return (f < b || u) && /* @__PURE__ */ x(ns, { onClick: (G) => M(G, A, S), children: [
3236
+ /* @__PURE__ */ x(os, { children: [
3237
+ /* @__PURE__ */ x("div", { children: [
3238
+ /* @__PURE__ */ x(vn, { children: [
3239
+ /* @__PURE__ */ c("span", { children: P }),
3240
+ /* @__PURE__ */ c(lt, { date: m, isExact: !0 })
3232
3241
  ] }),
3233
- /* @__PURE__ */ k(yn, { children: [
3234
- /* @__PURE__ */ l(os, { className: "version", children: b }),
3242
+ /* @__PURE__ */ x(vn, { children: [
3243
+ /* @__PURE__ */ c(rs, { className: "version", children: w }),
3235
3244
  " -",
3236
- /* @__PURE__ */ l(
3237
- Pt,
3245
+ /* @__PURE__ */ c(
3246
+ _t,
3238
3247
  {
3239
3248
  icon: N?.icon,
3240
3249
  color: N?.color,
@@ -3243,38 +3252,40 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3243
3252
  )
3244
3253
  ] })
3245
3254
  ] }),
3246
- /* @__PURE__ */ l(
3247
- ns,
3255
+ /* @__PURE__ */ c(
3256
+ as,
3248
3257
  {
3249
3258
  projectName: t,
3250
- entityId: T,
3259
+ entityId: A,
3251
3260
  entityType: "version",
3252
3261
  onError: () => D(!0),
3253
3262
  iconOnly: y,
3254
- thumbnailHash: R,
3255
- icon: "play_circle"
3263
+ thumbnailHash: _,
3264
+ icon: "play_circle",
3265
+ filmstrip: !0,
3266
+ filmstripFit: "cover"
3256
3267
  }
3257
3268
  )
3258
3269
  ] }),
3259
- E && /* @__PURE__ */ l(as, { children: E })
3260
- ] }, T);
3270
+ E && /* @__PURE__ */ c(is, { children: E })
3271
+ ] }, A);
3261
3272
  }),
3262
- !g && p.length > v && /* @__PURE__ */ k(Yn, { onClick: () => h(!u), children: [
3263
- /* @__PURE__ */ l(se, { icon: "more" }),
3264
- /* @__PURE__ */ l("span", { children: u ? "Show less" : `Show ${p.length - v} more versions` })
3273
+ !g && p.length > b && /* @__PURE__ */ x(Xn, { onClick: () => h(!u), children: [
3274
+ /* @__PURE__ */ c(se, { icon: "more" }),
3275
+ /* @__PURE__ */ c("span", { children: u ? "Show less" : `Show ${p.length - b} more versions` })
3265
3276
  ] })
3266
3277
  ] });
3267
- }, ss = ({ activities: e, editProps: t, ...o }) => {
3278
+ }, ls = ({ activities: e, editProps: t, ...o }) => {
3268
3279
  const [n, a] = L(!1);
3269
- return /* @__PURE__ */ k(Ce, { children: [
3270
- /* @__PURE__ */ l(rs, { children: /* @__PURE__ */ k(Yn, { onClick: () => a(!n), children: [
3271
- /* @__PURE__ */ l(se, { icon: n ? "expand_less" : "chevron_right" }),
3280
+ return /* @__PURE__ */ x(Te, { children: [
3281
+ /* @__PURE__ */ c(ss, { children: /* @__PURE__ */ x(Xn, { onClick: () => a(!n), children: [
3282
+ /* @__PURE__ */ c(se, { icon: n ? "expand_less" : "chevron_right" }),
3272
3283
  n ? "Show less" : "Show more"
3273
3284
  ] }) }),
3274
3285
  n && e.map((r) => (
3275
3286
  // @ts-expect-error
3276
- /* @__PURE__ */ l(
3277
- Jn,
3287
+ /* @__PURE__ */ c(
3288
+ Zn,
3278
3289
  {
3279
3290
  editProps: t,
3280
3291
  activity: r,
@@ -3285,7 +3296,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3285
3296
  )
3286
3297
  ))
3287
3298
  ] });
3288
- }, Jn = ({
3299
+ }, Zn = ({
3289
3300
  activity: e,
3290
3301
  fromGroup: t,
3291
3302
  annotationFrameStart: o,
@@ -3294,7 +3305,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3294
3305
  editProps: r,
3295
3306
  filter: s,
3296
3307
  readOnly: i,
3297
- statuses: c,
3308
+ statuses: l,
3298
3309
  isSlideOut: m,
3299
3310
  isGuest: p,
3300
3311
  ...g
@@ -3303,15 +3314,15 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3303
3314
  case "comment":
3304
3315
  return (
3305
3316
  // @ts-expect-error
3306
- /* @__PURE__ */ l(
3307
- Vi,
3317
+ /* @__PURE__ */ c(
3318
+ Gi,
3308
3319
  {
3309
3320
  activity: e,
3310
3321
  annotationFrameStart: o,
3311
3322
  projectInfo: n,
3312
3323
  editProps: r,
3313
3324
  readOnly: i,
3314
- statuses: c,
3325
+ statuses: l,
3315
3326
  isSlideOut: m,
3316
3327
  ...g
3317
3328
  }
@@ -3321,18 +3332,18 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3321
3332
  case "attrib.change":
3322
3333
  case "tags.change":
3323
3334
  case "subtype.change":
3324
- return /* @__PURE__ */ l(Yi, { activity: e, projectInfo: n, ...g });
3335
+ return /* @__PURE__ */ c(es, { activity: e, projectInfo: n, ...g });
3325
3336
  case "assignee.add":
3326
- return /* @__PURE__ */ l(fn, { activity: e, ...g, isAdding: !0 });
3337
+ return /* @__PURE__ */ c(yn, { activity: e, ...g, isAdding: !0 });
3327
3338
  case "assignee.remove":
3328
- return /* @__PURE__ */ l(fn, { activity: e, ...g });
3339
+ return /* @__PURE__ */ c(yn, { activity: e, ...g });
3329
3340
  case "version.publish":
3330
- return /* @__PURE__ */ l(is, { activity: e, projectInfo: n, filter: s, statuses: c, ...g });
3341
+ return /* @__PURE__ */ c(cs, { activity: e, projectInfo: n, filter: s, statuses: l, ...g });
3331
3342
  case "version.review":
3332
- return /* @__PURE__ */ l(Ri, { activity: e, isGuest: p, ...g });
3343
+ return /* @__PURE__ */ c(ji, { activity: e, isGuest: p, ...g });
3333
3344
  case "group":
3334
- return !t && /* @__PURE__ */ l(
3335
- ss,
3345
+ return !t && /* @__PURE__ */ c(
3346
+ ls,
3336
3347
  {
3337
3348
  editProps: r,
3338
3349
  activities: e.items || [],
@@ -3343,7 +3354,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3343
3354
  default:
3344
3355
  return null;
3345
3356
  }
3346
- }, cs = F.section`
3357
+ }, ds = F.section`
3347
3358
  padding-bottom: 4px;
3348
3359
  overflow: hidden;
3349
3360
  position: relative;
@@ -3391,7 +3402,7 @@ F.div`
3391
3402
  color: inherit;
3392
3403
  }
3393
3404
  `;
3394
- const ls = F.ul`
3405
+ const us = F.ul`
3395
3406
  gap: var(--base-gap-large);
3396
3407
  overflow-y: auto;
3397
3408
  padding: 24px 0;
@@ -3412,11 +3423,11 @@ const ls = F.ul`
3412
3423
  & > *:last-child {
3413
3424
  margin-top: 32px;
3414
3425
  }
3415
- `, ds = F.span`
3426
+ `, ms = F.span`
3416
3427
  padding: 16px 8px;
3417
3428
  color: var(--md-sys-color-outline);
3418
3429
  font-size: 11px;
3419
- `, us = F.div`
3430
+ `, ps = F.div`
3420
3431
  height: 50px;
3421
3432
  border-radius: 8px;
3422
3433
  overflow: hidden;
@@ -3424,7 +3435,7 @@ const ls = F.ul`
3424
3435
  opacity: 0.5;
3425
3436
 
3426
3437
  position: relative;
3427
- `, ms = ({
3438
+ `, gs = ({
3428
3439
  projectName: e,
3429
3440
  entityType: t,
3430
3441
  entities: o = [],
@@ -3435,33 +3446,33 @@ const ls = F.ul`
3435
3446
  createEntityActivity: r,
3436
3447
  updateActivity: s,
3437
3448
  deleteActivity: i,
3438
- isUpdatingActivity: c,
3449
+ isUpdatingActivity: l,
3439
3450
  userName: m,
3440
3451
  userFullName: p,
3441
3452
  activityTypes: g
3442
3453
  } = $e(), u = o.map((C) => C.id), h = ({
3443
3454
  entityId: C,
3444
3455
  newId: f,
3445
- subTitle: b,
3446
- value: T,
3447
- files: I = [],
3448
- data: _ = {}
3456
+ subTitle: w,
3457
+ value: A,
3458
+ files: S = [],
3459
+ data: P = {}
3449
3460
  }) => ({
3450
- body: T,
3461
+ body: A,
3451
3462
  activityType: "comment",
3452
3463
  activityId: f,
3453
3464
  entityId: C,
3454
3465
  referenceType: "origin",
3455
3466
  authorName: m,
3456
3467
  authorFullName: p,
3457
- createdAt: Ga(/* @__PURE__ */ new Date()),
3458
- files: I,
3468
+ createdAt: Ya(/* @__PURE__ */ new Date()),
3469
+ files: S,
3459
3470
  reactions: [],
3460
- activityData: _,
3471
+ activityData: P,
3461
3472
  origin: {
3462
3473
  id: "8090c2dafcc811eeaf820242c0a80002",
3463
3474
  type: t,
3464
- name: b
3475
+ name: w
3465
3476
  },
3466
3477
  author: {
3467
3478
  active: !0,
@@ -3469,61 +3480,61 @@ const ls = F.ul`
3469
3480
  }
3470
3481
  });
3471
3482
  return {
3472
- submitComment: async (C, f = [], b = {}) => {
3473
- const T = o.map(({ id: R, subTitle: E }) => {
3474
- const N = cn(), Q = f.map((te) => te.id), Y = a ? { ...b, entityList: a } : b, H = {
3483
+ submitComment: async (C, f = [], w = {}) => {
3484
+ const A = o.map(({ id: _, subTitle: E }) => {
3485
+ const N = ln(), G = f.map((oe) => oe.id), X = a ? { ...w, entityList: a } : w, Q = {
3475
3486
  body: C,
3476
3487
  activityType: "comment",
3477
3488
  id: N,
3478
- files: Q,
3479
- data: Y
3480
- }, J = f.filter(
3481
- ({ id: te }) => !b.annotations?.some(
3482
- (oe) => oe.transparent === te
3489
+ files: G,
3490
+ data: X
3491
+ }, Z = f.filter(
3492
+ ({ id: oe }) => !w.annotations?.some(
3493
+ (ae) => ae.transparent === oe
3483
3494
  )
3484
- ), q = h({ entityId: R, newId: N, subTitle: E, value: C, files: J, data: b });
3495
+ ), Y = h({ entityId: _, newId: N, subTitle: E, value: C, files: Z, data: w });
3485
3496
  return r({
3486
3497
  projectName: e,
3487
3498
  entityType: t,
3488
- entityId: R,
3489
- data: H,
3490
- patch: q,
3499
+ entityId: _,
3500
+ data: Q,
3501
+ patch: Y,
3491
3502
  filter: n,
3492
3503
  ...{ entityIds: u, activityTypes: g }
3493
3504
  });
3494
- }), _ = (await Promise.all(T)).filter((R) => R.error);
3495
- if (_.length > 0) {
3496
- const R = an(_[0].error) || "Failed to create comment";
3497
- throw Fe.error(R), new Error(R);
3505
+ }), P = (await Promise.all(A)).filter((_) => _.error);
3506
+ if (P.length > 0) {
3507
+ const _ = sn(P[0].error) || "Failed to create comment";
3508
+ throw Ce.error(_), new Error(_);
3498
3509
  }
3499
3510
  },
3500
- updateComment: async (C, f, b = [], T = {}) => {
3501
- const I = b.map((N) => N.id), _ = {
3511
+ updateComment: async (C, f, w = [], A = {}) => {
3512
+ const S = w.map((N) => N.id), P = {
3502
3513
  body: f,
3503
- files: I,
3504
- data: T
3505
- }, R = {
3514
+ files: S,
3515
+ data: A
3516
+ }, _ = {
3506
3517
  ...C,
3507
- ..._,
3508
- files: b,
3509
- activityData: T
3518
+ ...P,
3519
+ files: w,
3520
+ activityData: A
3510
3521
  }, E = { entityType: t, entityIds: u, activityTypes: g };
3511
3522
  try {
3512
3523
  await s({
3513
3524
  projectName: e,
3514
- data: _,
3525
+ data: P,
3515
3526
  activityId: C.activityId,
3516
3527
  entityId: C.entityId,
3517
- patch: R,
3528
+ patch: _,
3518
3529
  filter: n,
3519
3530
  ...E
3520
3531
  });
3521
3532
  } catch (N) {
3522
- throw Fe.error(an(N)), N;
3533
+ throw Ce.error(sn(N)), N;
3523
3534
  }
3524
3535
  },
3525
- deleteComment: async (C, f, b = []) => {
3526
- const T = { entityType: t, entityIds: u, activityTypes: g };
3536
+ deleteComment: async (C, f, w = []) => {
3537
+ const A = { entityType: t, entityIds: u, activityTypes: g };
3527
3538
  if (C)
3528
3539
  try {
3529
3540
  await i({
@@ -3532,32 +3543,32 @@ const ls = F.ul`
3532
3543
  entityId: f,
3533
3544
  filter: n,
3534
3545
  patch: { activityId: C },
3535
- refs: b,
3536
- ...T
3546
+ refs: w,
3547
+ ...A
3537
3548
  });
3538
3549
  } catch {
3539
3550
  }
3540
3551
  },
3541
3552
  submitReview: async (C) => {
3542
- const f = o.map(({ id: b, subTitle: T }) => {
3543
- const I = cn(), _ = { feedback: C, entityList: a }, R = {
3544
- body: Xr(C, t),
3553
+ const f = o.map(({ id: w, subTitle: A }) => {
3554
+ const S = ln(), P = { feedback: C, entityList: a }, _ = {
3555
+ body: oi(C, t),
3545
3556
  activityType: "version.review",
3546
- id: I,
3547
- data: _
3548
- }, E = h({ entityId: b, newId: I, subTitle: T, value: "", data: _ });
3557
+ id: S,
3558
+ data: P
3559
+ }, E = h({ entityId: w, newId: S, subTitle: A, value: "", data: P });
3549
3560
  return r({
3550
3561
  projectName: e,
3551
3562
  entityType: t,
3552
- entityId: b,
3553
- data: R,
3563
+ entityId: w,
3564
+ data: _,
3554
3565
  patch: E,
3555
3566
  filter: n
3556
3567
  });
3557
3568
  });
3558
3569
  await Promise.all(f);
3559
3570
  },
3560
- isSaving: c
3571
+ isSaving: l
3561
3572
  };
3562
3573
  }, Nt = (e = {}) => {
3563
3574
  const {
@@ -3566,9 +3577,9 @@ const ls = F.ul`
3566
3577
  origin: n = {},
3567
3578
  activityData: { context: { productName: a, productType: r, productId: s } = {} } = {},
3568
3579
  version: i
3569
- } = e, { name: c, id: m } = n;
3580
+ } = e, { name: l, id: m } = n;
3570
3581
  return {
3571
- name: c,
3582
+ name: l,
3572
3583
  id: m,
3573
3584
  productId: s,
3574
3585
  productName: a,
@@ -3579,7 +3590,7 @@ const ls = F.ul`
3579
3590
  status: i?.status,
3580
3591
  thumbnailHash: i?.thumbnailHash
3581
3592
  };
3582
- }, ps = 5, gs = (e = []) => {
3593
+ }, hs = 5, fs = (e = []) => {
3583
3594
  const t = [];
3584
3595
  let o = null;
3585
3596
  for (const n of e) {
@@ -3591,10 +3602,10 @@ const ls = F.ul`
3591
3602
  o = { ...n }, o.versions = [Nt(n)];
3592
3603
  continue;
3593
3604
  }
3594
- const a = o.authorName === n.authorName, r = o.origin.id === n.origin.id, i = Ha(
3605
+ const a = o.authorName === n.authorName, r = o.origin.id === n.origin.id, i = Ja(
3595
3606
  new Date(o.createdAt),
3596
3607
  new Date(n.createdAt)
3597
- ) <= ps;
3608
+ ) <= hs;
3598
3609
  if (a && i && r) {
3599
3610
  o.versions.push(Nt(n));
3600
3611
  continue;
@@ -3604,34 +3615,34 @@ const ls = F.ul`
3604
3615
  }
3605
3616
  }
3606
3617
  return o && t.push(o), t;
3607
- }, hs = (e, t) => {
3618
+ }, ys = (e, t) => {
3608
3619
  let o = {};
3609
- t.reduce((i, c) => (i[c.name] = c, i), o);
3620
+ t.reduce((i, l) => (i[l.name] = l, i), o);
3610
3621
  const n = [];
3611
3622
  let a = [];
3612
3623
  const r = (i) => {
3613
- const c = (h) => ["assignee.add", "assignee.remove"].includes(h[0].activityType) ? [
3624
+ const l = (h) => ["assignee.add", "assignee.remove"].includes(h[0].activityType) ? [
3614
3625
  {
3615
3626
  ...h[0],
3616
3627
  activityType: h[0].activityType,
3617
3628
  assignee: [
3618
3629
  ...h.map(
3619
- (v) => o[v.activityData.assignee]?.attrib?.fullName || v.activityData.assignee
3630
+ (b) => o[b.activityData.assignee]?.attrib?.fullName || b.activityData.assignee
3620
3631
  )
3621
3632
  ].join(", "),
3622
3633
  activityData: {
3623
3634
  ...h[0].activityData,
3624
3635
  assignee: h.map(
3625
- (v) => o[v.activityData.assignee]?.attrib?.fullName || v.activityData.assignee
3636
+ (b) => o[b.activityData.assignee]?.attrib?.fullName || b.activityData.assignee
3626
3637
  ).join(", ")
3627
3638
  }
3628
3639
  }
3629
3640
  ] : h;
3630
3641
  let m = [], p = [], g = null, u = null;
3631
3642
  return i.forEach((h) => {
3632
- g === null || g === h.activityType && u == h.authorName ? p.push(h) : (m.push(...c(p)), p = [h]), g = h.activityType, u = h.authorName;
3633
- }), p.length != 0 && m.push(...c(p)), m;
3634
- }, s = (i, c) => {
3643
+ g === null || g === h.activityType && u == h.authorName ? p.push(h) : (m.push(...l(p)), p = [h]), g = h.activityType, u = h.authorName;
3644
+ }), p.length != 0 && m.push(...l(p)), m;
3645
+ }, s = (i, l) => {
3635
3646
  if (a.length > 2) {
3636
3647
  if (i) {
3637
3648
  const m = a[0].activityData.assignee;
@@ -3646,20 +3657,20 @@ const ls = F.ul`
3646
3657
  n.push({
3647
3658
  activityType: "group",
3648
3659
  items: r(i ? a.slice(1) : a),
3649
- activityId: "group-" + c
3660
+ activityId: "group-" + l
3650
3661
  });
3651
3662
  } else a.length > 0 && a.forEach((m) => n.push(m));
3652
3663
  a = [];
3653
3664
  };
3654
3665
  for (const i of e)
3655
- if (fs.includes(i.activityType))
3666
+ if (vs.includes(i.activityType))
3656
3667
  a.push(i);
3657
3668
  else {
3658
- const c = n.length === 0;
3659
- s(c, n.length), n.push(i);
3669
+ const l = n.length === 0;
3670
+ s(l, n.length), n.push(i);
3660
3671
  }
3661
3672
  return a.length > 0 && s(!1, n.length), n;
3662
- }, vn = (e, t, o = "oldValue") => {
3673
+ }, bn = (e, t, o = "oldValue") => {
3663
3674
  const n = [];
3664
3675
  let a = null, r = null;
3665
3676
  for (const s of e)
@@ -3668,104 +3679,104 @@ const ls = F.ul`
3668
3679
  a = { ...s }, r = new Date(s.createdAt);
3669
3680
  continue;
3670
3681
  }
3671
- const i = a.authorName === s.authorName, c = a.origin.id === s.entityId, m = a.activityData?.key === s.activityData?.key, p = new Date(s.createdAt), u = r !== null && lt(r) && lt(p) && Math.abs(qa(r, p)) <= 20;
3672
- i && u && c && m ? (s[o] !== void 0 && (a[o] = s[o]), a.activityData = {
3682
+ const i = a.authorName === s.authorName, l = a.origin.id === s.entityId, m = a.activityData?.key === s.activityData?.key, p = new Date(s.createdAt), u = r !== null && Ke(r) && Ke(p) && Math.abs(Ka(r, p)) <= 20;
3683
+ i && u && l && m ? (s[o] !== void 0 && (a[o] = s[o]), a.activityData = {
3673
3684
  ...a.activityData,
3674
3685
  oldValue: s.activityData.oldValue
3675
3686
  }, a.hasPreviousPage = s.hasPreviousPage, a.cursor = s.cursor, r = p) : (a.activityData.oldValue !== a.activityData.newValue && n.push(a), a = { ...s }, r = p);
3676
3687
  } else
3677
3688
  a && (a.activityData.oldValue !== a.activityData.newValue && n.push(a), a = null, r = null), n.push(s);
3678
3689
  return a && a.activityData.oldValue !== a.activityData.newValue && !n.some((s) => s.activityId === a.activityId) && n.push(a), n;
3679
- }, fs = [
3690
+ }, vs = [
3680
3691
  "status.change",
3681
3692
  "assignee.add",
3682
3693
  "assignee.remove",
3683
3694
  "attrib.change",
3684
3695
  "tags.change",
3685
3696
  "subtype.change"
3686
- ], ys = (e = [], t = {}) => e.map((o) => {
3697
+ ], bs = (e = [], t = {}) => e.map((o) => {
3687
3698
  const n = { ...o, origin: { ...o.origin } };
3688
3699
  if (n.activityType === "status.change") {
3689
3700
  if (!t) return n;
3690
- const a = n.activityData?.oldValue, r = n.activityData?.newValue, s = t.statuses?.find((c) => c.name === a), i = t.statuses?.find((c) => c.name === r);
3701
+ const a = n.activityData?.oldValue, r = n.activityData?.newValue, s = t.statuses?.find((l) => l.name === a), i = t.statuses?.find((l) => l.name === r);
3691
3702
  n.oldStatus = { ...s, name: a }, n.newStatus = { ...i, name: r };
3692
3703
  }
3693
3704
  return n;
3694
- }), vs = (e = [], t = [], o) => t.includes(o) ? e.filter((n) => n.referenceType !== "relation") : e, bs = (e = [], t = [], o = {}, n, a, r) => {
3695
- const s = S(
3696
- () => ys(e, o),
3705
+ }), ws = (e = [], t = [], o) => t.includes(o) ? e.filter((n) => n.referenceType !== "relation") : e, xs = (e = [], t = [], o = {}, n, a, r) => {
3706
+ const s = I(
3707
+ () => bs(e, o),
3697
3708
  [e, o]
3698
- ), i = S(() => s.map((y) => ({ ...y, isOwner: a === y.authorName })), [s, a]), c = S(
3699
- () => vs(i, ["version"], n),
3709
+ ), i = I(() => s.map((y) => ({ ...y, isOwner: a === y.authorName })), [s, a]), l = I(
3710
+ () => ws(i, ["version"], n),
3700
3711
  [i, n]
3701
- ), m = S(() => [...c].sort((D, P) => {
3702
- const C = new Date(D.createdAt), f = new Date(P.createdAt), b = lt(C), T = lt(f);
3703
- if (!b && !T)
3712
+ ), m = I(() => [...l].sort((D, M) => {
3713
+ const C = new Date(D.createdAt), f = new Date(M.createdAt), w = Ke(C), A = Ke(f);
3714
+ if (!w && !A)
3704
3715
  return 0;
3705
- if (b) {
3706
- if (!T)
3716
+ if (w) {
3717
+ if (!A)
3707
3718
  return -1;
3708
3719
  } else return 1;
3709
- return Wa(f, C);
3710
- }), [c]), p = S(
3711
- () => vn(m, "status.change", "oldStatus"),
3720
+ return Xa(f, C);
3721
+ }), [l]), p = I(
3722
+ () => bn(m, "status.change", "oldStatus"),
3712
3723
  [m]
3713
- ), g = S(
3714
- () => vn(p, "attrib.change"),
3724
+ ), g = I(
3725
+ () => bn(p, "attrib.change"),
3715
3726
  [p]
3716
- ), u = S(() => r?.conditions?.some(
3727
+ ), u = I(() => r?.conditions?.some(
3717
3728
  (D) => "key" in D && D.key === "updates" && D.value === !0
3718
- ) ? g : hs(g, t), [g, t, r]), h = S(
3719
- () => gs(u),
3729
+ ) ? g : ys(g, t), [g, t, r]), h = I(
3730
+ () => fs(u),
3720
3731
  [u]
3721
3732
  );
3722
- return S(() => [...new Map(
3733
+ return I(() => [...new Map(
3723
3734
  h.filter((D) => D && D.activityId).map((D) => [D.activityId, D])
3724
3735
  ).values()], [h]);
3725
- }, bn = (e, t) => JSON.stringify({ entities: e.map((o) => o.id), filter: t }), ws = ({
3736
+ }, wn = (e, t) => JSON.stringify({ entities: e.map((o) => o.id), filter: t }), ks = ({
3726
3737
  entities: e = [],
3727
3738
  feedRef: t,
3728
3739
  filter: o,
3729
3740
  disabled: n,
3730
3741
  isLoading: a
3731
3742
  }) => {
3732
- const r = ge({}), s = (i) => {
3733
- const c = i.current.querySelectorAll(".scroll-to"), m = Array.from(c).map((g) => g.closest("li.comment"));
3743
+ const r = pe({}), s = (i) => {
3744
+ const l = i.current.querySelectorAll(".scroll-to"), m = Array.from(l).map((g) => g.closest("li.comment"));
3734
3745
  return (m[m.length - 1]?.offsetTop || 0) - 8 || 0;
3735
3746
  };
3736
- G(() => {
3737
- const i = bn(e, o);
3747
+ W(() => {
3748
+ const i = wn(e, o);
3738
3749
  !t.current || n || a || (t.current.scrollTop = r.current[i] || s(t));
3739
- }, [e, o, t.current, a]), G(() => {
3750
+ }, [e, o, t.current, a]), W(() => {
3740
3751
  let i = null;
3741
3752
  if (!t.current || n) return;
3742
- const c = (m) => {
3753
+ const l = (m) => {
3743
3754
  if (i)
3744
3755
  return;
3745
3756
  i = setTimeout(() => {
3746
3757
  i = null;
3747
3758
  }, 300);
3748
- const { scrollTop: p } = m.target, g = bn(e, o);
3759
+ const { scrollTop: p } = m.target, g = wn(e, o);
3749
3760
  r.current[g] = p;
3750
3761
  };
3751
- return t.current?.addEventListener("scroll", c), () => {
3752
- t.current?.removeEventListener("scroll", c);
3762
+ return t.current?.addEventListener("scroll", l), () => {
3763
+ t.current?.removeEventListener("scroll", l);
3753
3764
  };
3754
3765
  }, [t.current, o, e, n]);
3755
- }, xs = ({ feedRef: e, isInputOpen: t, height: o }) => {
3756
- G(() => {
3766
+ }, As = ({ feedRef: e, isInputOpen: t, height: o }) => {
3767
+ W(() => {
3757
3768
  if (!e.current) return;
3758
3769
  const n = o;
3759
3770
  e.current.scrollTop === 0 || (t ? e.current.scrollBy(0, n) : e.current.scrollBy(0, -n));
3760
3771
  }, [t, e, o]);
3761
- }, ks = (e = 50, t = 200) => Math.floor(Math.random() * (t - e + 1) + e), As = (e) => new Array(e).fill(0).map((t, o) => /* @__PURE__ */ l(
3762
- us,
3772
+ }, Fs = (e = 50, t = 200) => Math.floor(Math.random() * (t - e + 1) + e), Cs = (e) => new Array(e).fill(0).map((t, o) => /* @__PURE__ */ c(
3773
+ ps,
3763
3774
  {
3764
3775
  className: "loading",
3765
- style: { minHeight: ks(50, 150) }
3776
+ style: { minHeight: Fs(50, 150) }
3766
3777
  },
3767
3778
  o
3768
- )), Fs = ({
3779
+ )), Ts = ({
3769
3780
  feedRef: e,
3770
3781
  highlighted: t = [],
3771
3782
  isLoading: o,
@@ -3773,26 +3784,26 @@ const ls = F.ul`
3773
3784
  hasNextPage: a,
3774
3785
  activities: r
3775
3786
  }) => {
3776
- const s = ge([]), i = async (m, p = 0) => {
3787
+ const s = pe([]), i = async (m, p = 0) => {
3777
3788
  if (!n) return null;
3778
3789
  const g = m.querySelector("li.isHighlighted");
3779
3790
  if (g) return g;
3780
3791
  if (p++, p > 10) return null;
3781
3792
  const u = await n();
3782
- return !u || !u.hasNextPage ? null : (await new Promise((v) => requestAnimationFrame(() => v())), i(m, p));
3783
- }, c = async (m) => {
3793
+ return !u || !u.hasNextPage ? null : (await new Promise((b) => requestAnimationFrame(() => b())), i(m, p));
3794
+ }, l = async (m) => {
3784
3795
  const p = await i(m);
3785
3796
  if (!p) {
3786
3797
  console.error("No highlighted element found");
3787
3798
  return;
3788
3799
  }
3789
- const g = p.offsetTop, u = p.offsetHeight, h = m.offsetHeight || 0, v = 64, D = u + v > h ? g - 16 : g + u - h + v;
3800
+ const g = p.offsetTop, u = p.offsetHeight, h = m.offsetHeight || 0, b = 64, D = u + b > h ? g - 16 : g + u - h + b;
3790
3801
  console.log("FOUND: scrolling to highlighted..."), m.scrollTo({ top: D }), s.current = t;
3791
3802
  };
3792
- G(() => {
3793
- !t.length || !e.current || o || !n || t.every((m) => s.current?.includes(m)) || (console.log("trying to scroll to highlighted..."), c(e.current));
3803
+ W(() => {
3804
+ !t.length || !e.current || o || !n || t.every((m) => s.current?.includes(m)) || (console.log("trying to scroll to highlighted..."), l(e.current));
3794
3805
  }, [e, t, r, o, n, s, a]);
3795
- }, Cs = (e) => e.map((t) => {
3806
+ }, Ds = (e) => e.map((t) => {
3796
3807
  if (t.activityType !== "comment" || !t.activityData?.annotations) return t;
3797
3808
  const o = t.files.map((a) => {
3798
3809
  const r = t.activityData.annotations.find(
@@ -3801,79 +3812,79 @@ const ls = F.ul`
3801
3812
  return r ? r.transparent === a.id ? null : { ...a, annotation: r } : a;
3802
3813
  }).filter(Boolean);
3803
3814
  return { ...t, files: o };
3804
- }), Kn = [
3815
+ }), eo = [
3805
3816
  "comments",
3806
3817
  "versions",
3807
3818
  "updates",
3808
3819
  "checklists",
3809
3820
  "has_attachments",
3810
3821
  "in_review_session"
3811
- ], Ts = (e) => !!e && "key" in e, Ds = (e, t) => {
3822
+ ], Ns = (e) => !!e && "key" in e, Is = (e, t) => {
3812
3823
  const o = [], n = [], a = (r) => {
3813
3824
  if (!r) return;
3814
- if (Ts(r)) {
3825
+ if (Ns(r)) {
3815
3826
  const i = r.key;
3816
3827
  if (i === "body") {
3817
3828
  const p = String(r.value ?? "");
3818
3829
  p && n.push({ id: p, label: p });
3819
3830
  return;
3820
3831
  }
3821
- const c = t.find((p) => p.id === i);
3822
- if (!c) return;
3823
- if (Kn.includes(i)) {
3832
+ const l = t.find((p) => p.id === i);
3833
+ if (!l) return;
3834
+ if (eo.includes(i)) {
3824
3835
  r.value === !0 && o.push({
3825
- id: tn(i),
3826
- label: c.label,
3827
- icon: c.icon,
3836
+ id: on(i),
3837
+ label: l.label,
3838
+ icon: l.icon,
3828
3839
  type: "boolean",
3829
3840
  singleSelect: !0,
3830
3841
  // value label = filter name so the compact chip (label hidden) reads
3831
3842
  // e.g. "Checklists" instead of "Yes"
3832
- values: [{ id: "true", label: c.label }]
3843
+ values: [{ id: "true", label: l.label }]
3833
3844
  });
3834
3845
  return;
3835
3846
  }
3836
3847
  const m = Array.isArray(r.value) ? r.value : [r.value];
3837
3848
  o.push({
3838
- id: tn(i),
3839
- label: c.label,
3840
- type: c.type,
3841
- icon: c.icon,
3842
- singleSelect: c.singleSelect,
3849
+ id: on(i),
3850
+ label: l.label,
3851
+ type: l.type,
3852
+ icon: l.icon,
3853
+ singleSelect: l.singleSelect,
3843
3854
  operator: "OR",
3844
3855
  values: m.map((p) => {
3845
- const g = c.values?.find((u) => u.id === String(p));
3856
+ const g = l.values?.find((u) => u.id === String(p));
3846
3857
  return g ? { ...g } : { id: String(p), label: String(p) };
3847
3858
  })
3848
3859
  });
3849
3860
  return;
3850
3861
  }
3851
- const s = Ka(r, t);
3862
+ const s = nr(r, t);
3852
3863
  if (s) {
3853
3864
  o.push(s);
3854
3865
  return;
3855
3866
  }
3856
3867
  r.conditions?.forEach(a);
3857
3868
  };
3858
- return e?.conditions?.forEach(a), n.length && o.push({ id: Dn, label: "", values: n }), o;
3859
- }, Ns = (e) => {
3869
+ return e?.conditions?.forEach(a), n.length && o.push({ id: Nn, label: "", values: n }), o;
3870
+ }, Ss = (e) => {
3860
3871
  const t = [], o = [];
3861
3872
  return e.forEach((n) => {
3862
- const a = Eo(n.id), r = (n.values || []).map((s) => s.id);
3873
+ const a = _o(n.id), r = (n.values || []).map((s) => s.id);
3863
3874
  if (r.length)
3864
- if (a === Dn)
3875
+ if (a === Nn)
3865
3876
  r.forEach(
3866
3877
  (s) => o.push({ key: "body", operator: "like", value: String(s) })
3867
3878
  );
3868
- else if (Kn.includes(a))
3879
+ else if (eo.includes(a))
3869
3880
  r.includes("true") && t.push({ key: a, operator: "eq", value: !0 });
3870
3881
  else if (n.type === "datetime") {
3871
- const s = Xa(a, n);
3882
+ const s = or(a, n);
3872
3883
  s && t.push(s);
3873
3884
  } else
3874
3885
  t.push({ key: a, operator: "in", value: r.map(String) });
3875
3886
  }), o.length === 1 ? t.push(o[0]) : o.length > 1 && t.push({ operator: "or", conditions: o }), { operator: "and", conditions: t };
3876
- }, Ss = F.div`
3887
+ }, Es = F.div`
3877
3888
  padding: 4px 8px;
3878
3889
  padding-bottom: 0;
3879
3890
  filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.25));
@@ -3888,7 +3899,7 @@ const ls = F.ul`
3888
3899
  opacity: 0.5;
3889
3900
  pointer-events: none;
3890
3901
  }
3891
- `, Xn = ft(
3902
+ `, to = ft(
3892
3903
  ({
3893
3904
  feedFilter: e,
3894
3905
  setFeedFilter: t,
@@ -3899,11 +3910,11 @@ const ls = F.ul`
3899
3910
  checklistCount: s,
3900
3911
  onSearchTextChange: i
3901
3912
  }) => {
3902
- const c = S(() => {
3903
- const f = (T, I, _) => ({
3904
- id: T,
3905
- label: I,
3906
- icon: _,
3913
+ const l = I(() => {
3914
+ const f = (A, S, P) => ({
3915
+ id: A,
3916
+ label: S,
3917
+ icon: P,
3907
3918
  type: "boolean",
3908
3919
  singleSelect: !0,
3909
3920
  values: []
@@ -3924,11 +3935,11 @@ const ls = F.ul`
3924
3935
  operator: "OR",
3925
3936
  values: [
3926
3937
  { id: "__none__", label: "No category", icon: "crop_square" },
3927
- ...n.map((T) => ({
3928
- id: T.name,
3929
- label: T.name,
3938
+ ...n.map((A) => ({
3939
+ id: A.name,
3940
+ label: A.name,
3930
3941
  icon: "crop_square",
3931
- color: T.color
3942
+ color: A.color
3932
3943
  }))
3933
3944
  ]
3934
3945
  }
@@ -3939,10 +3950,10 @@ const ls = F.ul`
3939
3950
  icon: "person",
3940
3951
  type: "list_of_strings",
3941
3952
  operator: "OR",
3942
- values: o.map((T) => ({
3943
- id: T.name,
3944
- label: T.attrib?.fullName || T.name,
3945
- img: `/api/users/${T.name}/avatar`
3953
+ values: o.map((A) => ({
3954
+ id: A.name,
3955
+ label: A.attrib?.fullName || A.name,
3956
+ img: `/api/users/${A.name}/avatar`
3946
3957
  }))
3947
3958
  },
3948
3959
  {
@@ -3950,85 +3961,85 @@ const ls = F.ul`
3950
3961
  label: "Posted date",
3951
3962
  icon: "calendar_today",
3952
3963
  type: "datetime",
3953
- values: pa()
3964
+ values: ya()
3954
3965
  }
3955
3966
  ];
3956
3967
  }, [o, n, a]);
3957
3968
  let m = "";
3958
3969
  s?.total && s.total > 0 && (m = `${s.checked}/${s.total}`);
3959
- const p = S(
3970
+ const p = I(
3960
3971
  () => ["comments", { id: "checklists", label: m, tooltip: "Checklists" }],
3961
3972
  [m]
3962
- ), g = S(
3963
- () => Ds(e, c),
3964
- [e, c]
3965
- ), [u, h] = L(g), v = nr(), y = ge(null);
3966
- G(() => {
3973
+ ), g = I(
3974
+ () => Is(e, l),
3975
+ [e, l]
3976
+ ), [u, h] = L(g), b = sr(), y = pe(null);
3977
+ W(() => {
3967
3978
  h(g);
3968
- }, [JSON.stringify(g)]), G(() => {
3969
- const f = (b) => {
3970
- const T = y.current?.getContainerElement();
3971
- T && !T.contains(b.target) && y.current?.close();
3979
+ }, [JSON.stringify(g)]), W(() => {
3980
+ const f = (w) => {
3981
+ const A = y.current?.getContainerElement();
3982
+ A && !A.contains(w.target) && y.current?.close();
3972
3983
  };
3973
3984
  return document.addEventListener("mousedown", f), () => {
3974
3985
  document.removeEventListener("mousedown", f);
3975
3986
  };
3976
3987
  }, [y]);
3977
3988
  const D = (f) => {
3978
- t(Ns(f)), i?.("");
3989
+ t(Ss(f)), i?.("");
3979
3990
  };
3980
- return /* @__PURE__ */ k(Ss, { className: r ? "loading" : void 0, children: [
3981
- /* @__PURE__ */ l(
3982
- Mo,
3991
+ return /* @__PURE__ */ x(Es, { className: r ? "loading" : void 0, children: [
3992
+ /* @__PURE__ */ c(
3993
+ Ro,
3983
3994
  {
3984
3995
  ref: y,
3985
3996
  compact: !0,
3986
- options: c,
3997
+ options: l,
3987
3998
  filters: u,
3988
3999
  onChange: (f) => {
3989
- v.wrapFilterChange(f, u, h);
4000
+ b.wrapFilterChange(f, u, h);
3990
4001
  },
3991
4002
  onFinish: D,
3992
4003
  enableGlobalSearch: !0,
3993
4004
  enableMultipleSameFilters: !1,
3994
4005
  enableAutosuggestion: !1,
3995
- onSearchChange: (f, b) => {
3996
- b || i?.(f);
4006
+ onSearchChange: (f, w) => {
4007
+ w || i?.(f);
3997
4008
  },
3998
4009
  quickActions: p,
3999
4010
  placeholder: "Search and filter feed...",
4000
4011
  pt: {
4001
4012
  searchBar: {
4002
- onClickCapture: (f) => v.handleSearchBarClickCapture(f, u)
4013
+ onClickCapture: (f) => b.handleSearchBarClickCapture(f, u)
4003
4014
  },
4004
4015
  dropdown: {
4005
4016
  pt: {
4006
4017
  item: {
4007
- onClick: (f) => v.handleDropdownItemClick(f, u, c)
4018
+ onClick: (f) => b.handleDropdownItemClick(f, u, l)
4008
4019
  }
4009
4020
  }
4010
4021
  }
4011
4022
  }
4012
4023
  }
4013
4024
  ),
4014
- /* @__PURE__ */ l(
4015
- La,
4025
+ /* @__PURE__ */ c(
4026
+ Ua,
4016
4027
  {
4017
- isOpen: !!v.customRangeFilterId,
4018
- header: c.find((f) => f.id === v.customRangeFilterId?.split("__")[0])?.label ?? "Custom range",
4019
- startDate: v.customStartDate,
4020
- endDate: v.customEndDate,
4021
- onStartDateChange: v.setCustomStartDate,
4022
- onEndDateChange: v.setCustomEndDate,
4023
- onApply: () => v.handleCustomRangeApply(u, c, D, y),
4024
- onClose: v.handleCustomRangeClose
4028
+ isOpen: !!b.customRangeFilterId,
4029
+ header: l.find((f) => f.id === b.customRangeFilterId?.split("__")[0])?.label ?? "Custom range",
4030
+ startDate: b.customStartDate,
4031
+ endDate: b.customEndDate,
4032
+ onStartDateChange: b.setCustomStartDate,
4033
+ onEndDateChange: b.setCustomEndDate,
4034
+ onApply: () => b.handleCustomRangeApply(u, l, D, y),
4035
+ onClose: b.handleCustomRangeClose
4025
4036
  }
4026
4037
  )
4027
4038
  ] });
4028
4039
  }
4029
4040
  );
4030
- Xn.displayName = "FeedSearchFilter";
4031
- function Is({
4041
+ to.displayName = "FeedSearchFilter";
4042
+ function Ms({
4032
4043
  projectName: e,
4033
4044
  enabled: t,
4034
4045
  entityIds: o,
@@ -4036,10 +4047,10 @@ function Is({
4036
4047
  loadingActivities: a,
4037
4048
  userName: r
4038
4049
  }) {
4039
- const s = S(
4050
+ const s = I(
4040
4051
  () => n.find((p) => p.activityType === "version.review" && p.authorName === r),
4041
4052
  [n, r]
4042
- ), i = !!(o.length === 0 || !t || a || s), { data: c } = Na(
4053
+ ), i = !!(o.length === 0 || !t || a || s), { data: l } = Pa(
4043
4054
  {
4044
4055
  projectName: e,
4045
4056
  entityIds: o,
@@ -4049,27 +4060,27 @@ function Is({
4049
4060
  },
4050
4061
  { skip: i }
4051
4062
  );
4052
- return S(() => s ?? c?.activities.at(-1), [s, c]);
4063
+ return I(() => s ?? l?.activities.at(-1), [s, l]);
4053
4064
  }
4054
- const Es = (e) => !!e.activityData?.annotations?.length || !!yt(e), Ms = ({ projectName: e, entityType: t, entities: o, activities: n }) => {
4055
- const a = S(
4065
+ const Ps = (e) => !!e.activityData?.annotations?.length || !!yt(e), _s = ({ projectName: e, entityType: t, entities: o, activities: n }) => {
4066
+ const a = I(
4056
4067
  () => t === "version" ? Object.fromEntries(
4057
4068
  o.filter((i) => i.attrib).map((i) => [i.id, i.attrib?.frameStart ?? null])
4058
4069
  ) : {},
4059
4070
  [t, o]
4060
- ), r = S(() => {
4071
+ ), r = I(() => {
4061
4072
  const i = /* @__PURE__ */ new Set();
4062
- for (const c of n) {
4063
- const m = c.origin;
4064
- c.activityType !== "comment" || m?.type !== "version" || m.id in a || !Es(c) || i.add(m.id);
4073
+ for (const l of n) {
4074
+ const m = l.origin;
4075
+ l.activityType !== "comment" || m?.type !== "version" || m.id in a || !Ps(l) || i.add(m.id);
4065
4076
  }
4066
4077
  return [...i].sort();
4067
- }, [n, a]), { data: s } = Sa(
4078
+ }, [n, a]), { data: s } = _a(
4068
4079
  { projectName: e, versionIds: r },
4069
4080
  { skip: !e || !r.length }
4070
4081
  );
4071
- return S(() => ({ ...s, ...a }), [s, a]);
4072
- }, Pc = 30, _c = ({
4082
+ return I(() => ({ ...s, ...a }), [s, a]);
4083
+ }, Rc = 30, Lc = ({
4073
4084
  disabled: e,
4074
4085
  readOnly: t,
4075
4086
  statuses: o = [],
@@ -4080,249 +4091,265 @@ const Es = (e) => !!e.activityData?.annotations?.length || !!yt(e), Ms = ({ proj
4080
4091
  }) => {
4081
4092
  const {
4082
4093
  projectName: i,
4083
- entities: c,
4094
+ entities: l,
4084
4095
  entityType: m,
4085
4096
  editingId: p,
4086
4097
  projectInfo: g,
4087
4098
  setEditingId: u,
4088
4099
  userName: h,
4089
- activitiesData: v,
4100
+ activitiesData: b,
4090
4101
  isLoadingNew: y,
4091
4102
  isLoadingNextPage: D,
4092
- loadNextPage: P,
4103
+ loadNextPage: M,
4093
4104
  hasNextPage: C,
4094
4105
  users: f,
4095
- categories: b,
4096
- checklistCount: T,
4097
- feedFilter: I,
4098
- setFeedFilter: _,
4099
- isGuest: R,
4106
+ categories: w,
4107
+ checklistCount: A,
4108
+ feedFilter: S,
4109
+ setFeedFilter: P,
4110
+ isGuest: _,
4100
4111
  searchText: E,
4101
4112
  setSearchText: N
4102
4113
  } = $e(), {
4103
- openSlideOut: Q,
4104
- highlightedActivities: Y,
4105
- setHighlightedActivities: H,
4106
- onOpenImage: J,
4107
- setFeedAnnotations: q,
4114
+ openSlideOut: G,
4115
+ highlightedActivities: X,
4116
+ setHighlightedActivities: Q,
4117
+ onOpenImage: Z,
4118
+ setFeedAnnotations: Y,
4108
4119
  setFeedFrameLinks: $,
4109
- user: te
4110
- } = ze(), oe = I.conditions?.some(
4111
- (w) => "key" in w && w.key === "versions" && w.value === !0
4112
- ), W = I.conditions?.some(
4113
- (w) => "key" in w && ["comments", "checklists", "versions", "updates"].includes(w.key) && w.value === !0
4114
- ), U = I.conditions?.some(
4115
- (w) => "key" in w && (w.key === "comments" || w.key === "checklists") && w.value === !0
4116
- ), de = m === "version" || m === "folder", { data: ae, isLoading: ne } = Ia({ projectName: i }, { skip: !i }), we = !te.data?.isManager && !te.data?.isAdmin && !ne && ae?.activities?.enabled && !ae?.activities?.activities?.includes("comment") || W && !U, xe = S(
4117
- () => Cs(v),
4118
- [v]
4120
+ user: oe
4121
+ } = Be(), ae = S.conditions?.some(
4122
+ (T) => "key" in T && T.key === "versions" && T.value === !0
4123
+ ), J = S.conditions?.some(
4124
+ (T) => "key" in T && ["comments", "checklists", "versions", "updates"].includes(T.key) && T.value === !0
4125
+ ), j = S.conditions?.some(
4126
+ (T) => "key" in T && (T.key === "comments" || T.key === "checklists") && T.value === !0
4127
+ ), de = m === "version" || m === "folder", H = m === "folder" && l.length === 1 ? l[0] : null, ee = f.find((T) => T.name === H?.createdBy), { data: Oe, isLoading: De } = Ra({ projectName: i }, { skip: !i }), be = !oe.data?.isManager && !oe.data?.isAdmin && !De && Oe?.activities?.enabled && !Oe?.activities?.activities?.includes("comment") || J && !j, ge = I(
4128
+ () => Ds(b),
4129
+ [b]
4119
4130
  );
4120
- G(() => {
4121
- xe.length || q([]);
4122
- const w = xe.map(
4123
- (M) => M.activityData?.annotations?.map((O) => ({
4124
- ...O,
4125
- activityId: M.activityId
4131
+ W(() => {
4132
+ ge.length || Y([]);
4133
+ const T = ge.map(
4134
+ (R) => R.activityData?.annotations?.map((U) => ({
4135
+ ...U,
4136
+ activityId: R.activityId
4126
4137
  }))
4127
4138
  ).filter(Boolean).flat();
4128
- q(w);
4129
- }, [xe]), G(() => {
4130
- const w = v.map((M) => {
4131
- const O = yt(M);
4132
- return O && { ...O, activityId: M.activityId };
4133
- }).filter((M) => !!M);
4134
- $(w);
4135
- }, [v]);
4136
- const ke = Ms({
4139
+ Y(T);
4140
+ }, [ge]), W(() => {
4141
+ const T = b.map((R) => {
4142
+ const U = yt(R);
4143
+ return U && { ...U, activityId: R.activityId };
4144
+ }).filter((R) => !!R);
4145
+ $(T);
4146
+ }, [b]);
4147
+ const Ge = _s({
4137
4148
  projectName: i,
4138
4149
  entityType: m,
4139
- entities: c,
4140
- activities: v
4141
- }), he = bs(
4150
+ entities: l,
4151
+ activities: b
4152
+ }), ue = xs(
4142
4153
  // @ts-ignore
4143
- xe,
4154
+ ge,
4144
4155
  f,
4145
4156
  g,
4146
4157
  m,
4147
4158
  h,
4148
- I
4149
- ), Me = S(() => {
4150
- if (!E) return he;
4151
- const w = E.toLowerCase();
4152
- return he.filter(
4153
- (M) => M.body?.toLowerCase().includes(w)
4159
+ S
4160
+ ), xe = I(() => {
4161
+ if (!E) return ue;
4162
+ const T = E.toLowerCase();
4163
+ return ue.filter(
4164
+ (R) => R.body?.toLowerCase().includes(T)
4154
4165
  );
4155
- }, [he, E]), K = ge(null);
4156
- xs({ feedRef: K, isInputOpen: p === it, height: 93 }), ws({
4157
- entities: c,
4158
- feedRef: K,
4159
- filter: I,
4160
- disabled: !!Y.length,
4166
+ }, [ue, E]), he = pe(null);
4167
+ As({ feedRef: he, isInputOpen: p === rt, height: 93 }), ks({
4168
+ entities: l,
4169
+ feedRef: he,
4170
+ filter: S,
4171
+ disabled: !!X.length,
4161
4172
  isLoading: y
4162
- }), Fs({
4163
- feedRef: K,
4164
- highlighted: Y,
4173
+ }), Ts({
4174
+ feedRef: he,
4175
+ highlighted: X,
4165
4176
  isLoading: y || D,
4166
- loadNextPage: P,
4167
- hasNextPage: !!P,
4168
- activities: v
4177
+ loadNextPage: M,
4178
+ hasNextPage: !!M,
4179
+ activities: b
4169
4180
  });
4170
4181
  const {
4171
- submitComment: Te,
4172
- updateComment: Oe,
4173
- deleteComment: Se,
4174
- submitReview: De,
4175
- isSaving: Ye
4176
- } = ms({
4182
+ submitComment: Ne,
4183
+ updateComment: Ie,
4184
+ deleteComment: Ze,
4185
+ submitReview: Re,
4186
+ isSaving: fe
4187
+ } = gs({
4177
4188
  projectName: i,
4178
4189
  entityType: m,
4179
- entities: c,
4180
- filter: I,
4190
+ entities: l,
4191
+ filter: S,
4181
4192
  entityListId: n
4182
- }), Ve = qe(
4183
- async (w, M = [], O = {}) => {
4184
- await Te(w, M, O), K.current && K.current.scrollTo({ top: 0 });
4193
+ }), He = Je(
4194
+ async (T, R = [], U = {}) => {
4195
+ await Ne(T, R, U), he.current && he.current.scrollTo({ top: 0 });
4185
4196
  },
4186
- [Te, K]
4187
- ), fe = qe(
4188
- async (w) => {
4189
- await De(w);
4197
+ [Ne, he]
4198
+ ), qe = Je(
4199
+ async (T) => {
4200
+ await Re(T);
4190
4201
  },
4191
- [De]
4192
- ), Be = (w, M) => {
4193
- const O = w?.target;
4194
- if (!O || !M) return console.log("no target or activity");
4195
- const X = O.checked, ue = X ? "[ ]" : "[x]", A = X ? "[x]" : "[ ]", { body: me } = M, ye = Array.from(
4196
- O.closest(".comment-body")?.querySelectorAll(".task-list-item") || []
4197
- ).findIndex((et) => et === O.closest("li"));
4198
- let Ie = ye;
4199
- (me.match(/\[.\]/g) || []).forEach((et, bt) => {
4200
- et !== ue && bt < ye && Ie--;
4202
+ [Re]
4203
+ ), re = (T, R) => {
4204
+ const U = T?.target;
4205
+ if (!U || !R) return console.log("no target or activity");
4206
+ const v = U.checked, K = v ? "[ ]" : "[x]", we = v ? "[x]" : "[ ]", { body: Ae } = R, Fe = Array.from(
4207
+ U.closest(".comment-body")?.querySelectorAll(".task-list-item") || []
4208
+ ).findIndex((_e) => _e === U.closest("li"));
4209
+ let Le = Fe;
4210
+ (Ae.match(/\[.\]/g) || []).forEach((_e, mt) => {
4211
+ _e !== K && mt < Fe && Le--;
4201
4212
  });
4202
- const Le = [];
4203
- let Ke = -1;
4204
- for (; (Ke = me.indexOf(ue, Ke + 1)) > -1; )
4205
- Le.push(Ke);
4206
- const Xe = Le[Ie];
4207
- if (Xe === void 0) return;
4208
- const mt = Xe + ue.length, Ze = me.slice(0, Xe) + A + me.slice(mt);
4209
- Ze && Oe(M, Ze, M.files);
4210
- }, Ge = (w) => {
4211
- const { entityId: M, entityType: O, activityId: X } = w;
4212
- if (!O || !["version", "task", "folder"].includes(O))
4213
+ const dt = [];
4214
+ let Qe = -1;
4215
+ for (; (Qe = Ae.indexOf(K, Qe + 1)) > -1; )
4216
+ dt.push(Qe);
4217
+ const Ye = dt[Le];
4218
+ if (Ye === void 0) return;
4219
+ const bt = Ye + K.length, ut = Ae.slice(0, Ye) + we + Ae.slice(bt);
4220
+ ut && Ie(R, ut, R.files);
4221
+ }, et = (T) => {
4222
+ const { entityId: R, entityType: U, activityId: v } = T;
4223
+ if (!U || !["version", "task", "folder"].includes(U))
4213
4224
  return console.log("Entity type not supported yet");
4214
- if (!M || !O || !i) return console.log("No entity id or type found");
4215
- Q({ entityId: M, entityType: O, projectName: i }), H([X]);
4216
- }, re = ({ index: w, activityId: M }) => {
4217
- const O = Object.values(Me).reverse().filter((X) => X.activityType == "comment").map((X) => ({
4218
- id: X.activityId,
4219
- files: X.files.filter((ue) => vt(ue.mime, ue.ext))
4220
- })).filter((X) => X.files.length > 0);
4221
- J?.({ files: O, activityId: M, index: w, projectName: i });
4222
- }, [Je, Pe] = L(null), He = !we && !t && !e, _e = qe(
4223
- (w) => {
4224
- Pe({ key: wn(), activity: w }), u(it);
4225
+ if (!R || !U || !i) return console.log("No entity id or type found");
4226
+ G({ entityId: R, entityType: U, projectName: i }), Q([v]);
4227
+ }, je = ({ index: T, activityId: R }) => {
4228
+ const U = Object.values(xe).reverse().filter((v) => v.activityType == "comment").map((v) => ({
4229
+ id: v.activityId,
4230
+ files: v.files.filter((K) => vt(K.mime, K.ext))
4231
+ })).filter((v) => v.files.length > 0);
4232
+ Z?.({ files: U, activityId: R, index: T, projectName: i });
4233
+ }, [We, Ee] = L(null), Ue = !be && !t && !e, ke = Je(
4234
+ (T) => {
4235
+ Ee({ key: xn(), activity: T }), u(rt);
4225
4236
  },
4226
4237
  [u]
4227
- ), je = S(() => As(10), []), Ae = Is({
4238
+ ), Me = I(() => Cs(10), []), q = Ms({
4228
4239
  projectName: i,
4229
4240
  enabled: r,
4230
- entityIds: c.map((w) => w.id),
4231
- activities: he,
4241
+ entityIds: l.map((T) => T.id),
4242
+ activities: ue,
4232
4243
  loadingActivities: y,
4233
4244
  userName: h
4234
4245
  });
4235
- return /* @__PURE__ */ l(Ce, { children: /* @__PURE__ */ k(cs, { className: "feed", children: [
4246
+ return /* @__PURE__ */ c(Te, { children: /* @__PURE__ */ x(ds, { className: "feed", children: [
4236
4247
  void 0,
4237
- /* @__PURE__ */ l(
4238
- Xn,
4248
+ /* @__PURE__ */ c(
4249
+ to,
4239
4250
  {
4240
- feedFilter: I,
4241
- setFeedFilter: _,
4251
+ feedFilter: S,
4252
+ setFeedFilter: P,
4242
4253
  users: f,
4243
- categories: b,
4254
+ categories: w,
4244
4255
  supportsReviewSession: de,
4245
4256
  isLoading: y,
4246
4257
  onSearchTextChange: N,
4247
- checklistCount: T
4258
+ checklistCount: A
4248
4259
  }
4249
4260
  ),
4250
- /* @__PURE__ */ k(ls, { ref: K, className: ee({ loading: y }, "no-shimmer"), children: [
4251
- y ? je : Me.map((w) => /* @__PURE__ */ l(
4252
- Jn,
4261
+ /* @__PURE__ */ x(us, { ref: he, className: ne({ loading: y }, "no-shimmer"), children: [
4262
+ y ? Me : xe.map((T) => /* @__PURE__ */ c(
4263
+ Zn,
4253
4264
  {
4254
- activity: w,
4255
- annotationFrameStart: ke[w.origin?.id],
4256
- onCheckChange: Be,
4257
- onDelete: Se,
4258
- onUpdate: async (M, O, X, ue) => await Oe(w, M, O, ue),
4259
- onDuplicate: He ? _e : void 0,
4265
+ activity: T,
4266
+ annotationFrameStart: Ge[T.origin?.id],
4267
+ onCheckChange: re,
4268
+ onDelete: Ze,
4269
+ onUpdate: async (R, U, v, K) => await Ie(T, R, U, K),
4270
+ onDuplicate: Ue ? ke : void 0,
4260
4271
  projectInfo: g,
4261
4272
  projectName: i,
4262
4273
  entityType: m,
4263
- onReferenceClick: Ge,
4264
- createdAts: c.map((M) => M.createdAt),
4265
- onFileExpand: re,
4266
- showOrigin: c.length > 1,
4267
- filter: I,
4274
+ onReferenceClick: et,
4275
+ createdAts: l.map((R) => R.createdAt),
4276
+ onFileExpand: je,
4277
+ showOrigin: l.length > 1,
4278
+ filter: S,
4268
4279
  editProps: {
4269
4280
  projectName: i,
4270
- entities: c,
4281
+ entities: l,
4271
4282
  entityType: m
4272
4283
  },
4273
- isHighlighted: Y.includes(w.activityId),
4284
+ isHighlighted: X.includes(T.activityId),
4274
4285
  readOnly: t,
4275
4286
  statuses: o,
4276
4287
  isSlideOut: a,
4277
- isGuest: R
4288
+ isGuest: _
4278
4289
  },
4279
- w.activityId
4290
+ T.activityId
4280
4291
  )),
4281
- Me.length === 0 && oe && !U && !y && /* @__PURE__ */ l(St, { message: "No versions published yet", icon: "layers" }),
4282
- C && P && /* @__PURE__ */ l(
4283
- Ja,
4292
+ xe.length === 0 && ae && !j && !y && /* @__PURE__ */ c(It, { message: "No versions published yet", icon: "layers" }),
4293
+ C && M && /* @__PURE__ */ c(
4294
+ tr,
4284
4295
  {
4285
- root: K.current,
4286
- onChange: (w) => w && P(),
4296
+ root: he.current,
4297
+ onChange: (T) => T && M(),
4287
4298
  rootMargin: "400px 0px 0px 0px",
4288
- children: /* @__PURE__ */ l(ds, { style: { height: 0 }, onClick: () => P(), children: D ? "Loading more..." : "Click to load more" })
4299
+ children: /* @__PURE__ */ c(ms, { style: { height: 0 }, onClick: () => M(), children: D ? "Loading more..." : "Click to load more" })
4289
4300
  }
4290
- )
4301
+ ),
4302
+ !y && !S.conditions?.length && !E && H?.createdAt && Ke(new Date(H.createdAt)) && /* @__PURE__ */ c(Jn, { children: /* @__PURE__ */ x(Kn, { style: { alignItems: "center" }, children: [
4303
+ /* @__PURE__ */ x(Rt, { children: [
4304
+ "Folder created at ",
4305
+ St(new Date(H.createdAt), "PPpp"),
4306
+ " by"
4307
+ ] }),
4308
+ H.createdBy && /* @__PURE__ */ c(
4309
+ va,
4310
+ {
4311
+ name: H.createdBy,
4312
+ fullName: ee?.attrib?.fullName || void 0,
4313
+ size: 20
4314
+ }
4315
+ ),
4316
+ /* @__PURE__ */ c(Rt, { children: ee?.attrib?.fullName || H.createdBy || "Unknown" })
4317
+ ] }) })
4291
4318
  ] }),
4292
- !we && /* @__PURE__ */ l(
4293
- Gn,
4319
+ !be && /* @__PURE__ */ c(
4320
+ Hn,
4294
4321
  {
4295
4322
  initValue: null,
4296
- onSubmit: Ve,
4297
- isOpen: p === it,
4323
+ onSubmit: He,
4324
+ isOpen: p === rt,
4298
4325
  onClose: () => u(null),
4299
- onOpen: () => u(it),
4326
+ onOpen: () => u(rt),
4300
4327
  disabled: e,
4301
- isLoading: y || !c.length || Ye,
4328
+ isLoading: y || !l.length || fe,
4302
4329
  versionReview: r,
4303
- lastOwnVersionReview: Ae,
4304
- onReview: fe,
4305
- duplicate: Je,
4306
- onDuplicateHandled: () => Pe(null),
4330
+ lastOwnVersionReview: q,
4331
+ onReview: qe,
4332
+ duplicate: We,
4333
+ onDuplicateHandled: () => Ee(null),
4307
4334
  saveDraft: s
4308
4335
  }
4309
4336
  )
4310
4337
  ] }) });
4311
4338
  };
4312
4339
  export {
4313
- Gr as A,
4314
- qr as C,
4315
- Ec as D,
4316
- it as F,
4317
- un as P,
4318
- Mc as S,
4319
- Ur as a,
4320
- st as b,
4321
- _c as c,
4322
- Ic as d,
4323
- xr as e,
4324
- Pc as f,
4340
+ Yr as A,
4341
+ Kr as C,
4342
+ Pc as D,
4343
+ rt as F,
4344
+ mn as P,
4345
+ _c as S,
4346
+ qr as a,
4347
+ it as b,
4348
+ Lc as c,
4349
+ Mc as d,
4350
+ Tr as e,
4351
+ Rc as f,
4325
4352
  vt as g,
4326
- Hr as i,
4327
- Jr as r
4353
+ Jr as i,
4354
+ ti as r
4328
4355
  };