@ynput/ayon-frontend-shared 0.7.4 → 0.7.6

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 (52) hide show
  1. package/dist/DetailsPanel.es.js +376 -380
  2. package/dist/ListTable.es.js +2 -2
  3. package/dist/NewEntity.es.js +26 -26
  4. package/dist/ProjectTreeTable.es.js +2521 -2510
  5. package/dist/ProjectsTable.es.js +3 -3
  6. package/dist/Slicer.es.js +32 -32
  7. package/dist/Views.es.js +1 -1
  8. package/dist/chunks/ColumnDropIndicator.es.js +2 -2
  9. package/dist/chunks/ColumnHeaderMenuUI.es.js +1 -1
  10. package/dist/chunks/EntityPath.es.js +1 -1
  11. package/dist/chunks/EntityPickerDialog.es.js +481 -460
  12. package/dist/chunks/EntityTooltip.es.js +1 -1
  13. package/dist/chunks/Feed.es.js +11 -10
  14. package/dist/chunks/FilterErrorActions.es.js +1 -1
  15. package/dist/chunks/GroupSettingsFallback.es.js +2 -2
  16. package/dist/chunks/Menu.es.js +250 -247
  17. package/dist/chunks/MetaWidget.es.js +2 -2
  18. package/dist/chunks/PlayableIcon.es.js +368 -368
  19. package/dist/chunks/ProjectFoldersContext.es.js +237 -0
  20. package/dist/chunks/ReviewablesSelector.es.js +1223 -1170
  21. package/dist/chunks/SimpleTable.es.js +301 -296
  22. package/dist/chunks/Slicer.es.js +418 -410
  23. package/dist/chunks/TableExportContextInstance.es.js +428 -382
  24. package/dist/chunks/ThumbnailUploaderContext.es.js +48 -0
  25. package/dist/chunks/Watchers.es.js +2 -2
  26. package/dist/chunks/{ColumnDropIndicator.styled.es.js → addonColumnTags.es.js} +60 -47
  27. package/dist/components.es.js +1404 -1274
  28. package/dist/context.es.js +559 -657
  29. package/dist/hooks.es.js +2 -2
  30. package/dist/index.es.js +2 -2
  31. package/dist/types/Actions.d.ts +16 -16
  32. package/dist/types/ContextMenu.d.ts +16 -16
  33. package/dist/types/DetailsPanel.d.ts +16 -16
  34. package/dist/types/EntityPickerDialog.d.ts +61 -18
  35. package/dist/types/Feed.d.ts +16 -16
  36. package/dist/types/ListTable.d.ts +16 -16
  37. package/dist/types/NewEntity.d.ts +16 -16
  38. package/dist/types/ProjectTreeTable.d.ts +135 -33
  39. package/dist/types/ProjectsTable.d.ts +16 -16
  40. package/dist/types/RepresentationsList.d.ts +16 -16
  41. package/dist/types/SimpleTable.d.ts +16 -16
  42. package/dist/types/Slicer.d.ts +16 -16
  43. package/dist/types/Views.d.ts +16 -16
  44. package/dist/types/api.d.ts +16 -16
  45. package/dist/types/components.d.ts +226 -39
  46. package/dist/types/context.d.ts +24 -16
  47. package/dist/types/hooks.d.ts +16 -16
  48. package/dist/types/index.d.ts +16 -16
  49. package/dist/types/util.d.ts +16 -16
  50. package/package.json +3 -3
  51. package/dist/chunks/ProjectContext.es.js +0 -158
  52. package/dist/chunks/useQueryArgumentChangeLoading.es.js +0 -11
@@ -1,134 +1,144 @@
1
- import { jsxs as ie, jsx as T } from "react/jsx-runtime";
2
- import { useState as C, useEffect as U, useMemo as A, useRef as le, useCallback as L } from "react";
3
- import { registerRemotes as ve, loadRemote as ye } from "@module-federation/enhanced/runtime";
4
- import { setManifestsLoading as ce, MANIFEST_MODULE as se, registerManifest as Pe } from "@ynput/ayon-addon/host";
5
- import { toast as M } from "react-toastify";
6
- import { d as de, z as be, A as we, B as Se, R as Ce, G as Ie, H as Ee, b as Z, o as ke, I as Le, J as xe, K as De, L as Te, N as Ae, O as Fe, Q as Oe, U as je, V as Me, W as Re, X as Ue, Y as Ne, Z as $e, _ as _e, a as Be, $ as Ge, a0 as Ve } from "./chunks/TableExportContextInstance.es.js";
7
- import { E as to, M as oo, a1 as no, P as so, a2 as ro, a3 as ao, T as io, a4 as lo, a5 as co, g as uo, a6 as po, a7 as fo, m as mo, c as go, a8 as ho, t as vo, a9 as yo, aa as Po, ab as bo, ac as wo, ad as So, v as Co, u as Io, n as Eo, ae as ko, x as Lo, y as xo, af as Do, ag as To, ah as Ao, ai as Fo, aj as Oo, ak as jo, al as Mo } from "./chunks/TableExportContextInstance.es.js";
8
- import { aH as We, bt as Qe } from "./chunks/searchTerms.es.js";
9
- import { cZ as qe, ca as He, co as ze, bu as Ye, c$ as Ke, cK as Xe, bO as Ze, d5 as Je, dw as et, cR as tt } from "./chunks/getUris.es.js";
1
+ import { jsxs as le, jsx as k } from "react/jsx-runtime";
2
+ import { useState as h, useEffect as O, useMemo as q, useRef as ce, useCallback as C } from "react";
3
+ import { registerRemotes as Pe, loadRemote as be } from "@module-federation/enhanced/runtime";
4
+ import { setManifestsLoading as de, MANIFEST_MODULE as re, registerManifest as we } from "@ynput/ayon-addon/host";
5
+ import { toast as I } from "react-toastify";
6
+ import { d as ue, A as Ee, B as Se, G as Ce, R as xe, H as ke, I as Le, b as ee, p as Ie, J as De, K as Te, L as je, N as Ae, O as Oe, Q as Re, U as Me, V as Fe, W as Ue, X as $e, Y as Ne, Z as _e, _ as Be, a as Ge, $ as qe, a0 as Ve } from "./chunks/TableExportContextInstance.es.js";
7
+ import { E as Zt, M as Jt, a1 as eo, P as to, n as oo, a2 as no, a3 as so, T as ro, a4 as ao, a5 as io, g as lo, a6 as co, a7 as uo, m as po, c as fo, a8 as mo, t as go, a9 as vo, aa as yo, ab as ho, ac as Po, ad as bo, x as wo, u as Eo, o as So, ae as Co, af as xo, y as ko, z as Lo, ag as Io, ah as Do, ai as To, aj as jo, ak as Ao, al as Oo, am as Ro } from "./chunks/TableExportContextInstance.es.js";
8
+ import { aH as We, bt as He } from "./chunks/searchTerms.es.js";
9
+ import { cZ as Qe, ca as ze, co as Ye, bu as Ke, c$ as Xe, cK as Ze, d5 as Je, dw as et, cR as tt } from "./chunks/getUris.es.js";
10
10
  import "primereact/confirmdialog";
11
11
  import "lodash";
12
- import { v4 as X } from "uuid";
12
+ import { v4 as J } from "uuid";
13
13
  import { g as ot, c as nt, p as st, b as rt } from "./chunks/getBundleMode.es.js";
14
- import { U as Uo } from "./chunks/getBundleMode.es.js";
14
+ import { U as Fo } from "./chunks/getBundleMode.es.js";
15
15
  import "axios";
16
- import { u as ue } from "./chunks/useLoadModule.es.js";
17
- import { P as $o, T as _o } from "./chunks/ProjectContext.es.js";
16
+ import { u as pe } from "./chunks/useLoadModule.es.js";
17
+ import { T as $o } from "./chunks/ThumbnailUploaderContext.es.js";
18
18
  import "react-dom";
19
- import { p as at, b as it, a as lt, c as ct, D as re } from "./chunks/DeleteEntitiesConfirmDialog.es.js";
20
- import { d as Go } from "./chunks/DeleteEntitiesConfirmDialog.es.js";
21
- import { M as Wo } from "./chunks/MenuContext.es.js";
22
- import { u as dt } from "./chunks/useQueryArgumentChangeLoading.es.js";
23
- import { E as qo, F as Ho } from "./chunks/EntityUpdatesContext.es.js";
24
- import { useSearchParams as ut } from "react-router-dom";
25
- const pt = async (d) => {
26
- await Promise.all(
27
- d.filter((n) => n.modules.includes(se)).map(async (n) => {
19
+ import { p as at, b as it, a as lt, c as ct, D as ae } from "./chunks/DeleteEntitiesConfirmDialog.es.js";
20
+ import { d as _o } from "./chunks/DeleteEntitiesConfirmDialog.es.js";
21
+ import { M as Go } from "./chunks/MenuContext.es.js";
22
+ import { P as Vo, a as Wo } from "./chunks/ProjectFoldersContext.es.js";
23
+ import { E as Qo, F as zo } from "./chunks/EntityUpdatesContext.es.js";
24
+ import { useSearchParams as dt } from "react-router-dom";
25
+ const ut = async (c) => {
26
+ const s = {};
27
+ return await Promise.all(
28
+ c.filter((o) => o.modules.includes(re)).map(async (o) => {
28
29
  try {
29
- const s = await ye(
30
- `${n.remote}/${se}`,
30
+ const e = await be(
31
+ `${o.remote}/${re}`,
31
32
  { from: "runtime" }
32
- );
33
- Pe({ name: n.addon, version: n.version, remote: n.remote }, s?.default);
34
- } catch (s) {
35
- console.error(`[addon ${n.addon}] its manifest failed to load`, s);
33
+ ), r = e?.default;
34
+ if (!Array.isArray(r?.contributes))
35
+ throw new Error('the manifest has no "contributes" list: export default defineAddon({ contributes })');
36
+ we({ name: o.addon, version: o.version, remote: o.remote }, e?.default);
37
+ } catch (e) {
38
+ console.error(`[addon ${o.addon}] its manifest failed to load`, e), s[o.addon] = String(e);
36
39
  }
37
40
  })
38
- ), ce(!1);
39
- }, _t = ({ children: d, skip: n }) => {
41
+ ), de(!1), s;
42
+ }, $t = ({ children: c, skip: s }) => {
40
43
  const {
41
- data: s = [],
42
- isLoading: o,
43
- isFetching: i
44
- } = qe(void 0, {
45
- skip: n
44
+ data: o = [],
45
+ isLoading: e,
46
+ isFetching: r
47
+ } = Qe(void 0, {
48
+ skip: s
46
49
  }), {
47
- siteInfo: u,
50
+ siteInfo: d,
48
51
  user: m,
49
- isLoading: { siteInfo: w, user: S }
50
- } = de(), [y] = C(be), [a, c] = C(
51
- y ? { status: "loading", override: y } : { status: "off" }
52
+ isLoading: { siteInfo: P, user: b }
53
+ } = ue(), [y] = h(Ee), p = y && "override" in y ? y.override : void 0, [n, t] = h(
54
+ y ? "override" in y ? { status: "loading", override: y.override } : { status: "rejected", ...y } : { status: "off" }
52
55
  );
53
- U(() => {
54
- if (!(!y || S)) {
55
- if (!we(m)) {
56
- console.warn("[addon dev] ignored: only users in developer mode can load addons from a dev server"), c({ status: "off" });
57
- return;
58
- }
59
- Se(y).then(
60
- (p) => c({ status: "active", override: y, info: p }),
61
- (p) => c({ status: "error", override: y, error: String(p) })
62
- );
56
+ O(() => {
57
+ if (!p || b) return;
58
+ const v = Se(m);
59
+ if (v) {
60
+ console.warn(`[addon dev] ignored: ${v}`), t({
61
+ status: "rejected",
62
+ request: `${p.addon}@${p.url}`,
63
+ reason: v
64
+ });
65
+ return;
63
66
  }
64
- }, [y, S, m]);
65
- const e = A(() => {
66
- if (a.status !== "active") return s;
67
- const { override: p, info: v } = a;
67
+ Ce(p).then(
68
+ (u) => t({ status: "active", override: p, info: u }),
69
+ (u) => t({ status: "error", override: p, error: u.message })
70
+ );
71
+ }, [p, b, m]);
72
+ const a = q(() => {
73
+ if (n.status !== "active") return o;
74
+ const { override: v, info: u } = n;
68
75
  return [
69
- ...s.filter((g) => g.addonName !== p.addon),
76
+ ...o.filter((f) => f.addonName !== v.addon),
70
77
  {
71
- addonName: p.addon,
72
- addonVersion: `${v.version}+dev`,
73
- modules: { [v.remote]: v.modules }
78
+ addonName: v.addon,
79
+ addonVersion: `${u.version}+dev`,
80
+ modules: { [u.remote]: u.modules }
74
81
  }
75
82
  ];
76
- }, [s, a]), [l, P] = C(!1), I = le({});
77
- return U(() => {
78
- if (!l || i) return;
79
- const p = e.filter(({ addonName: t, addonVersion: h }) => {
80
- const b = I.current[t];
81
- return b !== void 0 && b !== h;
82
- }), v = "addon-versions-changed";
83
- if (!p.length) {
84
- M.dismiss(v);
83
+ }, [o, n]), [g, S] = h(!1), w = ce({});
84
+ return O(() => {
85
+ if (!g || r) return;
86
+ const v = a.filter(({ addonName: E, addonVersion: R }) => {
87
+ const D = w.current[E];
88
+ return D !== void 0 && D !== R;
89
+ }), u = "addon-versions-changed";
90
+ if (!v.length) {
91
+ I.dismiss(u);
85
92
  return;
86
93
  }
87
- const g = p.map((t) => `${t.addonName} ${t.addonVersion}`).join(", "), f = /* @__PURE__ */ T(Ee, { message: `Addons updated (${g}). Refresh to load them.` });
88
- M.isActive(v) ? M.update(v, { render: f }) : M.info(f, { toastId: v, autoClose: !1, closeOnClick: !1 });
89
- }, [e, i, l]), U(() => {
90
- if (o || w || l || a.status === "loading") return;
91
- if (!e.length) {
92
- P(!0), ce(!1);
94
+ const f = v.map((E) => `${E.addonName} ${E.addonVersion}`).join(", "), i = /* @__PURE__ */ k(Le, { message: `Addons updated (${f}). Refresh to load them.` });
95
+ I.isActive(u) ? I.update(u, { render: i }) : I.info(i, { toastId: u, autoClose: !1, closeOnClick: !1 });
96
+ }, [a, r, g]), O(() => {
97
+ if (e || P || g || n.status === "loading") return;
98
+ if (!a.length) {
99
+ S(!0), de(!1);
93
100
  return;
94
101
  }
95
- const p = [];
96
- e.forEach((g) => {
97
- const { addonName: f, addonVersion: t, modules: h = {} } = g;
98
- Object.entries(h).forEach(([b, E]) => {
99
- p.push({
100
- remote: b,
101
- addon: f,
102
- version: t,
103
- modules: E
102
+ const v = [];
103
+ a.forEach((f) => {
104
+ const { addonName: i, addonVersion: E, modules: R = {} } = f;
105
+ Object.entries(R).forEach(([D, $]) => {
106
+ v.push({
107
+ remote: D,
108
+ addon: i,
109
+ version: E,
110
+ modules: $
104
111
  });
105
112
  });
106
- }), I.current = Object.fromEntries(p.map((g) => [g.addon, g.version]));
107
- const v = a.status === "active" ? a : void 0;
108
- ve(
109
- p.map((g) => ({
110
- name: g.remote,
111
- alias: g.remote,
112
- entry: v && g.addon === v.override.addon ? `${v.override.url}/remoteEntry.js?build=${v.info.buildId}` : `/addons/${g.addon || g.remote}/${g.version}/frontend/modules/${g.remote}/remoteEntry.js?server=${u?.releaseInfo?.version || u?.releaseInfo}-${u?.releaseInfo?.buildDate}-${(/* @__PURE__ */ new Date()).getTime()}`,
113
+ }), w.current = Object.fromEntries(v.map((f) => [f.addon, f.version]));
114
+ const u = n.status === "active" ? n : void 0;
115
+ Pe(
116
+ v.map((f) => ({
117
+ name: f.remote,
118
+ alias: f.remote,
119
+ entry: u && f.addon === u.override.addon ? `${u.override.url}/remoteEntry.js?build=${u.info.buildId}` : `/addons/${f.addon || f.remote}/${f.version}/frontend/modules/${f.remote}/remoteEntry.js?server=${d?.releaseInfo?.version || d?.releaseInfo}-${d?.releaseInfo?.buildDate}-${(/* @__PURE__ */ new Date()).getTime()}`,
113
120
  type: "module"
114
121
  }))
115
- ), P(!0), pt(p);
116
- }, [e, o, w, l, a]), /* @__PURE__ */ ie(
117
- Ce.Provider,
122
+ ), S(!0), ut(v).then((f) => {
123
+ const i = u && f[u.override.addon];
124
+ i && t({ ...u, error: `its manifest failed to load (${i})` });
125
+ });
126
+ }, [a, e, P, g, n]), /* @__PURE__ */ le(
127
+ xe.Provider,
118
128
  {
119
129
  value: {
120
- isLoading: o,
121
- modules: e,
122
- remotesInitialized: l,
123
- addonDev: a
130
+ isLoading: e,
131
+ modules: a,
132
+ remotesInitialized: g,
133
+ addonDev: n
124
134
  },
125
135
  children: [
126
- d,
127
- a.status !== "off" && /* @__PURE__ */ T(Ie, { state: a })
136
+ c,
137
+ n.status !== "off" && /* @__PURE__ */ k(ke, { state: n })
128
138
  ]
129
139
  }
130
140
  );
131
- }, ft = {
141
+ }, pt = {
132
142
  planner: {
133
143
  label: "Planner",
134
144
  icon: "calendar_month",
@@ -173,736 +183,628 @@ const pt = async (d) => {
173
183
  "dataPortability"
174
184
  ]
175
185
  }
176
- }, Bt = ({
177
- children: d,
178
- defaultTab: n = "feed",
179
- hasLicense: s,
180
- debug: o = {},
181
- ...i
186
+ }, Nt = ({
187
+ children: c,
188
+ defaultTab: s = "feed",
189
+ hasLicense: o,
190
+ debug: e = {},
191
+ ...r
182
192
  }) => {
183
- const u = i.user, m = ot(u), w = "isGuest" in o ? o.isGuest : u?.data?.isGuest, { powerLicense: S, setPowerpackDialog: y } = Z(), a = "hasLicense" in o ? o.hasLicense : !!S || s, [c, e] = C({}), [l, P] = C([]), [I, p] = C([]), v = L(
184
- (k) => c[k] ? c[k] : !1,
185
- [c]
186
- ), g = L(
187
- (k, _) => {
188
- const R = { ...c };
189
- R[k] = _, e(R);
193
+ const d = r.user, m = ot(d), P = "isGuest" in e ? e.isGuest : d?.data?.isGuest, { powerLicense: b, setPowerpackDialog: y } = ee(), p = "hasLicense" in e ? e.hasLicense : !!b || o, [n, t] = h({}), [a, g] = h([]), [S, w] = h([]), v = C(
194
+ (x) => n[x] ? n[x] : !1,
195
+ [n]
196
+ ), u = C(
197
+ (x, A) => {
198
+ const V = { ...n };
199
+ V[x] = A, t(V);
190
200
  },
191
- [c]
192
- ), [f, t] = ke(Le, {}), h = L(
193
- (k) => {
194
- const _ = f[k];
195
- return xe(_) ? _ : n;
201
+ [n]
202
+ ), [f, i] = Ie(De, {}), E = C(
203
+ (x) => {
204
+ const A = f[x];
205
+ return Te(A) ? A : s;
196
206
  },
197
- [f, n]
198
- ), [b, E] = C(null), O = L((k) => {
199
- E(k);
200
- }, []), F = L(() => {
201
- E(null), b && $([]);
207
+ [f, s]
208
+ ), [R, D] = h(null), $ = C((x) => {
209
+ D(x);
210
+ }, []), N = C(() => {
211
+ D(null), R && F([]);
202
212
  }, []);
203
- U(() => {
204
- F();
205
- }, [i.useLocation().pathname]);
206
- const [r, x] = C(null), D = L((k) => {
207
- x(k);
208
- }, []), j = L(() => {
209
- x(null);
210
- }, []), [N, B] = C(null), [z, $] = C([]), { uriType: Y, uri: fe, entity: G, getUriEntities: me } = De(), [V] = i.useSearchParams(), W = V.get("project"), Q = V.get("type"), q = V.get("id"), J = V.get("activity");
211
- U(() => {
212
- if (!(!W && !Q && !q)) {
213
- if (Y === "entity" && G && G.entityType !== "product") {
214
- me().then((k) => {
215
- if (k.length === 0) return;
216
- const _ = k.find((he) => he.uri === fe), R = _?.entities?.[0];
217
- if (!_ || !R) return;
218
- const oe = R?.projectName || G.projectName || "", ne = R.representationId || R.versionId || R.productId || R.taskId || R.folderId;
219
- if (!oe || !ne) return;
220
- const ge = {
221
- entityType: G.entityType,
222
- entities: [
223
- {
224
- id: ne,
225
- projectName: oe
226
- }
227
- ],
228
- source: "uri"
229
- };
230
- B(ge);
231
- }).catch((k) => {
232
- console.warn("Failed to get URI entities:", k);
233
- });
234
- return;
235
- }
236
- W && Q && q && (B({
237
- entityType: Q,
238
- entities: [
239
- {
240
- id: q,
241
- projectName: W
242
- }
243
- ],
244
- source: "url"
245
- }), J && ($([J]), t({
246
- ...f,
247
- overview: "feed"
248
- })));
213
+ O(() => {
214
+ N();
215
+ }, [r.useLocation().pathname]);
216
+ const [l, L] = h(null), T = C((x) => {
217
+ L(x);
218
+ }, []), M = C(() => {
219
+ L(null);
220
+ }, []), [j, W] = h(null), [Y, F] = h([]), { uriType: K, uri: me, entity: H, getUriEntities: ge, setUri: ve } = je(), [Q] = r.useSearchParams(), _ = Q.get("project"), B = Q.get("type"), U = Q.get("id"), X = Q.get("activity");
221
+ O(() => {
222
+ if (!_ && !B && !U) return;
223
+ const x = !!j && !!_ && !!B && !!U && j.entities[0]?.id !== U;
224
+ if (x && ve(""), !x && K === "entity" && H && H.entityType !== "product") {
225
+ ge().then((A) => {
226
+ if (A.length === 0) return;
227
+ const V = A.find((he) => he.uri === me), G = V?.entities?.[0];
228
+ if (!V || !G) return;
229
+ const ne = G?.projectName || H.projectName || "", se = G.representationId || G.versionId || G.productId || G.taskId || G.folderId;
230
+ if (!ne || !se) return;
231
+ const ye = {
232
+ entityType: H.entityType,
233
+ entities: [
234
+ {
235
+ id: se,
236
+ projectName: ne
237
+ }
238
+ ],
239
+ source: "uri"
240
+ };
241
+ W(ye);
242
+ }).catch((A) => {
243
+ console.warn("Failed to get URI entities:", A);
244
+ });
245
+ return;
249
246
  }
250
- }, [W, Q, q]);
251
- const H = {
247
+ _ && B && U && W({
248
+ entityType: B,
249
+ entities: [
250
+ {
251
+ id: U,
252
+ projectName: _
253
+ }
254
+ ],
255
+ source: "url"
256
+ });
257
+ }, [_, B, U]), O(() => {
258
+ !_ || !B || !U || !X || (F([X]), i({
259
+ ...f,
260
+ overview: "feed"
261
+ }));
262
+ }, [_, B, U, X]);
263
+ const z = {
252
264
  // open state for the panel by scope
253
- panelOpenByScope: c,
265
+ panelOpenByScope: n,
254
266
  getOpenForScope: v,
255
- setPanelOpen: g,
256
- setPanelOpenByScope: e,
267
+ setPanelOpen: u,
268
+ setPanelOpenByScope: t,
257
269
  // tab preferences
258
270
  tabsByScope: f,
259
- getTabForScope: h,
271
+ getTabForScope: E,
260
272
  // slide out state
261
- slideOut: b,
262
- openSlideOut: O,
263
- closeSlideOut: F,
273
+ slideOut: R,
274
+ openSlideOut: $,
275
+ closeSlideOut: N,
264
276
  // highlighted activities
265
- highlightedActivities: z,
266
- setHighlightedActivities: $,
277
+ highlightedActivities: Y,
278
+ setHighlightedActivities: F,
267
279
  // PiP state
268
- pip: r,
269
- openPip: D,
270
- closePip: j,
280
+ pip: l,
281
+ openPip: T,
282
+ closePip: M,
271
283
  // entities state
272
- entities: N,
273
- setEntities: B,
274
- feedAnnotations: l,
275
- setFeedAnnotations: P,
276
- feedFrameLinks: I,
277
- setFeedFrameLinks: p,
284
+ entities: j,
285
+ setEntities: W,
286
+ feedAnnotations: a,
287
+ setFeedAnnotations: g,
288
+ feedFrameLinks: S,
289
+ setFeedFrameLinks: w,
278
290
  bundleMode: m,
279
- isGuest: w,
280
- hasLicense: a,
291
+ isGuest: P,
292
+ hasLicense: p,
281
293
  onPowerFeature: y,
282
- ...i
283
- }, K = le(H), ee = K.current, te = Object.keys(H);
284
- return (te.length !== Object.keys(ee).length || te.some((k) => ee[k] !== H[k])) && (K.current = H), /* @__PURE__ */ T(Te.Provider, { value: K.current, children: d });
285
- }, mt = (d) => {
286
- const { setPowerpackDialog: n } = Z();
287
- return U(() => {
288
- n({ addon: "planner", feature: "subtasks" }), d?.onNotFound?.();
289
- }, [n, d.onNotFound]), null;
290
- }, Gt = ({ children: d }) => {
291
- const [n, { outdated: s, isLoading: o }] = ue({
294
+ ...r
295
+ }, Z = ce(z), te = Z.current, oe = Object.keys(z);
296
+ return (oe.length !== Object.keys(te).length || oe.some((x) => te[x] !== z[x])) && (Z.current = z), /* @__PURE__ */ k(Ae.Provider, { value: Z.current, children: c });
297
+ }, ft = (c) => {
298
+ const { setPowerpackDialog: s } = ee();
299
+ return O(() => {
300
+ s({ addon: "planner", feature: "subtasks" }), c?.onNotFound?.();
301
+ }, [s, c.onNotFound]), null;
302
+ }, _t = ({ children: c }) => {
303
+ const [s, { outdated: o, isLoading: e }] = pe({
292
304
  addon: "planner",
293
305
  remote: "planner",
294
306
  module: "SubtasksManager",
295
- fallback: mt
307
+ fallback: ft
296
308
  });
297
- return /* @__PURE__ */ T(
298
- Ae.Provider,
309
+ return /* @__PURE__ */ k(
310
+ Oe.Provider,
299
311
  {
300
312
  value: {
301
- SubtasksManager: o ? void 0 : n,
302
- requiredVersion: s?.required,
303
- isLoading: o
313
+ SubtasksManager: e ? void 0 : s,
314
+ requiredVersion: o?.required,
315
+ isLoading: e
304
316
  },
305
- children: d
317
+ children: c
306
318
  }
307
319
  );
308
- }, Vt = ({ children: d }) => {
309
- const [n, s] = C(!1), [o, i] = C(null), [u, m] = C(null), w = () => {
310
- s(!0), i(null);
311
- }, S = () => {
312
- s(!1), i(null);
313
- }, y = (e, l = null) => {
314
- s((P) => !P), e && !n ? (i(e), m(l)) : (i(null), m(null));
315
- }, a = (e, l = null) => {
316
- i(e), m(l);
317
- }, c = () => {
318
- i(null), m(null);
320
+ }, Bt = ({ children: c }) => {
321
+ const [s, o] = h(!1), [e, r] = h(null), [d, m] = h(null), P = () => {
322
+ o(!0), r(null);
323
+ }, b = () => {
324
+ o(!1), r(null);
325
+ }, y = (t, a = null) => {
326
+ o((g) => !g), t && !s ? (r(t), m(a)) : (r(null), m(null));
327
+ }, p = (t, a = null) => {
328
+ r(t), m(a);
329
+ }, n = () => {
330
+ r(null), m(null);
319
331
  };
320
- return /* @__PURE__ */ T(
321
- Fe.Provider,
332
+ return /* @__PURE__ */ k(
333
+ Re.Provider,
322
334
  {
323
335
  value: {
324
- isPanelOpen: n,
325
- selectedSetting: o,
326
- highlightedSetting: u,
336
+ isPanelOpen: s,
337
+ selectedSetting: e,
338
+ highlightedSetting: d,
327
339
  setHighlightedSetting: m,
328
- openPanel: w,
329
- closePanel: S,
340
+ openPanel: P,
341
+ closePanel: b,
330
342
  togglePanel: y,
331
- selectSetting: a,
332
- backToMainMenu: c
343
+ selectSetting: p,
344
+ backToMainMenu: n
333
345
  },
334
- children: d
346
+ children: c
335
347
  }
336
348
  );
337
349
  };
338
- function Wt({ children: d }) {
339
- const n = window.location.protocol === "https:" || window.location.hostname === "localhost", s = "documentPictureInPicture" in window && n, [o, i] = C(null), [u, m] = C(null), w = L(() => {
340
- m(null), o != null && (o.close(), i(null));
341
- }, [o, u]), S = L(
342
- async (a, c) => {
343
- if (!s) {
344
- m(X());
350
+ function Gt({ children: c }) {
351
+ const s = window.location.protocol === "https:" || window.location.hostname === "localhost", o = "documentPictureInPicture" in window && s, [e, r] = h(null), [d, m] = h(null), P = C(() => {
352
+ m(null), e != null && (e.close(), r(null));
353
+ }, [e, d]), b = C(
354
+ async (p, n) => {
355
+ if (!o) {
356
+ m(J());
345
357
  return;
346
358
  }
347
- if (o != null) {
348
- console.log("pipWindow is already open"), m(X());
359
+ if (e != null) {
360
+ console.log("pipWindow is already open"), m(J());
349
361
  return;
350
362
  }
351
- const e = await window.documentPictureInPicture.requestWindow({
352
- width: a,
353
- height: c
363
+ const t = await window.documentPictureInPicture.requestWindow({
364
+ width: p,
365
+ height: n
354
366
  });
355
- e.addEventListener("pagehide", () => {
356
- i(null), m(null);
357
- }), i(e), m(X());
367
+ t.addEventListener("pagehide", () => {
368
+ r(null), m(null);
369
+ }), r(t), m(J());
358
370
  },
359
- [o, u]
371
+ [e, d]
360
372
  );
361
- U(() => {
362
- [...document.styleSheets].forEach((a) => {
373
+ O(() => {
374
+ [...document.styleSheets].forEach((p) => {
363
375
  try {
364
- const c = [...a.cssRules].map((P) => P.cssText).join(""), e = document.createElement("style");
365
- e.textContent = c, o?.document.head.appendChild(e);
366
- const l = document.createElement("style");
367
- l.textContent = `
376
+ const n = [...p.cssRules].map((g) => g.cssText).join(""), t = document.createElement("style");
377
+ t.textContent = n, e?.document.head.appendChild(t);
378
+ const a = document.createElement("style");
379
+ a.textContent = `
368
380
  html, body, .pipRoot {
369
381
  height: 100%;
370
382
  margin: 0;
371
383
  padding: 0;
372
384
  overflow: hidden;
373
- }`, o?.document.head.appendChild(l);
385
+ }`, e?.document.head.appendChild(a);
374
386
  } catch {
375
- const e = document.createElement("link");
376
- if (a.href == null)
387
+ const t = document.createElement("link");
388
+ if (p.href == null)
377
389
  return;
378
- e.rel = "stylesheet", e.type = a.type, e.media = a.media.toString(), e.href = a.href, o?.document.head.appendChild(e);
390
+ t.rel = "stylesheet", t.type = p.type, t.media = p.media.toString(), t.href = p.href, e?.document.head.appendChild(t);
379
391
  }
380
392
  });
381
- }, [o]);
382
- const y = A(() => ({
383
- isSupported: s,
384
- pipWindow: o,
385
- pipId: u,
386
- requestPipWindow: S,
387
- closePipWindow: w
388
- }), [w, s, o, S]);
389
- return /* @__PURE__ */ T(Oe.Provider, { value: y, children: d });
393
+ }, [e]);
394
+ const y = q(() => ({
395
+ isSupported: o,
396
+ pipWindow: e,
397
+ pipId: d,
398
+ requestPipWindow: b,
399
+ closePipWindow: P
400
+ }), [P, o, e, b]);
401
+ return /* @__PURE__ */ k(Me.Provider, { value: y, children: c });
390
402
  }
391
- const Qt = ({
392
- children: d,
393
- projectName: n,
403
+ const qt = ({
404
+ children: c,
405
+ projectName: s,
394
406
  // utils
395
- toast: s,
396
- ...o
407
+ toast: o,
408
+ ...e
397
409
  }) => {
398
- const { data: i } = He(
399
- { projectName: n },
400
- { skip: !n }
401
- ), { user: u } = de();
402
- return /* @__PURE__ */ T(
403
- je.Provider,
410
+ const { data: r } = ze(
411
+ { projectName: s },
412
+ { skip: !s }
413
+ ), { user: d } = ue();
414
+ return /* @__PURE__ */ k(
415
+ Fe.Provider,
404
416
  {
405
417
  value: {
406
- ...o,
407
- projectName: n,
408
- project: i,
409
- user: u,
410
- toast: s
418
+ ...e,
419
+ projectName: s,
420
+ project: r,
421
+ user: d,
422
+ toast: o
411
423
  },
412
- children: d
424
+ children: c
413
425
  }
414
426
  );
415
- }, qt = ({ children: d, ...n }) => /* @__PURE__ */ T(Me.Provider, { value: { ...n }, children: d }), pe = "powerpack-license", gt = () => {
427
+ }, Vt = ({ children: c, ...s }) => /* @__PURE__ */ k(Ue.Provider, { value: { ...s }, children: c }), fe = "powerpack-license", mt = () => {
416
428
  try {
417
- const d = localStorage.getItem(pe);
418
- return d === null ? null : d === "true";
429
+ const c = localStorage.getItem(fe);
430
+ return c === null ? null : c === "true";
419
431
  } catch {
420
432
  return null;
421
433
  }
422
- }, ht = (d) => {
434
+ }, gt = (c) => {
423
435
  try {
424
- localStorage.setItem(pe, String(d));
436
+ localStorage.setItem(fe, String(c));
425
437
  } catch {
426
438
  }
427
- }, Ht = ({
428
- children: d,
429
- debug: n
439
+ }, Wt = ({
440
+ children: c,
441
+ debug: s
430
442
  }) => {
431
- const [s, o] = C(null), [i, u] = C(null), m = (t) => t !== null && typeof t == "object" && "addon" in t, w = L((t) => {
432
- t === null ? (o(null), u(null)) : m(t) ? (o(null), u(t)) : (u(null), o(t));
433
- }, []), S = (t) => t ? at[t] : null, y = (t) => {
434
- if (!t) return null;
435
- const h = ft[t.addon];
436
- return h ? { ...h, selectedFeature: t.feature } : null;
437
- }, [a, c] = C(!1), [e] = C(gt), [l, P] = C(!0), I = async () => !1, [p, { isLoaded: v, isLoading: g }] = ue({
443
+ const [o, e] = h(null), [r, d] = h(null), m = (i) => i !== null && typeof i == "object" && "addon" in i, P = C((i) => {
444
+ i === null ? (e(null), d(null)) : m(i) ? (e(null), d(i)) : (d(null), e(i));
445
+ }, []), b = (i) => i ? at[i] : null, y = (i) => {
446
+ if (!i) return null;
447
+ const E = pt[i.addon];
448
+ return E ? { ...E, selectedFeature: i.feature } : null;
449
+ }, [p, n] = h(!1), [t] = h(mt), [a, g] = h(!0), S = async () => !1, [w, { isLoaded: v, isLoading: u }] = pe({
438
450
  addon: "powerpack",
439
451
  remote: "license",
440
452
  module: "checkPowerLicense",
441
- fallback: I
453
+ fallback: S
442
454
  });
443
- U(() => {
455
+ O(() => {
444
456
  (async () => {
445
- if (n?.powerLicense !== void 0)
446
- console.warn("Using debug power license:", n.powerLicense), c(n.powerLicense), P(!1);
447
- else if (v || !g) {
457
+ if (s?.powerLicense !== void 0)
458
+ console.warn("Using debug power license:", s.powerLicense), n(s.powerLicense), g(!1);
459
+ else if (v || !u) {
448
460
  try {
449
- const h = await p();
450
- c(h), ht(h);
451
- } catch (h) {
452
- console.error("Error checking power license:", h), c(!1);
461
+ const E = await w();
462
+ n(E), gt(E);
463
+ } catch (E) {
464
+ console.error("Error checking power license:", E), n(!1);
453
465
  } finally {
454
- P(!1);
466
+ g(!1);
455
467
  }
456
- P(!1);
468
+ g(!1);
457
469
  }
458
470
  })();
459
- }, [n, v, g, p]);
460
- const f = A(
471
+ }, [s, v, u, w]);
472
+ const f = q(
461
473
  () => ({
462
- powerLicense: a,
463
- isLoading: l,
464
- storedLicense: e,
465
- selectedPowerPack: s,
466
- selectedAddon: i,
467
- setPowerpackDialog: w,
468
- powerpackDialog: S(s),
469
- addonDialog: y(i)
474
+ powerLicense: p,
475
+ isLoading: a,
476
+ storedLicense: t,
477
+ selectedPowerPack: o,
478
+ selectedAddon: r,
479
+ setPowerpackDialog: P,
480
+ powerpackDialog: b(o),
481
+ addonDialog: y(r)
470
482
  }),
471
- [a, s, i, w, l, e]
483
+ [p, o, r, P, a, t]
472
484
  );
473
- return /* @__PURE__ */ T(Re.Provider, { value: f, children: d });
474
- }, zt = ({ children: d, skip: n = !1 }) => {
485
+ return /* @__PURE__ */ k($e.Provider, { value: f, children: c });
486
+ }, Ht = ({ children: c, skip: s = !1 }) => {
475
487
  const {
476
- data: s = {},
477
- isLoading: o,
478
- error: i
479
- } = ze({ full: !0 }, { skip: n }), { data: u, isLoading: m, error: w } = Ye(), {
480
- data: S = [],
488
+ data: o = {},
489
+ isLoading: e,
490
+ error: r
491
+ } = Ye({ full: !0 }, { skip: s }), { data: d, isLoading: m, error: P } = Ke(), {
492
+ data: b = [],
481
493
  isLoading: y,
482
- error: a
483
- } = Ke({}, { skip: n }), c = A(() => S.filter((I) => I.active), [S]), {
484
- data: e,
485
- isLoading: l,
486
- error: P
487
- } = Xe(void 0, { skip: !u?.name });
488
- return /* @__PURE__ */ T(
489
- Ue.Provider,
494
+ error: p
495
+ } = Xe({}, { skip: s }), n = q(() => b.filter((S) => S.active), [b]), {
496
+ data: t,
497
+ isLoading: a,
498
+ error: g
499
+ } = Ze(void 0, { skip: !d?.name });
500
+ return /* @__PURE__ */ k(
501
+ Ne.Provider,
490
502
  {
491
503
  value: {
492
- siteInfo: s,
493
- attributes: s?.attributes || [],
494
- user: u,
495
- cloudInfo: e,
504
+ siteInfo: o,
505
+ attributes: o?.attributes || [],
506
+ user: d,
507
+ cloudInfo: t,
496
508
  projects: {
497
- all: S,
498
- active: c
509
+ all: b,
510
+ active: n
499
511
  },
500
512
  isLoading: {
501
- siteInfo: o,
513
+ siteInfo: e,
502
514
  user: m,
503
- cloudInfo: l,
515
+ cloudInfo: a,
504
516
  projects: y
505
517
  },
506
518
  error: {
507
- siteInfo: i,
508
- user: w,
509
- cloudInfo: P,
510
- projects: a
519
+ siteInfo: r,
520
+ user: P,
521
+ cloudInfo: g,
522
+ projects: p
511
523
  }
512
524
  },
513
- children: d
525
+ children: c
514
526
  }
515
527
  );
516
- }, Yt = ({
517
- projectName: d,
518
- children: n
519
- }) => {
520
- const {
521
- data: { folders: s = [] } = {},
522
- isLoading: o,
523
- isFetching: i,
524
- isSuccess: u,
525
- isUninitialized: m,
526
- error: w,
527
- refetch: S
528
- } = Ze({ projectName: d, attrib: !0 }), y = dt({ projectName: d }, i || o), a = A(() => {
529
- const f = /* @__PURE__ */ new Map();
530
- for (const t of s)
531
- f.set(t.id, t);
532
- return f;
533
- }, [s]), c = A(() => (f) => a.get(f), [a]), e = A(
534
- () => (f, t, h = {}) => {
535
- if (!t.length) return {};
536
- const b = {}, E = new Set(t), O = /* @__PURE__ */ new Set();
537
- let F = f;
538
- for (; E.size > 0 && F && !O.has(F); ) {
539
- O.add(F);
540
- const r = a.get(F);
541
- if (!r) break;
542
- const x = r.attrib || {};
543
- for (const D of Array.from(E))
544
- r.ownAttrib?.includes(D) && D in x && (b[D] = Object.entries(x).find(
545
- ([j]) => j === D
546
- )?.[1], E.delete(D));
547
- F = r.parentId;
548
- }
549
- for (const r of Array.from(E))
550
- r in h && (b[r] = h[r], E.delete(r));
551
- for (const r of E)
552
- b[r] = null;
553
- return b;
554
- },
555
- [a]
556
- ), l = A(
557
- () => (f) => {
558
- const t = [], h = /* @__PURE__ */ new Set();
559
- let b = f;
560
- for (; b && !h.has(b); ) {
561
- h.add(b);
562
- const E = a.get(b);
563
- if (!E?.parentId) break;
564
- t.push(E.parentId), b = E.parentId;
565
- }
566
- return t;
567
- },
568
- [a]
569
- ), P = A(
570
- () => (f) => {
571
- const t = new Set(f);
572
- return f.filter((h) => !l(h).some((b) => t.has(b)));
573
- },
574
- [l]
575
- ), I = A(() => {
576
- const f = /* @__PURE__ */ new Map();
577
- for (const t of s) {
578
- if (!t.parentId) continue;
579
- const h = f.get(t.parentId);
580
- h ? h.push(t.id) : f.set(t.parentId, [t.id]);
581
- }
582
- return f;
583
- }, [s]), p = A(
584
- () => (f, t = !1) => {
585
- const h = t ? [...f] : [], b = [...f];
586
- for (; b.length > 0; ) {
587
- const E = b.shift();
588
- for (const O of I.get(E) || [])
589
- h.push(O), b.push(O);
590
- }
591
- return h;
592
- },
593
- [I]
594
- ), v = () => S().unwrap(), g = A(
595
- () => ({
596
- folders: s,
597
- getFolderById: c,
598
- findNonInheritedValues: e,
599
- getParentFolderIds: l,
600
- getFolderIdsWithoutChildren: P,
601
- getChildFolderIds: p,
602
- isLoading: y,
603
- // first time and when args change
604
- isFetching: i,
605
- // any background fetching
606
- isSuccess: u,
607
- isUninitialized: m,
608
- error: w,
609
- refetch: v
610
- }),
611
- [
612
- s,
613
- c,
614
- e,
615
- l,
616
- P,
617
- p,
618
- y,
619
- i,
620
- u,
621
- m,
622
- w,
623
- v
624
- ]
625
- );
626
- return /* @__PURE__ */ T(Ne.Provider, { value: g, children: n });
627
- }, Kt = ({ children: d }) => {
628
- const n = location.pathname, [s, o] = C(nt), i = ["projects", "settings", "manageProjects", "dashboard/tasks"];
629
- U(() => {
630
- i.some((l) => n.startsWith(`/${l}`)) || o("");
631
- }, [n, o]);
632
- const { type: u, entity: m, settings: w } = st(s), S = L(
633
- ({ projectName: e, folderPath: l, taskName: P, productName: I, versionName: p }) => {
634
- const v = rt({ projectName: e, folderPath: l, taskName: P, productName: I, versionName: p });
635
- o(v);
528
+ }, Qt = ({ children: c }) => {
529
+ const s = location.pathname, [o, e] = h(nt), r = ["projects", "settings", "manageProjects", "dashboard/tasks"];
530
+ O(() => {
531
+ r.some((a) => s.startsWith(`/${a}`)) || e("");
532
+ }, [s, e]);
533
+ const { type: d, entity: m, settings: P } = st(o), b = C(
534
+ ({ projectName: t, folderPath: a, taskName: g, productName: S, versionName: w }) => {
535
+ const v = rt({ projectName: t, folderPath: a, taskName: g, productName: S, versionName: w });
536
+ e(v);
636
537
  },
637
- [o]
638
- ), [y] = Je(), a = L(async () => {
639
- if (u !== "entity" || !s) return [];
538
+ [e]
539
+ ), [y] = Je(), p = C(async () => {
540
+ if (d !== "entity" || !o) return [];
640
541
  try {
641
- const e = await y({ resolveRequestModel: { uris: [s] } }).unwrap();
642
- return console.log("Resolved entity from URI:", e), e;
643
- } catch (e) {
644
- return console.warn("Failed to resolve URI:", e), [];
542
+ const t = await y({ resolveRequestModel: { uris: [o] } }).unwrap();
543
+ return console.log("Resolved entity from URI:", t), t;
544
+ } catch (t) {
545
+ return console.warn("Failed to resolve URI:", t), [];
645
546
  }
646
- }, [y, s, u]), c = {
647
- uri: s,
648
- uriType: u,
547
+ }, [y, o, d]), n = {
548
+ uri: o,
549
+ uriType: d,
649
550
  entity: m,
650
- settings: w,
651
- setUri: o,
652
- setEntityUri: S,
653
- getUriEntities: a
551
+ settings: P,
552
+ setUri: e,
553
+ setEntityUri: b,
554
+ getUriEntities: p
654
555
  };
655
- return /* @__PURE__ */ T($e.Provider, { value: c, children: d });
656
- }, ae = [
556
+ return /* @__PURE__ */ k(_e.Provider, { value: n, children: c });
557
+ }, ie = [
657
558
  "representation",
658
559
  "version",
659
560
  "workfile",
660
561
  "product",
661
562
  "task",
662
563
  "folder"
663
- ], vt = "delete-folder-with-children", Xt = ({ children: d }) => {
664
- const [n] = et(), [s] = tt(), [o, i] = C(null), [u, m] = C(null), w = L(
665
- (c) => new Promise((e) => m({ payload: c, resolve: e })),
564
+ ], vt = "delete-folder-with-children", zt = ({ children: c }) => {
565
+ const [s] = et(), [o] = tt(), [e, r] = h(null), [d, m] = h(null), P = C(
566
+ (n) => new Promise((t) => m({ payload: n, resolve: t })),
666
567
  []
667
- ), S = L(
668
- async (c, e) => {
669
- if (!c || c.length === 0) {
670
- M.error("No entities selected");
568
+ ), b = C(
569
+ async (n, t) => {
570
+ if (!n || n.length === 0) {
571
+ I.error("No entities selected");
671
572
  return;
672
573
  }
673
- const l = /* @__PURE__ */ new Set(), P = c.filter((r) => !r?.id || l.has(r.id) ? !1 : (l.add(r.id), !0));
674
- if (P.length === 0) {
675
- M.error("No entities found");
574
+ const a = /* @__PURE__ */ new Set(), g = n.filter((l) => !l?.id || a.has(l.id) ? !1 : (a.add(l.id), !0));
575
+ if (g.length === 0) {
576
+ I.error("No entities found");
676
577
  return;
677
578
  }
678
- const I = new Set(P.map((r) => r.id)), p = P.filter((r) => r.entityType === "folder" && r.parentId ? !I.has(r.parentId) : (r.entityType === "task" || r.entityType === "product") && r.folderId ? !I.has(r.folderId) : !0), v = async (r, x) => {
679
- if (r.length === 0) return;
680
- const D = /* @__PURE__ */ new Map();
681
- for (const j of r) {
682
- const N = D.get(j.projectName) || [];
683
- N.push(j), D.set(j.projectName, N);
579
+ const S = new Set(g.map((l) => l.id)), w = g.filter((l) => l.entityType === "folder" && l.parentId ? !S.has(l.parentId) : (l.entityType === "task" || l.entityType === "product") && l.folderId ? !S.has(l.folderId) : !0), v = async (l, L) => {
580
+ if (l.length === 0) return;
581
+ const T = /* @__PURE__ */ new Map();
582
+ for (const M of l) {
583
+ const j = T.get(M.projectName) || [];
584
+ j.push(M), T.set(M.projectName, j);
684
585
  }
685
586
  await Promise.all(
686
- Array.from(D.entries()).map(([j, N]) => {
687
- const z = [...N].sort(
688
- ($, Y) => ae.indexOf($.entityType) - ae.indexOf(Y.entityType)
689
- ).map(($) => ({
587
+ Array.from(T.entries()).map(([M, j]) => {
588
+ const Y = [...j].sort(
589
+ (F, K) => ie.indexOf(F.entityType) - ie.indexOf(K.entityType)
590
+ ).map((F) => ({
690
591
  type: "delete",
691
- entityType: $.entityType,
692
- entityId: $.id,
693
- force: x
592
+ entityType: F.entityType,
593
+ entityId: F.id,
594
+ force: L
694
595
  }));
695
- return n({
696
- operationsRequestModel: { operations: z },
697
- projectName: j
596
+ return s({
597
+ operationsRequestModel: { operations: Y },
598
+ projectName: M
698
599
  }).unwrap();
699
600
  })
700
601
  );
701
- }, g = async () => {
602
+ }, u = async () => {
702
603
  try {
703
- await v(p, !1), e?.onSuccess?.();
704
- } catch (r) {
705
- throw { message: Qe(r) || "Failed to delete entities", ...r };
604
+ await v(w, !1), t?.onSuccess?.();
605
+ } catch (l) {
606
+ throw { message: He(l) || "Failed to delete entities", ...l };
706
607
  }
707
608
  }, f = () => v(
708
- p.filter((r) => r.entityType === "folder" || r.entityType === "task"),
609
+ w.filter((l) => l.entityType === "folder" || l.entityType === "task"),
709
610
  !0
710
- ), t = p.filter((r) => r.entityType === "folder");
711
- let h = [];
712
- if (t.length > 0) {
713
- const r = /* @__PURE__ */ new Map();
714
- for (const x of t) {
715
- const D = r.get(x.projectName) || [];
716
- D.push(x), r.set(x.projectName, D);
611
+ ), i = w.filter((l) => l.entityType === "folder");
612
+ let E = [];
613
+ if (i.length > 0) {
614
+ const l = /* @__PURE__ */ new Map();
615
+ for (const L of i) {
616
+ const T = l.get(L.projectName) || [];
617
+ T.push(L), l.set(L.projectName, T);
717
618
  }
718
619
  try {
719
- h = (await Promise.all(
720
- Array.from(r.entries()).map(
721
- ([D, j]) => s({
722
- projectName: D,
723
- folderIds: j.map((N) => N.id)
620
+ E = (await Promise.all(
621
+ Array.from(l.entries()).map(
622
+ ([T, M]) => o({
623
+ projectName: T,
624
+ folderIds: M.map((j) => j.id)
724
625
  }).unwrap()
725
626
  )
726
627
  )).flat();
727
- } catch (x) {
728
- console.warn("Failed to fetch folder delete info, falling back to local data", x);
628
+ } catch (L) {
629
+ console.warn("Failed to fetch folder delete info, falling back to local data", L);
729
630
  }
730
631
  }
731
- const b = it(t, h), E = p.filter((r) => r.entityType === "product").length;
732
- E > 0 && b.push(
733
- E > 1 ? "Deleting these products also deletes all their versions" : "Deleting this product also deletes all its versions"
632
+ const R = it(i, E), D = w.filter((l) => l.entityType === "product").length;
633
+ D > 0 && R.push(
634
+ D > 1 ? "Deleting these products also deletes all their versions" : "Deleting this product also deletes all its versions"
734
635
  );
735
- const O = lt(p), F = p.length === 1 ? p[0] : void 0;
736
- i({
636
+ const $ = lt(w), N = w.length === 1 ? w[0] : void 0;
637
+ r({
737
638
  payload: {
738
- entityLabel: O,
739
- childrenDetails: b,
740
- expectedCounts: ct(p, h),
741
- expectedName: F && (F.label || F.name || F.id)
639
+ entityLabel: $,
640
+ childrenDetails: R,
641
+ expectedCounts: ct(w, E),
642
+ expectedName: N && (N.label || N.name || N.id)
742
643
  },
743
- accept: g,
744
- recover: async (r) => We(r).includes(vt) ? await w({
745
- entityLabel: O,
746
- message: `Are you really sure you want to delete ${O} and all of its dependencies? This cannot be undone. (NOT RECOMMENDED)`,
644
+ accept: u,
645
+ recover: async (l) => We(l).includes(vt) ? await P({
646
+ entityLabel: $,
647
+ message: `Are you really sure you want to delete ${$} and all of its dependencies? This cannot be undone. (NOT RECOMMENDED)`,
747
648
  childrenDetails: [],
748
649
  expectedCounts: {},
749
650
  expectedName: "force delete",
750
651
  deleteLabel: "Force delete"
751
- }) ? (await f(), e?.onSuccess?.(), "recovered") : "cancelled" : "unhandled"
652
+ }) ? (await f(), t?.onSuccess?.(), "recovered") : "cancelled" : "unhandled"
752
653
  });
753
654
  },
754
- [n, s, w]
755
- ), y = L(async () => {
756
- if (!o) return;
757
- const { payload: c, accept: e, recover: l } = o;
758
- i(null);
759
- const P = c.entityLabel, I = M.loading(`Deleting ${P}...`, { autoClose: !1 }), p = () => M.update(I, {
760
- render: `${P} deleted`,
655
+ [s, o, P]
656
+ ), y = C(async () => {
657
+ if (!e) return;
658
+ const { payload: n, accept: t, recover: a } = e;
659
+ r(null);
660
+ const g = n.entityLabel, S = I.loading(`Deleting ${g}...`, { autoClose: !1 }), w = () => I.update(S, {
661
+ render: `${g} deleted`,
761
662
  type: "success",
762
663
  autoClose: 5e3,
763
664
  isLoading: !1
764
665
  });
765
666
  try {
766
- await e(), p();
667
+ await t(), w();
767
668
  } catch (v) {
768
- let g = v;
669
+ let u = v;
769
670
  try {
770
- const t = await l(v);
771
- if (t === "recovered") return p();
772
- if (t === "cancelled")
773
- return M.update(I, {
774
- render: `${P} was not deleted`,
671
+ const i = await a(v);
672
+ if (i === "recovered") return w();
673
+ if (i === "cancelled")
674
+ return I.update(S, {
675
+ render: `${g} was not deleted`,
775
676
  type: "info",
776
677
  autoClose: 5e3,
777
678
  isLoading: !1
778
679
  });
779
- } catch (t) {
780
- g = t;
680
+ } catch (i) {
681
+ u = i;
781
682
  }
782
- const f = typeof g == "string" ? g : g?.message || g?.error || `Error deleting ${P}`;
783
- M.update(I, {
683
+ const f = typeof u == "string" ? u : u?.message || u?.error || `Error deleting ${g}`;
684
+ I.update(S, {
784
685
  render: f,
785
686
  type: "error",
786
687
  autoClose: 5e3,
787
688
  isLoading: !1
788
689
  });
789
690
  }
790
- }, [o]), a = A(() => ({ deleteEntities: S }), [S]);
791
- return /* @__PURE__ */ ie(_e.Provider, { value: a, children: [
792
- d,
793
- o && /* @__PURE__ */ T(
794
- re,
691
+ }, [e]), p = q(() => ({ deleteEntities: b }), [b]);
692
+ return /* @__PURE__ */ le(Be.Provider, { value: p, children: [
693
+ c,
694
+ e && /* @__PURE__ */ k(
695
+ ae,
795
696
  {
796
- payload: o.payload,
697
+ payload: e.payload,
797
698
  onConfirm: y,
798
- onCancel: () => i(null)
699
+ onCancel: () => r(null)
799
700
  }
800
701
  ),
801
- u && /* @__PURE__ */ T(
802
- re,
702
+ d && /* @__PURE__ */ k(
703
+ ae,
803
704
  {
804
- payload: u.payload,
705
+ payload: d.payload,
805
706
  onConfirm: () => {
806
- m(null), u.resolve(!0);
707
+ m(null), d.resolve(!0);
807
708
  },
808
709
  onCancel: () => {
809
- m(null), u.resolve(!1);
710
+ m(null), d.resolve(!1);
810
711
  }
811
712
  }
812
713
  )
813
714
  ] });
814
- }, yt = "powerpack", Pt = "tableExport", bt = "TableExportApp", wt = "1.6.9", Zt = ({ children: d }) => {
815
- const [n, s] = C(null), [, o] = ut(), { powerLicense: i, setPowerpackDialog: u } = Z(), { modules: m } = Be(), w = m.some(
816
- (e) => e.addonName === yt && e.modules[Pt]?.includes(bt)
817
- ), S = !!i && w, y = L((e) => (s(e), () => s((l) => l === e ? null : l)), []), a = L(
818
- (e) => {
819
- if (!i) return u("tableExport");
820
- if (!w)
821
- return void M.error("Update to Power Pack " + wt + " to export tables");
822
- o((l) => (l.set(Ge, e), l));
715
+ }, yt = "powerpack", ht = "tableExport", Pt = "TableExportApp", bt = "1.6.9", Yt = ({ children: c }) => {
716
+ const [s, o] = h(null), [, e] = dt(), { powerLicense: r, setPowerpackDialog: d } = ee(), { modules: m } = Ge(), P = m.some(
717
+ (t) => t.addonName === yt && t.modules[ht]?.includes(Pt)
718
+ ), b = !!r && P, y = C((t) => (o(t), () => o((a) => a === t ? null : a)), []), p = C(
719
+ (t) => {
720
+ if (!r) return d("tableExport");
721
+ if (!P)
722
+ return void I.error("Update to Power Pack " + bt + " to export tables");
723
+ e((a) => (a.set(qe, t), a));
823
724
  },
824
- [i, w, u, o]
825
- ), c = A(
826
- () => ({ source: n, isAvailable: S, openExport: a, registerSource: y }),
827
- [n, S, a, y]
725
+ [r, P, d, e]
726
+ ), n = q(
727
+ () => ({ source: s, isAvailable: b, openExport: p, registerSource: y }),
728
+ [s, b, p, y]
828
729
  );
829
- return /* @__PURE__ */ T(Ve.Provider, { value: c, children: d });
730
+ return /* @__PURE__ */ k(Ve.Provider, { value: n, children: c });
830
731
  };
831
732
  export {
832
- Me as AddonContext,
833
- je as AddonProjectContext,
834
- Qt as AddonProjectProvider,
835
- qt as AddonProvider,
836
- _e as DeleteEntitiesContext,
837
- Xt as DeleteEntitiesProvider,
838
- Te as DetailsPanelContext,
839
- Bt as DetailsPanelProvider,
840
- to as EntityUpdatesContext,
841
- qo as EntityUpdatesProvider,
842
- Ho as FORCE_AUTO_SYNC,
843
- Ue as GlobalContext,
844
- zt as GlobalProvider,
845
- oo as MenuContext,
846
- Wo as MenuProvider,
847
- Oe as PiPContext,
848
- Wt as PiPProvider,
849
- no as PiPWrapper,
850
- Re as PowerpackContext,
851
- Ht as PowerpackProvider,
852
- so as ProjectContext,
853
- $o as ProjectContextProvider,
854
- Ne as ProjectFoldersContext,
855
- Yt as ProjectFoldersContextProvider,
856
- Ce as RemoteModulesContext,
857
- _t as RemoteModulesProvider,
858
- Fe as SettingsPanelContext,
859
- Vt as SettingsPanelProvider,
860
- ro as SocketContext,
861
- ao as SocketProvider,
862
- Ae as SubtasksModulesContext,
863
- Gt as SubtasksModulesProvider,
864
- Ge as TABLE_EXPORT_SEARCH_PARAM,
865
- Le as TABS_BY_SCOPE_KEY,
733
+ Ue as AddonContext,
734
+ Fe as AddonProjectContext,
735
+ qt as AddonProjectProvider,
736
+ Vt as AddonProvider,
737
+ Be as DeleteEntitiesContext,
738
+ zt as DeleteEntitiesProvider,
739
+ Ae as DetailsPanelContext,
740
+ Nt as DetailsPanelProvider,
741
+ Zt as EntityUpdatesContext,
742
+ Qo as EntityUpdatesProvider,
743
+ zo as FORCE_AUTO_SYNC,
744
+ Ne as GlobalContext,
745
+ Ht as GlobalProvider,
746
+ Jt as MenuContext,
747
+ Go as MenuProvider,
748
+ Me as PiPContext,
749
+ Gt as PiPProvider,
750
+ eo as PiPWrapper,
751
+ $e as PowerpackContext,
752
+ Wt as PowerpackProvider,
753
+ to as ProjectContext,
754
+ Vo as ProjectContextProvider,
755
+ oo as ProjectFoldersContext,
756
+ Wo as ProjectFoldersContextProvider,
757
+ xe as RemoteModulesContext,
758
+ $t as RemoteModulesProvider,
759
+ Re as SettingsPanelContext,
760
+ Bt as SettingsPanelProvider,
761
+ no as SocketContext,
762
+ so as SocketProvider,
763
+ Oe as SubtasksModulesContext,
764
+ _t as SubtasksModulesProvider,
765
+ qe as TABLE_EXPORT_SEARCH_PARAM,
766
+ De as TABS_BY_SCOPE_KEY,
866
767
  Ve as TableExportContext,
867
- Zt as TableExportProvider,
868
- io as ThumbnailUploadContext,
869
- _o as ThumbnailUploadProvider,
870
- $e as URIContext,
871
- Kt as URIProvider,
872
- Uo as URL_PARAM_ID,
873
- ft as addonConfigs,
874
- lo as getActivityFrameLink,
875
- co as getAutoSyncForTopic,
876
- uo as getUpdateType,
877
- po as isAddonDetailsPanelTab,
878
- fo as isDeletableEntityType,
879
- xe as isDetailsPanelTab,
880
- mo as matchesProject,
881
- go as matchesTopic,
882
- Go as powerpackFeatureOrder,
768
+ Yt as TableExportProvider,
769
+ ro as ThumbnailUploadContext,
770
+ $o as ThumbnailUploadProvider,
771
+ _e as URIContext,
772
+ Qt as URIProvider,
773
+ Fo as URL_PARAM_ID,
774
+ pt as addonConfigs,
775
+ ao as getActivityFrameLink,
776
+ io as getAutoSyncForTopic,
777
+ lo as getUpdateType,
778
+ co as isAddonDetailsPanelTab,
779
+ uo as isDeletableEntityType,
780
+ Te as isDetailsPanelTab,
781
+ po as matchesProject,
782
+ fo as matchesTopic,
783
+ _o as powerpackFeatureOrder,
883
784
  at as powerpackFeatures,
884
- ho as setDetailsPanelTabForScope,
885
- vo as toggleSyncAll,
886
- yo as useAddonContext,
887
- Po as useAddonProjectContext,
888
- bo as useAutoSyncSettings,
889
- wo as useDeleteEntitiesContext,
890
- So as useDeleteEntitiesContextOptional,
891
- Co as useDetailsPanelContext,
892
- de as useGlobalContext,
893
- Io as useMenuContext,
894
- Eo as useOptionalProjectContext,
895
- ko as usePiPWindow,
896
- Z as usePowerpack,
897
- Lo as useProjectContext,
898
- xo as useProjectFoldersContext,
899
- Be as useRemoteModules,
900
- Do as useScopedDetailsPanel,
901
- To as useSettingsPanel,
902
- Ao as useSocketContext,
903
- Fo as useSubtasksModulesContext,
904
- Oo as useSyncUpdates,
905
- jo as useTableExportContext,
906
- Mo as useThumbnailUploadContext,
907
- De as useURIContext
785
+ mo as setDetailsPanelTabForScope,
786
+ go as toggleSyncAll,
787
+ vo as useAddonContext,
788
+ yo as useAddonProjectContext,
789
+ ho as useAutoSyncSettings,
790
+ Po as useDeleteEntitiesContext,
791
+ bo as useDeleteEntitiesContextOptional,
792
+ wo as useDetailsPanelContext,
793
+ ue as useGlobalContext,
794
+ Eo as useMenuContext,
795
+ So as useOptionalProjectContext,
796
+ Co as useOptionalProjectFoldersContext,
797
+ xo as usePiPWindow,
798
+ ee as usePowerpack,
799
+ ko as useProjectContext,
800
+ Lo as useProjectFoldersContext,
801
+ Ge as useRemoteModules,
802
+ Io as useScopedDetailsPanel,
803
+ Do as useSettingsPanel,
804
+ To as useSocketContext,
805
+ jo as useSubtasksModulesContext,
806
+ Ao as useSyncUpdates,
807
+ Oo as useTableExportContext,
808
+ Ro as useThumbnailUploadContext,
809
+ je as useURIContext
908
810
  };