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