@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,69 +1,102 @@
1
- import { jsxs as x, jsx as d } from "react/jsx-runtime";
2
- import J, { createContext as p, useContext as l, useState as b, useEffect as m, useRef as y, useCallback as L, useMemo as de, forwardRef as U } from "react";
3
- import { Button as $, Icon as q, theme as Y, Dialog as le, InputText as G } from "@ynput/ayon-react-components";
4
- import u from "styled-components";
5
- import k from "clsx";
6
- import { a as ue, K as W } from "./platform.es.js";
7
- import { debounce as z, isEqual as pe } from "lodash";
8
- import { confirmDialog as fe } from "primereact/confirmdialog";
9
- import { toast as H } from "react-toastify";
10
- import "uuid";
11
- import { bp as D, a as ge } from "./searchTerms.es.js";
1
+ import { jsxs as C, jsx as p } from "react/jsx-runtime";
2
+ import ne, { createContext as y, useContext as f, useState as I, useEffect as E, useRef as P, useCallback as V, useMemo as G, forwardRef as Z } from "react";
3
+ import { debounce as re, isEqual as Ee } from "lodash";
4
+ import { confirmDialog as Ie } from "primereact/confirmdialog";
5
+ import { toast as B } from "react-toastify";
6
+ import { v4 as Pe } from "uuid";
7
+ import { bv as D, a as Ve } from "./searchTerms.es.js";
8
+ import { f as ke } from "./realtimeUpdatesUtils.es.js";
12
9
  import "axios";
13
- import { cU as he } from "./getUris.es.js";
10
+ import { cV as Ae, aU as Te, dD as De, dG as se } from "./getUris.es.js";
11
+ import { useStore as Re } from "react-redux";
12
+ import { Button as q, Icon as K, theme as le, Dialog as $e, InputText as ue } from "@ynput/ayon-react-components";
13
+ import v from "styled-components";
14
+ import O from "clsx";
15
+ import { a as Ne, K as ae } from "./platform.es.js";
14
16
  import "@module-federation/enhanced/runtime";
15
17
  import "@ynput/ayon-addon/host";
16
18
  import "./ContextMenuContextInstance.es.js";
17
- import { createPortal as me } from "react-dom";
18
- import { Dialog as ve } from "primereact/dialog";
19
- import we, { ReadyState as xe } from "react-use-websocket";
20
- import "react-redux";
19
+ import { createPortal as _e } from "react-dom";
20
+ import { Dialog as je } from "primereact/dialog";
21
+ import Le, { ReadyState as Oe } from "react-use-websocket";
21
22
  import "react-router-dom";
22
23
  import "semver";
23
- const Se = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ */ x("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
24
+ const Me = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ */ C("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
24
25
  e,
25
- /* @__PURE__ */ d($, { onClick: () => window.location.reload(), variant: "filled", children: "Refresh" })
26
- ] }), be = p(void 0), Jt = () => l(be) || {}, ye = p({
26
+ /* @__PURE__ */ p(q, { onClick: () => window.location.reload(), variant: "filled", children: "Refresh" })
27
+ ] }), Ue = y(void 0), co = () => f(Ue) || {}, We = y({
27
28
  isLoading: !0,
28
29
  modules: [],
29
30
  remotesInitialized: !1,
30
31
  addonDev: { status: "off" }
31
- }), Wt = () => {
32
- const e = l(ye);
32
+ }), lo = () => {
33
+ const e = f(We);
33
34
  if (e === void 0)
34
35
  throw new Error("useRemoteModules must be used within a RemoteModulesProvider");
35
36
  return e;
36
- }, K = "addonDev", O = "ayon-addon-dev", Ce = ["localhost", "127.0.0.1", "[::1]"], X = (e) => {
37
+ }, J = "addonDev", M = "ayon-addon-dev", Fe = ["localhost", "127.0.0.1", "[::1]"], H = `use ?${J}=<addon>@http://localhost:<port>`, pe = (e) => {
37
38
  try {
38
39
  const { protocol: t, hostname: o } = new URL(e);
39
- return ["http:", "https:"].includes(t) && Ce.includes(o);
40
+ return ["http:", "https:"].includes(t) && Fe.includes(o);
40
41
  } catch {
41
42
  return !1;
42
43
  }
43
- }, Pe = (e) => {
44
+ }, Be = (e) => {
44
45
  const t = e.indexOf("@");
45
- if (t <= 0) return null;
46
- const o = e.slice(0, t), i = e.slice(t + 1).replace(/\/+$/, "");
47
- return X(i) ? { addon: o, url: i } : null;
48
- }, zt = () => {
49
- const e = new URLSearchParams(window.location.search).get(K);
46
+ if (t <= 0) return { request: e, reason: H };
47
+ const o = e.slice(0, t), r = e.slice(t + 1).replace(/\/+$/, "");
48
+ let n;
49
+ try {
50
+ n = new URL(r);
51
+ } catch {
52
+ return { request: e, reason: `"${r}" is not a URL: ${H}` };
53
+ }
54
+ return ["http:", "https:"].includes(n.protocol) ? pe(r) ? { override: { addon: o, url: r } } : {
55
+ request: e,
56
+ reason: `${n.hostname} is not this machine: only dev servers on localhost, 127.0.0.1 or [::1] can be loaded`
57
+ } : { request: e, reason: `the dev server URL must be http(s): ${H}` };
58
+ }, uo = () => {
59
+ const e = new URLSearchParams(window.location.search).get(J);
50
60
  if (e === "off" || e === "")
51
- return localStorage.removeItem(O), null;
61
+ return localStorage.removeItem(M), null;
52
62
  if (e) {
53
- const t = Pe(e);
54
- return t ? (localStorage.setItem(O, JSON.stringify(t)), t) : (console.warn(`[addon dev] ignored ?${K}=${e}: use <addon>@http://localhost:<port>`), null);
63
+ const t = Be(e);
64
+ return "override" in t ? localStorage.setItem(M, JSON.stringify(t.override)) : console.warn(`[addon dev] ignored ?${J}=${e}: ${t.reason}`), t;
55
65
  }
56
66
  try {
57
- const t = JSON.parse(localStorage.getItem(O) || "null");
58
- return t && X(t.url) ? t : null;
67
+ const t = JSON.parse(localStorage.getItem(M) || "null");
68
+ return t && pe(t.url) ? { override: t } : null;
59
69
  } catch {
60
70
  return null;
61
71
  }
62
- }, Ee = () => localStorage.removeItem(O), Ie = async ({ url: e }) => {
63
- const t = await fetch(`${e}/ayon-addon.json`, { cache: "no-store" });
64
- if (!t.ok) throw new Error(`${e}/ayon-addon.json answered ${t.status}`);
65
- return t.json();
66
- }, Ht = (e) => !!e?.attrib?.developerMode || !!e?.data?.isService, Ae = u.div`
72
+ }, Je = () => localStorage.removeItem(M), qe = (e, { addon: t, url: o }) => {
73
+ const r = e ?? {}, n = ["name", "version", "remote", "buildId"].filter(
74
+ (a) => typeof r[a] != "string" || !r[a]
75
+ );
76
+ return (!Array.isArray(r.modules) || r.modules.some((a) => typeof a != "string" || !a)) && n.push("modules"), typeof e != "object" || !e || n.length ? `${o}/ayon-addon.json is invalid (no ${n.join(", ")}): is it served by \`ayon-addon dev --ayon\`?` : r.name !== t ? `the dev server at ${o} serves "${r.name}", not "${t}": open ?${J}=${r.name}@${o}` : null;
77
+ }, He = async (e) => {
78
+ const { url: t } = e;
79
+ let o;
80
+ try {
81
+ o = await fetch(`${t}/ayon-addon.json`, { cache: "no-store" });
82
+ } catch {
83
+ throw new Error(`no answer from ${t}: is \`ayon-addon dev --ayon\` running on that port?`);
84
+ }
85
+ if (o.status === 404)
86
+ throw new Error(
87
+ `${t} has no /ayon-addon.json: run \`ayon-addon dev --ayon\` (not the dev shell) and wait for its first build`
88
+ );
89
+ if (!o.ok) throw new Error(`${t}/ayon-addon.json answered ${o.status}`);
90
+ let r;
91
+ try {
92
+ r = await o.json();
93
+ } catch {
94
+ throw new Error(`${t}/ayon-addon.json is not JSON: is it served by \`ayon-addon dev --ayon\`?`);
95
+ }
96
+ const n = qe(r, e);
97
+ if (n) throw new Error(n);
98
+ return r;
99
+ }, po = (e) => e?.attrib?.developerMode || e?.data?.isService ? null : e?.data?.isDeveloper ? "only users in developer mode can load addons from a dev server: turn on Developer Mode in the header, then reload" : "only users in developer mode can load addons from a dev server, and this user is not a developer: an admin can turn on Developer in Studio settings > Users", ie = v.div`
67
100
  position: fixed;
68
101
  left: 8px;
69
102
  bottom: 8px;
@@ -74,6 +107,7 @@ const Se = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ *
74
107
  padding: 4px 4px 4px 12px;
75
108
  border-radius: 8px;
76
109
  font-size: 13px;
110
+ max-width: calc(100vw - 16px);
77
111
  color: var(--md-sys-color-on-tertiary-container);
78
112
  background: var(--md-sys-color-tertiary-container);
79
113
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
@@ -82,72 +116,84 @@ const Se = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ *
82
116
  color: var(--md-sys-color-on-error-container);
83
117
  background: var(--md-sys-color-error-container);
84
118
  }
85
- `, De = 2e3, Kt = ({ state: e }) => {
86
- const [t, o] = b(!1), i = e.status === "active" ? e.info.buildId : void 0;
87
- m(() => {
88
- if (e.status !== "active") return;
89
- const s = setInterval(() => {
90
- Ie(e.override).then(
91
- (c) => {
92
- c.buildId !== i && (o(!0), window.location.reload());
119
+ `, ze = 2e3, go = ({ state: e }) => {
120
+ const [t, o] = I(!1), r = e.status === "active" ? e.info.buildId : void 0;
121
+ E(() => {
122
+ if (e.status !== "active" && e.status !== "error") return;
123
+ const d = setInterval(() => {
124
+ He(e.override).then(
125
+ (g) => {
126
+ g.buildId !== r && (o(!0), window.location.reload());
93
127
  },
94
128
  () => {
95
129
  }
96
- // the dev server restarting; keep polling
130
+ // the dev server restarting or still failing; keep polling
97
131
  );
98
- }, De);
99
- return () => clearInterval(s);
100
- }, [e, i]);
101
- const n = () => {
102
- Ee();
103
- const s = new URL(window.location.href);
104
- s.searchParams.delete("addonDev"), window.location.href = s.toString();
105
- }, { addon: a, url: r } = e.override;
106
- return /* @__PURE__ */ x(Ae, { className: e.status === "error" ? "error" : void 0, "data-addon-dev": a, children: [
107
- /* @__PURE__ */ d(q, { icon: e.status === "error" ? "error" : "code" }),
108
- e.status === "error" ? /* @__PURE__ */ x("span", { children: [
132
+ }, ze);
133
+ return () => clearInterval(d);
134
+ }, [e, r]);
135
+ const a = /* @__PURE__ */ p(q, { variant: "text", icon: "close", onClick: () => {
136
+ Je();
137
+ const d = new URL(window.location.href);
138
+ d.searchParams.delete("addonDev"), window.location.href = d.toString();
139
+ }, "data-tooltip": "Stop: load the installed addon" });
140
+ if (e.status === "rejected")
141
+ return /* @__PURE__ */ C(ie, { className: "error", "data-addon-dev-rejected": e.request, children: [
142
+ /* @__PURE__ */ p(K, { icon: "error" }),
143
+ /* @__PURE__ */ C("span", { children: [
144
+ "Addon dev: ignored ?addonDev=",
145
+ e.request,
146
+ ": ",
147
+ e.reason
148
+ ] }),
149
+ a
150
+ ] });
151
+ const { addon: i, url: s } = e.override, c = "error" in e ? e.error : void 0;
152
+ return /* @__PURE__ */ C(ie, { className: c ? "error" : void 0, "data-addon-dev": i, children: [
153
+ /* @__PURE__ */ p(K, { icon: c ? "error" : "code" }),
154
+ e.status === "error" ? /* @__PURE__ */ C("span", { children: [
109
155
  "Addon dev: ",
110
- a,
156
+ i,
111
157
  " could not load from ",
112
- r,
113
- " (",
114
- e.error,
115
- ")"
116
- ] }) : /* @__PURE__ */ x("span", { children: [
158
+ s,
159
+ ": ",
160
+ c
161
+ ] }) : /* @__PURE__ */ C("span", { children: [
117
162
  "Addon dev: ",
118
- /* @__PURE__ */ d("strong", { children: a }),
163
+ /* @__PURE__ */ p("strong", { children: i }),
119
164
  " from ",
120
- r,
165
+ s,
121
166
  e.status === "active" && ` (${e.info.version}, build ${e.info.buildId})`,
167
+ c && `: ${c}`,
122
168
  t && ", reloading..."
123
169
  ] }),
124
- /* @__PURE__ */ d($, { variant: "text", icon: "close", onClick: n, "data-tooltip": "Stop: load the installed addon" })
170
+ a
125
171
  ] });
126
- }, Te = p(void 0), qt = () => {
127
- const e = l(Te);
172
+ }, Ge = y(void 0), wo = () => {
173
+ const e = f(Ge);
128
174
  if (e === void 0)
129
175
  throw new Error("usePowerpack must be used within a PowerpackProvider");
130
176
  return e;
131
- }, Re = p(void 0), Yt = () => {
132
- const e = l(Re);
177
+ }, Ke = y(void 0), fo = () => {
178
+ const e = f(Ke);
133
179
  if (e === void 0)
134
180
  throw new Error("useURIContext must be used within a URIProvider");
135
181
  return e;
136
- }, _ = (e, t = null) => {
182
+ }, U = (e, t = null) => {
137
183
  if (!e) return t;
138
184
  try {
139
185
  return JSON.parse(e);
140
186
  } catch {
141
187
  return t;
142
188
  }
143
- }, Gt = (e, t) => {
189
+ }, ho = (e, t) => {
144
190
  if (typeof window > "u") return t;
145
191
  try {
146
- return _(sessionStorage.getItem(e), t);
192
+ return U(sessionStorage.getItem(e), t);
147
193
  } catch {
148
194
  return t;
149
195
  }
150
- }, Xt = (e, t) => {
196
+ }, vo = (e, t) => {
151
197
  if (!(typeof window > "u"))
152
198
  try {
153
199
  sessionStorage.setItem(e, JSON.stringify(t)), window.dispatchEvent(new CustomEvent("session-storage", { detail: { key: e } }));
@@ -155,29 +201,29 @@ const Se = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ *
155
201
  console.error(o);
156
202
  }
157
203
  };
158
- function ke(e, t) {
159
- const o = y(t);
204
+ function Ye(e, t) {
205
+ const o = P(t);
160
206
  o.current = t;
161
- const [i, n] = b(() => typeof window > "u" ? t : _(sessionStorage.getItem(e), t));
162
- m(() => {
163
- const r = sessionStorage.getItem(e);
164
- n(_(r, o.current)), r || sessionStorage.setItem(e, JSON.stringify(o.current));
207
+ const [r, n] = I(() => typeof window > "u" ? t : U(sessionStorage.getItem(e), t));
208
+ E(() => {
209
+ const i = sessionStorage.getItem(e);
210
+ n(U(i, o.current)), i || sessionStorage.setItem(e, JSON.stringify(o.current));
165
211
  function s(c) {
166
212
  if ("key" in c && c.key && c.key !== e) return;
167
- const f = c.detail?.key;
168
- if (f && f !== e) return;
213
+ const d = c.detail?.key;
214
+ if (d && d !== e) return;
169
215
  const g = sessionStorage.getItem(e);
170
- n(_(g, o.current));
216
+ n(U(g, o.current));
171
217
  }
172
218
  return window.addEventListener("session-storage", s), window.addEventListener("storage", s), () => {
173
219
  window.removeEventListener("session-storage", s), window.removeEventListener("storage", s);
174
220
  };
175
221
  }, [e]);
176
- const a = L(
177
- (r) => {
222
+ const a = V(
223
+ (i) => {
178
224
  try {
179
225
  n((s) => {
180
- const c = typeof r == "function" ? r(s) : r;
226
+ const c = typeof i == "function" ? i(s) : i;
181
227
  return sessionStorage.setItem(e, JSON.stringify(c)), typeof window < "u" && window.dispatchEvent(new CustomEvent("session-storage", { detail: { key: e } })), c;
182
228
  });
183
229
  } catch (s) {
@@ -186,23 +232,23 @@ function ke(e, t) {
186
232
  },
187
233
  [e]
188
234
  );
189
- return [i, a];
235
+ return [r, a];
190
236
  }
191
- const N = (e, t = null) => {
237
+ const W = (e, t = null) => {
192
238
  if (!e) return t;
193
239
  try {
194
240
  return JSON.parse(e);
195
241
  } catch {
196
242
  return t;
197
243
  }
198
- }, Oe = (e, t) => {
244
+ }, Xe = (e, t) => {
199
245
  if (typeof window > "u") return t;
200
246
  try {
201
- return N(localStorage.getItem(e), t);
247
+ return W(localStorage.getItem(e), t);
202
248
  } catch {
203
249
  return t;
204
250
  }
205
- }, _e = (e, t) => {
251
+ }, Ze = (e, t) => {
206
252
  if (!(typeof window > "u"))
207
253
  try {
208
254
  localStorage.setItem(e, JSON.stringify(t)), window.dispatchEvent(new Event("storage"));
@@ -210,30 +256,30 @@ const N = (e, t = null) => {
210
256
  console.error(o);
211
257
  }
212
258
  };
213
- function Zt(e, t) {
214
- const o = y(t);
259
+ function mo(e, t) {
260
+ const o = P(t);
215
261
  o.current = t;
216
- const [i, n] = b(() => {
217
- const r = localStorage.getItem(e);
218
- return N(r, t);
262
+ const [r, n] = I(() => {
263
+ const i = localStorage.getItem(e);
264
+ return W(i, t);
219
265
  });
220
- m(() => {
221
- const r = localStorage.getItem(e);
222
- n(N(r, o.current)), r || localStorage.setItem(e, JSON.stringify(o.current));
266
+ E(() => {
267
+ const i = localStorage.getItem(e);
268
+ n(W(i, o.current)), i || localStorage.setItem(e, JSON.stringify(o.current));
223
269
  function s(c) {
224
270
  if (c.key && c.key !== e) return;
225
- const f = localStorage.getItem(e);
226
- n(N(f, o.current));
271
+ const d = localStorage.getItem(e);
272
+ n(W(d, o.current));
227
273
  }
228
274
  return window.addEventListener("storage", s), () => {
229
275
  window.removeEventListener("storage", s);
230
276
  };
231
277
  }, [e]);
232
- const a = L(
233
- (r) => {
278
+ const a = V(
279
+ (i) => {
234
280
  try {
235
281
  n((s) => {
236
- const c = typeof r == "function" ? r(s) : r;
282
+ const c = typeof i == "function" ? i(s) : i;
237
283
  return localStorage.setItem(e, JSON.stringify(c)), typeof window < "u" && setTimeout(() => {
238
284
  window.dispatchEvent(new Event("storage"));
239
285
  }, 0), c;
@@ -244,63 +290,63 @@ function Zt(e, t) {
244
290
  },
245
291
  [e]
246
292
  );
247
- return [i, a];
293
+ return [r, a];
248
294
  }
249
- const Ne = p(void 0), Le = ["feed", "subtasks", "details", "files"], $e = /^[^.\s]+\.[A-Za-z][A-Za-z0-9_]*$/, je = (e) => typeof e == "string" && $e.test(e), Me = (e) => typeof e == "string" && (Le.includes(e) || je(e)), Qt = (e) => {
250
- const { startFrame: t, endFrame: o } = e.activityData || {}, i = e.origin?.id ?? e.entityId;
251
- if (!Number.isSafeInteger(t) || !i) return null;
295
+ const Qe = y(void 0), et = ["feed", "subtasks", "details", "files"], tt = /^[^.\s]+\.[A-Za-z][A-Za-z0-9_]*$/, ot = (e) => typeof e == "string" && tt.test(e), nt = (e) => typeof e == "string" && (et.includes(e) || ot(e)), yo = (e) => {
296
+ const { startFrame: t, endFrame: o } = e.activityData || {}, r = e.origin?.id ?? e.entityId;
297
+ if (!Number.isSafeInteger(t) || !r) return null;
252
298
  const n = t, a = Number.isSafeInteger(o) ? Math.max(n, o) : n;
253
- return { entityId: i, startFrame: n, endFrame: a };
254
- }, Ue = () => {
255
- const e = l(Ne);
299
+ return { entityId: r, startFrame: n, endFrame: a };
300
+ }, rt = () => {
301
+ const e = f(Qe);
256
302
  if (e === void 0)
257
303
  throw new Error("useDetailsPanel must be used within a DetailsPanelProvider");
258
304
  return e;
259
- }, M = "details/tabs-by-scope", eo = (e, t) => {
260
- const o = Oe(M, {});
261
- _e(M, { ...o, [e]: t });
262
- }, to = (e) => {
263
- const { getOpenForScope: t, setPanelOpen: o, getTabForScope: i } = Ue(), [n, a] = ke(M, {}), r = n[e], s = Me(r) ? r : i(e), c = L(
305
+ }, Y = "details/tabs-by-scope", xo = (e, t) => {
306
+ const o = Xe(Y, {});
307
+ Ze(Y, { ...o, [e]: t });
308
+ }, So = (e) => {
309
+ const { getOpenForScope: t, setPanelOpen: o, getTabForScope: r } = rt(), [n, a] = Ye(Y, {}), i = n[e], s = nt(i) ? i : r(e), c = V(
264
310
  (g) => {
265
- a((C) => ({ ...C, [e]: g }));
311
+ a((w) => ({ ...w, [e]: g }));
266
312
  },
267
313
  [e, a]
268
- ), f = s === "feed";
314
+ ), d = s === "feed";
269
315
  return {
270
316
  isOpen: t(e),
271
317
  setOpen: (g) => o(e, g),
272
318
  currentTab: s,
273
319
  setTab: c,
274
- isFeed: f
320
+ isFeed: d
275
321
  };
276
- }, Fe = p(
322
+ }, st = y(
277
323
  void 0
278
- ), oo = () => {
279
- const e = l(Fe);
324
+ ), bo = () => {
325
+ const e = f(st);
280
326
  if (!e)
281
327
  throw new Error("useSubtasksModulesContext must be used within a SubtasksModulesProvider");
282
328
  return e;
283
- }, Ve = p({}), no = () => {
284
- const e = l(Ve);
329
+ }, at = y({}), Co = () => {
330
+ const e = f(at);
285
331
  if (!e)
286
332
  throw new Error("useThumbnailUploadContext must be used within a ThumbnailUploadProvider");
287
333
  return e;
288
- }, Be = p(void 0), ro = () => {
289
- const e = l(Be);
334
+ }, it = y(void 0), Eo = () => {
335
+ const e = f(it);
290
336
  if (e === void 0)
291
337
  throw new Error("useSettingsPanel must be used within a SettingsPanelProvider");
292
338
  return e;
293
- }, Je = p(void 0);
294
- function We() {
295
- const e = l(Je);
339
+ }, ct = y(void 0);
340
+ function dt() {
341
+ const e = f(ct);
296
342
  if (e === void 0)
297
343
  throw new Error("usePiPWindow must be used within a PiPContext");
298
344
  return e;
299
345
  }
300
- function ze({ pipWindow: e, children: t }) {
301
- return me(t, e.document.body);
346
+ function lt({ pipWindow: e, children: t }) {
347
+ return _e(t, e.document.body);
302
348
  }
303
- const He = u(ve)`
349
+ const ut = v(je)`
304
350
  width: 25vw;
305
351
  height: 70vh;
306
352
  border: solid 1px var(--md-sys-color-outline-variant);
@@ -313,7 +359,7 @@ const He = u(ve)`
313
359
  opacity: 1;
314
360
  }
315
361
  }
316
- `, Ke = u($)`
362
+ `, pt = v(q)`
317
363
  width: 26px;
318
364
  height: 26px;
319
365
  margin-left: auto;
@@ -329,12 +375,12 @@ const He = u(ve)`
329
375
  &:hover {
330
376
  background-color: #3d3e40;
331
377
  }
332
- `, so = ({ children: e }) => {
333
- const { pipWindow: t, pipId: o, isSupported: i, closePipWindow: n } = We(), a = o && J.isValidElement(e) ? J.cloneElement(e, { id: o }) : e;
334
- return !i && o ? /* @__PURE__ */ d(
335
- He,
378
+ `, Io = ({ children: e }) => {
379
+ const { pipWindow: t, pipId: o, isSupported: r, closePipWindow: n } = dt(), a = o && ne.isValidElement(e) ? ne.cloneElement(e, { id: o }) : e;
380
+ return !r && o ? /* @__PURE__ */ p(
381
+ ut,
336
382
  {
337
- header: /* @__PURE__ */ d(Ke, { icon: "close", className: "close", onClick: n }),
383
+ header: /* @__PURE__ */ p(pt, { icon: "close", className: "close", onClick: n }),
338
384
  headerStyle: {
339
385
  padding: 4,
340
386
  backgroundColor: "#202124",
@@ -357,132 +403,133 @@ const He = u(ve)`
357
403
  position: "right",
358
404
  children: a
359
405
  }
360
- ) : t && /* @__PURE__ */ d(ze, { pipWindow: t, children: /* @__PURE__ */ d("div", { className: "pipRoot", children: a }) });
361
- }, qe = p(void 0), ao = () => {
362
- const e = l(qe);
406
+ ) : t && /* @__PURE__ */ p(lt, { pipWindow: t, children: /* @__PURE__ */ p("div", { className: "pipRoot", children: a }) });
407
+ }, gt = y(void 0), Po = () => {
408
+ const e = f(gt);
363
409
  if (!e)
364
410
  throw new Error("useAddonProjectContext must be used within a AddonProjectContext");
365
411
  return e;
366
- }, Ye = p(void 0), io = () => {
367
- const e = l(Ye);
412
+ }, wt = y(void 0), Vo = () => {
413
+ const e = f(wt);
368
414
  if (!e)
369
415
  throw new Error("useAddonContext must be used within a AddonContext");
370
416
  return e;
371
- }, Ge = p(void 0), co = () => {
372
- const e = l(Ge);
417
+ }, ft = y(void 0), ko = () => {
418
+ const e = f(ft);
373
419
  if (e === void 0)
374
420
  throw new Error("useMenuContext must be used within a MenuProvider");
375
421
  return e;
376
- }, Z = p(void 0), lo = () => {
377
- const e = l(Z);
422
+ }, ge = y(void 0), Ao = () => {
423
+ const e = f(ge);
378
424
  if (e === void 0)
379
425
  throw new Error("useSocketContext must be used within a SocketProvider");
380
426
  return e;
381
- }, Xe = window.location.protocol.replace("http", "ws"), Ze = `${Xe}//${window.location.host}/ws`, uo = ({
427
+ }, ht = window.location.protocol.replace("http", "ws"), vt = `${ht}//${window.location.host}/ws`, To = ({
382
428
  children: e,
383
429
  userName: t,
384
430
  projectName: o,
385
- dispatch: i
431
+ dispatch: r
386
432
  }) => {
387
- const [n, a] = b(!1), [r, s] = b([]), [c] = he(), f = y(!1);
388
- m(() => {
389
- f.current = n;
433
+ const [n, a] = I(!1), [i, s] = I([]), [c] = Ae(), d = P(!1);
434
+ E(() => {
435
+ d.current = n;
390
436
  }, [n]);
391
437
  const g = {
392
438
  shouldReconnect: () => !t || !localStorage.getItem("accessToken") ? !1 : (c({ full: !1 }).unwrap(), !0)
393
- }, { sendMessage: C, readyState: P, getWebSocket: E } = we(
394
- Ze,
439
+ }, { sendMessage: w, readyState: m, getWebSocket: u } = Le(
440
+ vt,
395
441
  g,
396
442
  !!t
397
- ), v = () => {
398
- C(
443
+ ), l = () => {
444
+ w(
399
445
  JSON.stringify({
400
446
  topic: "auth",
401
447
  token: localStorage.getItem("accessToken"),
402
- subscribe: r,
448
+ subscribe: i,
403
449
  project: o
404
450
  })
405
451
  );
406
452
  };
407
- m(() => {
408
- console.debug("Topics changed", r), v();
409
- }, [r, o]);
410
- const T = y(r);
411
- T.current = r;
412
- const h = de(
413
- () => z((w) => {
414
- pe(T.current, w) || (console.log("WS: Subscriptions changed"), s(w));
453
+ E(() => {
454
+ console.debug("Topics changed", i), l();
455
+ }, [i, o]);
456
+ const x = P(i);
457
+ x.current = i;
458
+ const h = G(
459
+ () => re((b) => {
460
+ Ee(x.current, b) || (console.log("WS: Subscriptions changed"), s(b));
415
461
  }, 200),
416
462
  []
417
463
  );
418
- m(() => (D.setOnSubscriptionsChange((w) => h(w)), h(D.getSubscriptions("")), () => {
464
+ E(() => (D.setOnSubscriptionsChange((b) => h(b)), h(D.getSubscriptions("")), () => {
419
465
  D.setOnSubscriptionsChange(null), h.cancel();
420
466
  }), [h]);
421
- const [R, oe] = b(!1), [F, ne] = b(!1);
422
- m(() => {
423
- R && !F && (H.warning(/* @__PURE__ */ d(Se, {}), {
467
+ const [S, $] = I(!1), [R, j] = I(!1);
468
+ E(() => {
469
+ S && !R && (B.warning(/* @__PURE__ */ p(Me, {}), {
424
470
  autoClose: !1,
425
471
  closeButton: !1
426
- }), ne(!0));
427
- }, [R, F]);
428
- const I = y({ callCount: 0, lastCall: Date.now() }), re = z(() => {
429
- console.log("Resetting API state due to server restart"), a(!1), i(ge.util.resetApiState());
430
- }, 1e3), se = L(
431
- (w) => {
432
- if (I.current.callCount > 1e3)
433
- return oe(!0), console.log(
472
+ }), j(!0));
473
+ }, [S, R]);
474
+ const k = P({ callCount: 0, windowStart: Date.now() }), N = re(() => {
475
+ console.log("Resetting API state due to server restart"), a(!1), r(Ve.util.resetApiState());
476
+ }, 1e3), A = V(
477
+ (b) => {
478
+ const L = Date.now();
479
+ if (L - k.current.windowStart >= 1e3 && (k.current.windowStart = L, k.current.callCount = 0), k.current.callCount > 1e3)
480
+ return $(!0), console.log(
434
481
  "Overload: Over 1000 messages per second. Ignoring subsequent messages."
435
482
  );
436
- let A;
483
+ let _;
437
484
  try {
438
- A = JSON.parse(w.data);
439
- } catch (ce) {
440
- console.error("Failed to parse websocket message:", ce, w.data);
485
+ _ = JSON.parse(b.data);
486
+ } catch (Ce) {
487
+ console.error("Failed to parse websocket message:", Ce, b.data);
441
488
  return;
442
489
  }
443
- const { topic: S, sender: V, summary: ae, status: ie } = A || {};
444
- if (f.current && (S === "heartbeat" || S === "server.started" && ie === "finished")) {
445
- console.log("Server replica booted"), re();
490
+ const { topic: T, sender: oe, summary: Se, status: be } = _ || {};
491
+ if (d.current && (T === "heartbeat" || T === "server.started" && be === "finished")) {
492
+ console.log("Server replica booted"), N();
446
493
  return;
447
494
  }
448
- if (S === "heartbeat") return;
449
- if (S === "server.restart_requested" && (console.log("Server restart requested"), a(!0)), ["import.data"].includes(S)) {
450
- if (V !== window.senderId) return;
451
- } else if (V === window.senderId)
452
- return;
453
- const B = Date.now();
454
- B - I.current.lastCall < 1e3 ? I.current.callCount += 1 : I.current.callCount = 0, console.log("Event RX", A), I.current.lastCall = B, S === "shout" && A?.summary?.text && H.info(ae.text), D.publish(S, A);
495
+ if (T !== "heartbeat") {
496
+ if (T === "server.restart_requested" && (console.log("Server restart requested"), a(!0)), ["import.data"].includes(T)) {
497
+ if (oe !== window.senderId) return;
498
+ } else if (oe === window.senderId)
499
+ return;
500
+ k.current.callCount += 1, console.log("Event RX", _), T === "shout" && _?.summary?.text && B.info(Se.text), D.publish(T, _);
501
+ }
455
502
  },
456
503
  [a]
457
504
  );
458
- return m(() => {
459
- P === xe.OPEN && (E().onmessage = se, v(), D.publish("client.connected", {
505
+ return E(() => {
506
+ m === Oe.OPEN && (u().onmessage = A, l(), D.publish("client.connected", {
460
507
  topic: "client.connected"
461
508
  }));
462
- }, [P, E]), /* @__PURE__ */ d(
463
- Z.Provider,
509
+ }, [m, u]), /* @__PURE__ */ p(
510
+ ge.Provider,
464
511
  {
465
512
  value: {
466
- getWebSocket: E,
467
- readyState: P,
513
+ getWebSocket: u,
514
+ readyState: m,
468
515
  serverRestartingVisible: n
469
516
  },
470
517
  children: e
471
518
  }
472
519
  );
473
- }, Q = p(void 0), po = () => {
474
- const e = l(Q);
520
+ }, we = y(void 0), Do = () => {
521
+ const e = f(we);
475
522
  if (e === void 0)
476
523
  throw new Error("useProjectContext must be used within a ProjectContextProvider");
477
524
  return e;
478
- }, fo = () => l(Q), Qe = p(
525
+ }, Ro = () => f(we), fe = y(
479
526
  void 0
480
- ), go = () => {
481
- const e = l(Qe);
527
+ ), $o = () => {
528
+ const e = f(fe);
482
529
  if (e === void 0)
483
530
  throw new Error("useProjectFoldersContext must be used within a ProjectFoldersContextProvider");
484
531
  return e;
485
- }, ee = p(void 0), et = (e) => ({
532
+ }, No = () => f(fe), Q = y(void 0), ee = (e) => ({
486
533
  created: e,
487
534
  label_changed: e,
488
535
  renamed: e,
@@ -491,7 +538,7 @@ const He = u(ve)`
491
538
  tags_changed: e,
492
539
  attrib_changed: e,
493
540
  deleted: e
494
- }), tt = (e, t) => e === t || e.startsWith(`${t}.`), ot = (e, t) => t.length === 0 ? !0 : t.includes(e || ""), nt = (e) => {
541
+ }), he = (e, t) => e === t || e.startsWith(`${t}.`), X = (e, t) => t.length === 0 ? !0 : t.includes(e || ""), ve = (e) => {
495
542
  const t = e.split(".").pop();
496
543
  if (t && [
497
544
  "created",
@@ -504,39 +551,44 @@ const He = u(ve)`
504
551
  "deleted"
505
552
  ].includes(t))
506
553
  return t;
507
- }, ho = ({
554
+ }, _o = ({
508
555
  projectNames: e,
509
556
  topics: t,
510
557
  isSyncing: o = !1,
511
- shouldSyncOnUpdate: i
558
+ shouldSyncOnUpdate: r
512
559
  }) => {
513
- const n = l(ee);
560
+ const n = f(Q);
514
561
  if (!n)
515
562
  throw new Error("useSyncUpdates must be used within an EntityUpdatesProvider");
516
- const a = e || n.projectNames, r = y(0), s = y(!1), c = n.updates.filter(
517
- (f) => ot(f.project, a) && t.some((g) => tt(f.topic, g)) && (i?.(f) ?? !0)
563
+ const a = e || n.projectNames, i = P(0), s = P(!1), c = n.updates.filter(
564
+ (d) => X(d.project, a) && t.some((g) => he(d.topic, g)) && (r?.(d) ?? !0)
518
565
  );
519
- return m(() => {
520
- o && !s.current ? r.current = n.getLatestId() : !o && s.current && n.acknowledge(t, a, r.current), s.current = o;
566
+ return E(() => {
567
+ o && !s.current ? i.current = n.getLatestId() : !o && s.current && n.acknowledge(t, a, i.current), s.current = o;
521
568
  }, [n, o, a, t]), {
522
569
  updates: c,
523
570
  hasUpdates: c.length > 0,
524
571
  updateCount: c.length
525
572
  };
526
- }, mo = () => {
527
- const e = l(ee);
573
+ }, jo = () => {
574
+ const e = f(Q);
528
575
  if (!e)
529
576
  throw new Error("useAutoSyncSettings must be used within an EntityUpdatesProvider");
530
577
  const { autoSyncSettings: t, setAutoSyncSettings: o } = e;
531
578
  return [t, (n) => {
532
- const { settings: a, global: r } = n;
533
- o(r !== void 0 ? et(r) : (s) => ({ ...s, ...a }));
579
+ const { settings: a, global: i } = n;
580
+ o(i !== void 0 ? ee(i) : (s) => ({ ...s, ...a }));
534
581
  }];
535
- }, vo = (e, t) => {
582
+ }, Lo = (e, t) => {
536
583
  if (!t) return !1;
537
- const o = nt(e);
584
+ const o = ve(e);
538
585
  return o ? t[o] : !1;
539
- }, rt = u.li`
586
+ }, mt = () => Pe().replace(/-/g, ""), yt = (e = {}) => ({
587
+ id: mt(),
588
+ label: "Working",
589
+ working: !0,
590
+ settings: e
591
+ }), xt = v.li`
540
592
  position: relative;
541
593
  padding: 4px 6px 4px 12px;
542
594
  user-select: none;
@@ -589,7 +641,7 @@ const He = u(ve)`
589
641
  display: flex;
590
642
  }
591
643
  }
592
- `, j = u($)`
644
+ `, z = v(q)`
593
645
  &.hasIcon {
594
646
  padding: 2px;
595
647
  }
@@ -607,79 +659,79 @@ const He = u(ve)`
607
659
  }
608
660
  }
609
661
  }
610
- `, st = U(
662
+ `, St = Z(
611
663
  ({
612
664
  id: e,
613
665
  label: t,
614
666
  startContent: o,
615
- endContent: i,
667
+ endContent: r,
616
668
  isSelected: n,
617
669
  isEditable: a,
618
- isSaveable: r,
670
+ isSaveable: i,
619
671
  highlighted: s,
620
672
  onEdit: c,
621
- onSave: f,
673
+ onSave: d,
622
674
  onResetView: g,
623
- className: C,
624
- ...P
625
- }, E) => {
626
- const { viewAlias: v } = ft(), T = (h, R) => {
627
- h.stopPropagation(), R ? fe({
628
- message: `Save current ${v} settings and overwrite this ${v}?`,
675
+ className: w,
676
+ ...m
677
+ }, u) => {
678
+ const { viewAlias: l } = te(), x = (h, S) => {
679
+ h.stopPropagation(), S ? Ie({
680
+ message: `Save current ${l} settings and overwrite this ${l}?`,
629
681
  header: "Confirm save",
630
- accept: () => f && f(h, e)
631
- }) : f && f(h, e);
682
+ accept: () => d && d(h, e)
683
+ }) : d && d(h, e);
632
684
  };
633
- return /* @__PURE__ */ x(
634
- rt,
685
+ return /* @__PURE__ */ C(
686
+ xt,
635
687
  {
636
- ...P,
688
+ ...m,
637
689
  id: e,
638
- className: k(C, { selected: n }),
639
- ref: E,
690
+ className: O(w, { selected: n }),
691
+ ref: u,
640
692
  children: [
641
693
  o && o,
642
- /* @__PURE__ */ d("span", { className: "label", children: t }),
643
- g && /* @__PURE__ */ d(
644
- j,
694
+ /* @__PURE__ */ p("span", { className: "label", children: t }),
695
+ g && /* @__PURE__ */ p(
696
+ z,
645
697
  {
646
698
  icon: "restart_alt",
647
699
  variant: "text",
648
700
  className: "reset",
649
701
  onClick: g,
650
702
  "data-tooltip": "Reset to Default",
651
- "data-shortcut": ue("0", [W.Shift, W.Ctrl])
703
+ "data-shortcut": Ne("0", [ae.Shift, ae.Ctrl])
652
704
  }
653
705
  ),
654
- a && r && !n && /* @__PURE__ */ d(
655
- j,
706
+ a && i && !n && /* @__PURE__ */ p(
707
+ z,
656
708
  {
657
709
  icon: "save",
658
710
  variant: "text",
659
- className: k("save", { active: s === "save" }),
660
- onClick: (h) => T(h, s !== "save"),
661
- "data-tooltip": `Save ${v} settings from current ${v}`
711
+ className: O("save", { active: s === "save" }),
712
+ onClick: (h) => x(h, s !== "save"),
713
+ "data-tooltip": `Save ${l} settings from current ${l}`
662
714
  }
663
715
  ),
664
- a && c && /* @__PURE__ */ d(
665
- j,
716
+ a && c && /* @__PURE__ */ p(
717
+ z,
666
718
  {
667
719
  variant: "text",
668
720
  icon: "more_horiz",
669
- className: k("more", { active: s === "edit" }),
721
+ className: O("more", { active: s === "edit" }),
670
722
  onClick: (h) => c(h, e),
671
- "data-tooltip": `Edit ${v}`
723
+ "data-tooltip": `Edit ${l}`
672
724
  }
673
725
  ),
674
- i && i
726
+ r && r
675
727
  ]
676
728
  }
677
729
  );
678
730
  }
679
- ), at = u.div`
731
+ ), bt = v.div`
680
732
  overflow: auto;
681
733
  max-height: 40vh;
682
- `, it = u.ul`
734
+ `, Ct = v.ul`
683
735
  /* reset defaults */
684
736
  margin: 0;
685
737
  padding: 0;
@@ -689,17 +741,17 @@ const He = u(ve)`
689
741
  flex-direction: column;
690
742
  gap: var(--base-gap-small);
691
743
  margin-bottom: var(--padding-s);
692
- `, ct = u.li`
744
+ `, Et = v.li`
693
745
  height: 1px;
694
746
  background-color: var(--md-sys-color-outline-variant);
695
747
  margin: 4px 0;
696
748
  `;
697
- u.li`
698
- ${Y.labelSmall}
749
+ v.li`
750
+ ${le.labelSmall}
699
751
  color: var(--md-sys-color-outline);
700
752
  `;
701
- const dt = u.li`
702
- ${Y.labelSmall}
753
+ const It = v.li`
754
+ ${le.labelSmall}
703
755
  color: var(--md-sys-color-outline);
704
756
  user-select: none;
705
757
  border-radius: var(--border-radius-m);
@@ -734,23 +786,23 @@ const dt = u.li`
734
786
  &:hover .icon {
735
787
  display: inline-flex;
736
788
  }
737
- `, lt = U(
738
- ({ title: e, collapsed: t, className: o, ...i }, n) => /* @__PURE__ */ x(
739
- dt,
789
+ `, Pt = Z(
790
+ ({ title: e, collapsed: t, className: o, ...r }, n) => /* @__PURE__ */ C(
791
+ It,
740
792
  {
741
- ...i,
742
- className: k("views-section-header", { collapsed: t }, o),
793
+ ...r,
794
+ className: O("views-section-header", { collapsed: t }, o),
743
795
  ref: n,
744
796
  children: [
745
- /* @__PURE__ */ d("span", { children: e }),
746
- /* @__PURE__ */ d("span", { className: "spacer" }),
747
- /* @__PURE__ */ d(q, { className: "icon", icon: "expand_more" })
797
+ /* @__PURE__ */ p("span", { children: e }),
798
+ /* @__PURE__ */ p("span", { className: "spacer" }),
799
+ /* @__PURE__ */ p(K, { className: "icon", icon: "expand_more" })
748
800
  ]
749
801
  }
750
802
  )
751
- ), wo = "_divider_", ut = (e) => typeof e == "object" && e !== null && "type" in e && e.type === "section", xo = U(
752
- ({ items: e, selected: t, ...o }, i) => /* @__PURE__ */ d(at, { children: /* @__PURE__ */ d(it, { ...o, ref: i, children: e.map((n, a) => n === "_divider_" ? /* @__PURE__ */ d(ct, {}, a) : ut(n) ? /* @__PURE__ */ d(
753
- lt,
803
+ ), Oo = "_divider_", Vt = (e) => typeof e == "object" && e !== null && "type" in e && e.type === "section", Mo = Z(
804
+ ({ items: e, selected: t, ...o }, r) => /* @__PURE__ */ p(bt, { children: /* @__PURE__ */ p(Ct, { ...o, ref: r, children: e.map((n, a) => n === "_divider_" ? /* @__PURE__ */ p(Et, {}, a) : Vt(n) ? /* @__PURE__ */ p(
805
+ Pt,
754
806
  {
755
807
  id: n.id,
756
808
  title: n.title,
@@ -758,8 +810,8 @@ const dt = u.li`
758
810
  onClick: n.onToggle
759
811
  },
760
812
  n.id
761
- ) : /* @__PURE__ */ d(
762
- st,
813
+ ) : /* @__PURE__ */ p(
814
+ St,
763
815
  {
764
816
  tabIndex: 0,
765
817
  isSelected: n.id === t,
@@ -768,50 +820,234 @@ const dt = u.li`
768
820
  },
769
821
  (n.id || "") + a.toString()
770
822
  )) }) })
771
- ), pt = p(null), ft = () => {
772
- const e = l(pt);
823
+ ), kt = y(null), te = () => {
824
+ const e = f(kt);
773
825
  if (!e)
774
826
  throw new Error("useViewsContext must be used within a ViewsProvider");
775
827
  return e;
776
- }, So = 1, gt = u.div`
828
+ };
829
+ let F = !1;
830
+ const ce = () => {
831
+ F || (F = !0, queueMicrotask(() => {
832
+ F = !1;
833
+ }));
834
+ }, At = async (e, t, o, r = {}, n, a, i, s) => {
835
+ const {
836
+ viewSettings: c,
837
+ viewType: d,
838
+ projectName: g,
839
+ selectedView: w,
840
+ setSelectedView: m,
841
+ workingView: u,
842
+ onSettingsChanged: l,
843
+ isErrorWorkingView: x
844
+ } = n;
845
+ if (!d) throw new Error("No view type provided for updating view settings");
846
+ const h = w?.id, S = w?.working;
847
+ try {
848
+ t(o);
849
+ const { settings: $, workingViewId: R } = i(), j = $ ?? c;
850
+ if (j === void 0 && !x) {
851
+ console.warn(
852
+ "updateViewSettings: no settings baseline available, aborting to prevent data loss."
853
+ );
854
+ return;
855
+ }
856
+ const k = { ...j, ...e }, N = yt(k), A = R ?? u?.id;
857
+ A && (N.id = A);
858
+ const b = N.id, L = a(
859
+ {
860
+ payload: A ? { settings: k } : N,
861
+ viewType: d,
862
+ projectName: g
863
+ },
864
+ A
865
+ );
866
+ s(), (!S || w?.id !== A) && (w && l(!0), m(b)), await L, t(null), r.successMessage && B.success(r.successMessage);
867
+ } catch ($) {
868
+ t(null), h && m(h), w && !S && l(!1);
869
+ const R = r.errorMessage || `Failed to update view settings: ${$}`;
870
+ B.error(R);
871
+ }
872
+ }, Tt = () => {
873
+ const [e] = Te(), [t] = De(), o = te(), r = Re(), n = V(
874
+ async (s, c) => {
875
+ if (c) {
876
+ const d = {};
877
+ return ["label", "owner", "settings"].forEach((w) => {
878
+ s.payload[w] !== void 0 && (d[w] = s.payload[w]);
879
+ }), await t({
880
+ viewType: s.viewType,
881
+ projectName: s.projectName,
882
+ viewId: c,
883
+ genericViewPatchModel: d
884
+ }).unwrap();
885
+ } else
886
+ return await e({
887
+ viewType: s.viewType,
888
+ projectName: s.projectName,
889
+ genericViewPostModel: s.payload
890
+ }).unwrap();
891
+ },
892
+ [e, t]
893
+ ), a = V(() => {
894
+ const { viewType: s, projectName: c, selectedView: d, workingView: g } = o;
895
+ if (!s) return {};
896
+ const w = r.getState(), m = se.endpoints.getWorkingView.select({
897
+ viewType: s,
898
+ projectName: c
899
+ })(w), l = m?.data?.id || g?.id, x = se.endpoints.getDefaultView.select({
900
+ viewType: s,
901
+ projectName: c
902
+ })(w), h = x?.data?.id || d?.id;
903
+ return (!!l && h === l || F) && m?.data?.settings ? {
904
+ settings: m.data.settings,
905
+ workingViewId: l
906
+ } : x?.data?.settings ? {
907
+ settings: x.data.settings,
908
+ workingViewId: l
909
+ } : { workingViewId: l };
910
+ }, [r, o]);
911
+ return {
912
+ updateViewSettings: V(
913
+ async (...s) => await At(...s, o, n, a, ce),
914
+ [o, n, a]
915
+ ),
916
+ onCreateView: n,
917
+ getLatestSettings: a,
918
+ markCacheDirty: ce
919
+ };
920
+ }, de = (e, t) => t.split(".").reduce((o, r) => o?.[r], e), me = (e, t, o) => {
921
+ const [r, ...n] = t.split(".");
922
+ return r ? {
923
+ ...e,
924
+ [r]: n.length ? me(e[r] || {}, n.join("."), o) : o
925
+ } : e;
926
+ }, Dt = (e, t) => {
927
+ const { viewSettings: o, isLoadingViews: r } = te(), { updateViewSettings: n, getLatestSettings: a } = Tt(), [i, s] = I(null), c = P(null), d = o, g = i !== null ? i : de(d, e) ?? t, w = V((u) => {
928
+ c.current = u, s(u);
929
+ }, []), m = V(
930
+ (u) => {
931
+ if (r) return;
932
+ const l = a().settings ?? d ?? {}, x = c.current !== null ? c.current : de(l, e) ?? t, h = typeof u == "function" ? u(
933
+ x
934
+ ) : u;
935
+ n(
936
+ me(l, e, h),
937
+ w,
938
+ h,
939
+ {}
940
+ );
941
+ },
942
+ [
943
+ t,
944
+ a,
945
+ r,
946
+ e,
947
+ d,
948
+ w,
949
+ n
950
+ ]
951
+ );
952
+ return [g, m];
953
+ }, Uo = !0, Rt = { ...ee(!0), created: !1 }, Wo = ({ children: e, projectNames: t }) => {
954
+ const o = P(0), [r = ee(!1), n] = Dt("autoSync"), [a, i] = I([]), s = G(
955
+ () => Rt,
956
+ [r]
957
+ );
958
+ E(() => {
959
+ let d = 0;
960
+ const g = ke(
961
+ (m) => {
962
+ const u = m.map(({ project: l, topic: x, updateType: h, message: S }) => ({
963
+ id: ++o.current,
964
+ project: l,
965
+ topic: x,
966
+ updateType: h,
967
+ entityId: S.summary?.entityId,
968
+ message: S
969
+ }));
970
+ i((l) => [...l, ...u]);
971
+ },
972
+ ({ key: m }) => String(m),
973
+ 0
974
+ ), w = D.subscribeAll((m, u) => {
975
+ if (!u?.topic || !X(u.project, t)) return;
976
+ const l = ve(u.topic);
977
+ !l || s[l] || l === "created" && ![
978
+ "entity.folder.created",
979
+ "entity.task.created",
980
+ "entity.product.created",
981
+ "entity.version.created"
982
+ ].includes(u.topic) || g.add({
983
+ key: ++d,
984
+ project: u.project,
985
+ topic: u.topic,
986
+ updateType: l,
987
+ message: u
988
+ });
989
+ });
990
+ return () => {
991
+ D.unsubscribe(w), g.clear();
992
+ };
993
+ }, [s, t]);
994
+ const c = G(
995
+ () => ({
996
+ updates: a,
997
+ projectNames: t,
998
+ acknowledge: (d, g, w) => {
999
+ i(
1000
+ (m) => m.filter(
1001
+ (u) => u.id > w || !d.some((l) => he(u.topic, l)) || !X(u.project, g)
1002
+ )
1003
+ );
1004
+ },
1005
+ getLatestId: () => o.current,
1006
+ autoSyncSettings: s,
1007
+ setAutoSyncSettings: n
1008
+ }),
1009
+ [s, t, n, a]
1010
+ );
1011
+ return /* @__PURE__ */ p(Q.Provider, { value: c, children: e });
1012
+ }, Fo = 1, $t = v.div`
777
1013
  min-width: 350px;
778
- `, ht = u.div`
1014
+ `, Nt = v.div`
779
1015
  margin-top: 12px;
780
1016
  min-height: 60px;
781
1017
  min-width: 350px;
782
- `, mt = u.p`
1018
+ `, _t = v.p`
783
1019
  font-weight: 600;
784
1020
  margin-bottom: 4px;
785
- `, vt = u.p`
1021
+ `, jt = v.p`
786
1022
  margin-top: 12px;
787
1023
  font-weight: 600;
788
1024
  color: var(--md-sys-color-error);
789
- `, bo = ({
1025
+ `, Bo = ({
790
1026
  entityLabel: e,
791
1027
  childrenDetails: t,
792
1028
  totalLine: o,
793
- message: i
794
- }) => /* @__PURE__ */ x(gt, { children: [
795
- /* @__PURE__ */ d("p", { children: i || `Are you sure you want to delete ${e}? This action cannot be undone.` }),
796
- t.length > 0 && /* @__PURE__ */ x(ht, { children: [
797
- /* @__PURE__ */ d(mt, { children: "The following will also be affected:" }),
798
- t.map((n, a) => /* @__PURE__ */ d("p", { children: n }, a))
1029
+ message: r
1030
+ }) => /* @__PURE__ */ C($t, { children: [
1031
+ /* @__PURE__ */ p("p", { children: r || `Are you sure you want to delete ${e}? This action cannot be undone.` }),
1032
+ t.length > 0 && /* @__PURE__ */ C(Nt, { children: [
1033
+ /* @__PURE__ */ p(_t, { children: "The following will also be affected:" }),
1034
+ t.map((n, a) => /* @__PURE__ */ p("p", { children: n }, a))
799
1035
  ] }),
800
- o && /* @__PURE__ */ d(vt, { children: o })
801
- ] }), yo = u(le)`
1036
+ o && /* @__PURE__ */ p(jt, { children: o })
1037
+ ] }), Jo = v($e)`
802
1038
  max-height: min(600px, 90vh);
803
- `, Co = u.div`
1039
+ `, qo = v.div`
804
1040
  display: flex;
805
1041
  flex-direction: column;
806
1042
  width: 100%;
807
- `, Po = u.label`
1043
+ `, Ho = v.label`
808
1044
  margin: 2px 0 14px 0;
809
- `, Eo = u.div`
1045
+ `, zo = v.div`
810
1046
  display: flex;
811
1047
  padding-top: 14px;
812
1048
  gap: 8px;
813
1049
  justify-content: flex-end;
814
- `, Io = u.div`
1050
+ `, Go = v.div`
815
1051
  display: flex;
816
1052
  flex-direction: column;
817
1053
  gap: 8px;
@@ -820,110 +1056,118 @@ const dt = u.li`
820
1056
  /* scroll container clips the inputs' 2px focus outline — inset it, then pull back to keep alignment */
821
1057
  padding: 4px;
822
1058
  margin: -4px;
823
- `, Ao = u.label`
1059
+ `, Ko = v.label`
824
1060
  display: flex;
825
1061
  align-items: center;
826
1062
  justify-content: space-between;
827
1063
  gap: 12px;
828
- `, Do = u(G)`
1064
+ `, Yo = v(ue)`
829
1065
  width: 180px;
830
- `, To = u(G)`
1066
+ `, Xo = v(ue)`
831
1067
  width: 100%;
832
1068
  /* room for the 2px focus outline */
833
1069
  margin: 2px 0;
834
- `, wt = /* @__PURE__ */ new Set([
1070
+ `, Lt = /* @__PURE__ */ new Set([
835
1071
  "folder",
836
1072
  "task",
837
1073
  "product",
838
1074
  "version",
839
1075
  "representation",
840
1076
  "workfile"
841
- ]), Ro = (e) => !!e && wt.has(e), te = p(null), ko = () => {
842
- const e = l(te);
1077
+ ]), Zo = (e) => !!e && Lt.has(e), ye = y(null), Qo = () => {
1078
+ const e = f(ye);
843
1079
  if (!e)
844
1080
  throw new Error("useDeleteEntitiesContext must be used within a DeleteEntitiesProvider");
845
1081
  return e;
846
- }, Oo = () => l(te), _o = "tableExport", xt = p(null), No = () => l(xt);
1082
+ }, en = () => f(ye), tn = "tableExport", Ot = y(null), on = () => f(Ot);
847
1083
  export {
848
- _o as $,
849
- Ht as A,
850
- Ie as B,
851
- To as C,
852
- bo as D,
853
- ee as E,
854
- Co as F,
855
- Kt as G,
856
- Se as H,
857
- M as I,
858
- Me as J,
859
- Yt as K,
860
- Ne as L,
861
- Ge as M,
862
- Fe as N,
863
- Be as O,
864
- Q as P,
865
- Je as Q,
866
- ye as R,
867
- yo as S,
868
- Ve as T,
869
- qe as U,
870
- Ye as V,
871
- Te as W,
872
- be as X,
873
- Qe as Y,
874
- Re as Z,
875
- te as _,
876
- Wt as a,
877
- xt as a0,
878
- so as a1,
879
- Z as a2,
880
- uo as a3,
881
- Qt as a4,
882
- vo as a5,
883
- je as a6,
884
- Ro as a7,
885
- eo as a8,
886
- io as a9,
887
- ao as aa,
888
- mo as ab,
889
- ko as ac,
890
- Oo as ad,
891
- We as ae,
892
- to as af,
893
- ro as ag,
894
- lo as ah,
895
- oo as ai,
896
- ho as aj,
897
- No as ak,
898
- no as al,
899
- wo as am,
900
- pt as an,
901
- lt as ao,
902
- xo as ap,
903
- st as aq,
904
- qt as b,
905
- tt as c,
906
- Jt as d,
907
- ft as e,
908
- So as f,
909
- nt as g,
910
- Po as h,
911
- Io as i,
912
- Ao as j,
913
- Do as k,
914
- Eo as l,
915
- ot as m,
916
- fo as n,
917
- ke as o,
918
- Gt as p,
919
- Zt as q,
920
- Oe as r,
921
- Xt as s,
922
- et as t,
923
- co as u,
924
- Ue as v,
925
- _e as w,
1084
+ Io as $,
1085
+ go as A,
1086
+ Y as B,
1087
+ Xo as C,
1088
+ Bo as D,
1089
+ nt as E,
1090
+ qo as F,
1091
+ fo as G,
1092
+ Qe as H,
1093
+ st as I,
1094
+ it as J,
1095
+ ct as K,
1096
+ gt as L,
1097
+ ft as M,
1098
+ wt as N,
1099
+ Ge as O,
1100
+ we as P,
1101
+ Ue as Q,
1102
+ We as R,
1103
+ Jo as S,
1104
+ at as T,
1105
+ Ke as U,
1106
+ ye as V,
1107
+ tn as W,
1108
+ Ot as X,
1109
+ Q as Y,
1110
+ Wo as Z,
1111
+ Uo as _,
1112
+ lo as a,
1113
+ ge as a0,
1114
+ To as a1,
1115
+ yo as a2,
1116
+ Lo as a3,
1117
+ ve as a4,
1118
+ ot as a5,
1119
+ Zo as a6,
1120
+ X as a7,
1121
+ he as a8,
1122
+ xo as a9,
1123
+ ee as aa,
1124
+ Vo as ab,
1125
+ Po as ac,
1126
+ jo as ad,
1127
+ Qo as ae,
1128
+ en as af,
1129
+ dt as ag,
1130
+ So as ah,
1131
+ Eo as ai,
1132
+ Ao as aj,
1133
+ bo as ak,
1134
+ _o as al,
1135
+ on as am,
1136
+ Co as an,
1137
+ te as ao,
1138
+ Tt as ap,
1139
+ At as aq,
1140
+ yt as ar,
1141
+ Oo as as,
1142
+ kt as at,
1143
+ Pt as au,
1144
+ Mo as av,
1145
+ St as aw,
1146
+ mt as ax,
1147
+ Dt as ay,
1148
+ wo as b,
1149
+ co as c,
1150
+ Fo as d,
1151
+ Ho as e,
1152
+ Go as f,
1153
+ Ko as g,
1154
+ Yo as h,
1155
+ zo as i,
1156
+ fe as j,
1157
+ Ro as k,
1158
+ Ye as l,
1159
+ rt as m,
1160
+ Xe as n,
1161
+ mo as o,
1162
+ Ze as p,
1163
+ Do as q,
1164
+ ho as r,
1165
+ $o as s,
1166
+ No as t,
1167
+ ko as u,
1168
+ uo as v,
1169
+ vo as w,
926
1170
  po as x,
927
- go as y,
928
- zt as z
1171
+ He as y,
1172
+ Me as z
929
1173
  };