ode-explorer 1.4.0-develop.202403061042 → 1.4.0-develop.202403111000

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.
package/lib/index2.js CHANGED
@@ -1,164 +1,164 @@
1
- var fe = Object.defineProperty;
2
- var pe = (e, s, t) => s in e ? fe(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
3
- var _ = (e, s, t) => (pe(e, typeof s != "symbol" ? s + "" : s, t), t);
4
- import { jsx as i, jsxs as N, Fragment as oe } from "react/jsx-runtime";
5
- import { useState as ae, useRef as me, useEffect as L, lazy as b, Suspense as O, Fragment as ge } from "react";
6
- import { useScrollToTop as ye, useOdeClient as M, IconButton as Ie, useToast as k, useUser as ce, useShareMutation as we, useUpdateMutation as Se, LoadingScreen as A, FormControl as xe, Input as De, SearchButton as Te, Dropdown as $, useToggle as be, TreeView as Fe, Button as Ce, useXitiTrackPageLoad as Ne, isActionAvailable as ne, AppHeader as Re, Breadcrumb as Pe, Grid as ee } from "@edifice-ui/react";
7
- import { ArrowLeft as Ae, Filter as Ee, Delete as Qe, Plus as qe } from "@edifice-ui/icons";
1
+ var pe = Object.defineProperty;
2
+ var me = (e, t, s) => t in e ? pe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
+ var _ = (e, t, s) => (me(e, typeof t != "symbol" ? t + "" : t, s), s);
4
+ import { jsx as c, jsxs as N, Fragment as oe } from "react/jsx-runtime";
5
+ import { useState as ae, useRef as ge, useEffect as L, lazy as b, Suspense as O, Fragment as ye } from "react";
6
+ import { useScrollToTop as Ie, useOdeClient as M, IconButton as we, useToast as k, useUser as ce, useShareMutation as Se, useUpdateMutation as xe, LoadingScreen as A, FormControl as De, Input as Te, SearchButton as be, Dropdown as $, useToggle as Fe, TreeView as Ce, Button as Ne, useXitiTrackPageLoad as Re, isActionAvailable as ne, AppHeader as Pe, Breadcrumb as Ae, Grid as ee } from "@edifice-ui/react";
7
+ import { ArrowLeft as Ee, Filter as Qe, Delete as qe, Plus as Oe } from "@edifice-ui/icons";
8
8
  import { useTranslation as j } from "react-i18next";
9
9
  import { odeServices as x, FOLDER as C } from "edifice-ts-client";
10
10
  import { t as S } from "i18next";
11
- import { create as Oe } from "zustand";
12
- import { useQuery as ke, useInfiniteQuery as Ue, useQueryClient as E, useMutation as v } from "@tanstack/react-query";
11
+ import { create as ke } from "zustand";
12
+ import { useQuery as Ue, useInfiniteQuery as ve, useQueryClient as E, useMutation as v } from "@tanstack/react-query";
13
13
  const ie = async (e) => {
14
- const s = await x.resource(e.application).searchContext(e);
14
+ const t = await x.resource(e.application).searchContext(e);
15
15
  return {
16
- ...s,
17
- folders: s.folders.filter((t) => !t.trashed)
16
+ ...t,
17
+ folders: t.folders.filter((s) => !s.trashed)
18
18
  };
19
- }, ve = async ({
19
+ }, Le = async ({
20
20
  searchParams: e,
21
- name: s,
22
- parentId: t
21
+ name: t,
22
+ parentId: s
23
23
  }) => {
24
24
  const r = {
25
- name: s,
26
- parentId: t,
25
+ name: t,
26
+ parentId: s,
27
27
  application: e.application,
28
28
  type: e.types[0]
29
29
  };
30
30
  return await x.resource(e.application).createFolder(r);
31
- }, Le = async ({
31
+ }, Me = async ({
32
32
  folderId: e,
33
- searchParams: s,
34
- parentId: t,
33
+ searchParams: t,
34
+ parentId: s,
35
35
  name: r
36
36
  }) => {
37
37
  const n = {
38
38
  folderId: e,
39
39
  name: r,
40
- parentId: t,
41
- application: s.application,
42
- type: s.types[0]
40
+ parentId: s,
41
+ application: t.application,
42
+ type: t.types[0]
43
43
  };
44
- return await x.resource(s.application).updateFolder(n);
45
- }, Me = async ({
44
+ return await x.resource(t.application).updateFolder(n);
45
+ }, Ke = async ({
46
46
  searchParams: e,
47
- resourceIds: s,
48
- useAssetIds: t,
47
+ resourceIds: t,
48
+ useAssetIds: s,
49
49
  folderIds: r
50
50
  }) => {
51
51
  const n = {
52
52
  application: e.application,
53
53
  resourceType: e.types[0],
54
- resourceIds: s,
54
+ resourceIds: t,
55
55
  folderIds: r
56
56
  };
57
- return await x.resource(e.application).trashAll(n, t);
58
- }, Ke = async ({
57
+ return await x.resource(e.application).trashAll(n, s);
58
+ }, Be = async ({
59
59
  searchParams: e,
60
- resourceIds: s,
61
- useAssetIds: t,
60
+ resourceIds: t,
61
+ useAssetIds: s,
62
62
  folderIds: r
63
63
  }) => {
64
64
  const n = {
65
65
  application: e.application,
66
66
  resourceType: e.types[0],
67
- resourceIds: s,
67
+ resourceIds: t,
68
68
  folderIds: r
69
69
  };
70
- return await x.resource(e.application).deleteAll(n, t);
71
- }, Be = async ({
70
+ return await x.resource(e.application).deleteAll(n, s);
71
+ }, _e = async ({
72
72
  searchParams: e,
73
- resourceIds: s,
74
- folderIds: t,
73
+ resourceIds: t,
74
+ folderIds: s,
75
75
  useAssetIds: r
76
76
  }) => {
77
77
  const n = {
78
78
  application: e.application,
79
79
  resourceType: e.types[0],
80
- resourceIds: s,
81
- folderIds: t
80
+ resourceIds: t,
81
+ folderIds: s
82
82
  };
83
83
  return await x.resource(e.application).restoreAll(n, r);
84
- }, _e = async (e, s) => await x.resource(e.application).copy({
84
+ }, $e = async (e, t) => await x.resource(e.application).copy({
85
85
  application: e.application,
86
- resourceId: s
87
- }), $e = async ({
86
+ resourceId: t
87
+ }), le = async ({
88
88
  searchParams: e,
89
- resourceIds: s,
90
- folderId: t,
89
+ resourceIds: t,
90
+ folderId: s,
91
91
  folderIds: r,
92
92
  useAssetIds: n
93
93
  }) => {
94
94
  const a = {
95
95
  application: e.application,
96
- folderId: t,
97
- resourceIds: s,
96
+ folderId: s,
97
+ resourceIds: t,
98
98
  folderIds: r
99
99
  };
100
100
  return await x.resource(e.application).moveToFolder(a, n);
101
101
  };
102
102
  const je = async (e) => await x.rights().sessionHasWorkflowRights(e), ze = ({
103
103
  searchParams: e,
104
- assetId: s
104
+ assetId: t
105
105
  }) => {
106
- const t = x.resource(e.application).getViewUrl(s);
107
- window.open(t, "_self");
106
+ const s = x.resource(e.application).getViewUrl(t);
107
+ window.open(s, "_self");
108
108
  }, Ve = ({
109
109
  searchParams: e,
110
- params: s
111
- }) => x.resource(e.application).create(s), He = ({
110
+ params: t
111
+ }) => x.resource(e.application).create(t), He = ({
112
112
  searchParams: e,
113
- assetId: s
113
+ assetId: t
114
114
  }) => {
115
- const t = x.resource(e.application).getPrintUrl(s);
116
- return window.open(t, "_blank");
115
+ const s = x.resource(e.application).getPrintUrl(t);
116
+ return window.open(s, "_blank");
117
117
  }, Mt = ({
118
118
  searchParams: e,
119
- folderId: s
119
+ folderId: t
120
120
  }) => {
121
- const t = x.resource(e.application).getFormUrl(s);
122
- return window.open(t, "_self");
121
+ const s = x.resource(e.application).getFormUrl(t);
122
+ return window.open(s, "_self");
123
123
  }, Kt = ({
124
124
  searchParams: e,
125
- assetId: s
125
+ assetId: t
126
126
  }) => {
127
- const t = x.resource(e.application).getEditUrl(s);
128
- return window.open(t, "_self");
127
+ const s = x.resource(e.application).getEditUrl(t);
128
+ return window.open(s, "_self");
129
129
  }, Bt = ({
130
130
  searchParams: e,
131
- assetId: s
131
+ assetId: t
132
132
  }) => {
133
- const t = x.resource(e.application).getExportUrl(s);
134
- return window.open(t, "_self");
133
+ const s = x.resource(e.application).getExportUrl(t);
134
+ return window.open(s, "_self");
135
135
  };
136
136
  function te(e) {
137
- return e.filter((s, t) => e.indexOf(s) === t);
137
+ return e.filter((t, s) => e.indexOf(t) === s);
138
138
  }
139
- function V(e, s) {
139
+ function H(e, t) {
140
140
  var r, n;
141
- let t;
142
- return (s == null ? void 0 : s.id) === e ? s : ((r = s == null ? void 0 : s.children) != null && r.length && ((n = s == null ? void 0 : s.children) == null || n.every((a) => (t = V(e, a), t === void 0))), t);
141
+ let s;
142
+ return (t == null ? void 0 : t.id) === e ? t : ((r = t == null ? void 0 : t.children) != null && r.length && ((n = t == null ? void 0 : t.children) == null || n.every((a) => (s = H(e, a), s === void 0))), s);
143
143
  }
144
- function We(e, s) {
144
+ function We(e, t) {
145
145
  var r;
146
- const t = V(e, s);
147
- return (r = t == null ? void 0 : t.folder) != null && r.ancestors ? [...(t == null ? void 0 : t.folder.ancestors) || [], e] : e === C.BIN ? [C.BIN] : [C.DEFAULT];
146
+ const s = H(e, t);
147
+ return (r = s == null ? void 0 : s.folder) != null && r.ancestors ? [...(s == null ? void 0 : s.folder.ancestors) || [], e] : e === C.BIN ? [C.BIN] : [C.DEFAULT];
148
148
  }
149
- function le(e, s) {
150
- return s.id === e && s.children ? s.children.length > 0 : s.children ? s.children.some((t) => le(s.id, t)) : !1;
149
+ function de(e, t) {
150
+ return t.id === e && t.children ? t.children.length > 0 : t.children ? t.children.some((s) => de(t.id, s)) : !1;
151
151
  }
152
- function H(e, s) {
153
- return de(e, s) || e;
152
+ function W(e, t) {
153
+ return ue(e, t) || e;
154
154
  }
155
- function de(e, s, t) {
155
+ function ue(e, t, s) {
156
156
  var n;
157
- const r = s(e, t);
157
+ const r = t(e, s);
158
158
  if ((n = r == null ? void 0 : r.children) != null && n.length) {
159
159
  const a = [];
160
160
  for (const o of (r == null ? void 0 : r.children) || []) {
161
- const l = de(o, s, r);
161
+ const l = ue(o, t, r);
162
162
  l && a.push(l);
163
163
  }
164
164
  return {
@@ -169,16 +169,16 @@ function de(e, s, t) {
169
169
  return r;
170
170
  }
171
171
  class G {
172
- constructor(s) {
172
+ constructor(t) {
173
173
  _(this, "id");
174
174
  _(this, "name");
175
175
  _(this, "childNumber");
176
176
  _(this, "section", !1);
177
177
  _(this, "children", []);
178
- this.folder = s, this.id = s.id, this.name = s.name, this.childNumber = s.childNumber;
178
+ this.folder = t, this.id = t.id, this.name = t.name, this.childNumber = t.childNumber;
179
179
  }
180
180
  }
181
- const ue = (e, s, t) => H(e, (r) => (r.id === t && (r.children = s == null ? void 0 : s.map((n) => new G(n))), r)), w = Oe()((e, s) => ({
181
+ const he = (e, t, s) => W(e, (r) => (r.id === s && (r.children = t == null ? void 0 : t.map((n) => new G(n))), r)), w = ke()((e, t) => ({
182
182
  config: null,
183
183
  searchConfig: {
184
184
  minLength: 1
@@ -220,24 +220,24 @@ const ue = (e, s, t) => H(e, (r) => (r.id === t && (r.children = s == null ? voi
220
220
  resourceActionDisable: !1,
221
221
  status: void 0,
222
222
  updaters: {
223
- setConfig: (t) => e({
224
- config: t
223
+ setConfig: (s) => e({
224
+ config: s
225
225
  }),
226
- setSearchConfig: (t) => e((r) => ({
226
+ setSearchConfig: (s) => e((r) => ({
227
227
  searchConfig: {
228
228
  ...r.searchConfig,
229
- ...t
229
+ ...s
230
230
  }
231
231
  })),
232
- setTreeData: (t) => e(() => ({
233
- treeData: t
232
+ setTreeData: (s) => e(() => ({
233
+ treeData: s
234
234
  })),
235
- setSearchParams: (t) => {
235
+ setSearchParams: (s) => {
236
236
  e((r) => {
237
237
  const {
238
238
  searchParams: n
239
239
  } = r;
240
- return n.search !== t.search ? t.search ? {
240
+ return n.search !== s.search ? s.search ? {
241
241
  ...r,
242
242
  selectedFolders: [],
243
243
  selectedNodesIds: [],
@@ -245,7 +245,7 @@ const ue = (e, s, t) => H(e, (r) => (r.id === t && (r.children = s == null ? voi
245
245
  currentFolder: void 0,
246
246
  searchParams: {
247
247
  ...n,
248
- ...t,
248
+ ...s,
249
249
  trashed: !1,
250
250
  filters: {
251
251
  ...n.filters,
@@ -262,7 +262,7 @@ const ue = (e, s, t) => H(e, (r) => (r.id === t && (r.children = s == null ? voi
262
262
  },
263
263
  searchParams: {
264
264
  ...n,
265
- ...t,
265
+ ...s,
266
266
  trashed: !1,
267
267
  filters: {
268
268
  ...n.filters
@@ -271,31 +271,31 @@ const ue = (e, s, t) => H(e, (r) => (r.id === t && (r.children = s == null ? voi
271
271
  } : {
272
272
  searchParams: {
273
273
  ...n,
274
- ...t
274
+ ...s
275
275
  }
276
276
  };
277
277
  });
278
278
  },
279
- setSelectedFolders: (t) => e(() => ({
280
- selectedFolders: t
279
+ setSelectedFolders: (s) => e(() => ({
280
+ selectedFolders: s
281
281
  })),
282
- setSelectedResources: (t) => e(() => ({
283
- selectedResources: t
282
+ setSelectedResources: (s) => e(() => ({
283
+ selectedResources: s
284
284
  })),
285
- setFolderIds: (t) => e(() => ({
286
- folderIds: t
285
+ setFolderIds: (s) => e(() => ({
286
+ folderIds: s
287
287
  })),
288
- setResourceIds: (t) => e(() => ({
289
- resourceIds: t
288
+ setResourceIds: (s) => e(() => ({
289
+ resourceIds: s
290
290
  })),
291
- setResourceIsTrash: (t) => e(() => ({
292
- resourceIsTrash: t
291
+ setResourceIsTrash: (s) => e(() => ({
292
+ resourceIsTrash: s
293
293
  })),
294
- setResourceActionDisable: (t) => e(() => ({
295
- resourceActionDisable: t
294
+ setResourceActionDisable: (s) => e(() => ({
295
+ resourceActionDisable: s
296
296
  })),
297
- setCurrentFolder: (t) => e(() => ({
298
- currentFolder: t
297
+ setCurrentFolder: (s) => e(() => ({
298
+ currentFolder: s
299
299
  })),
300
300
  clearSelectedItems: () => e(() => ({
301
301
  selectedFolders: [],
@@ -305,14 +305,14 @@ const ue = (e, s, t) => H(e, (r) => (r.id === t && (r.children = s == null ? voi
305
305
  resourceIds: [],
306
306
  folderIds: []
307
307
  })),
308
- openResource: (t) => {
308
+ openResource: (s) => {
309
309
  try {
310
310
  const {
311
311
  searchParams: r
312
- } = s();
312
+ } = t();
313
313
  ze({
314
314
  searchParams: r,
315
- assetId: t.assetId
315
+ assetId: s.assetId
316
316
  });
317
317
  } catch (r) {
318
318
  console.error("explorer open failed: ", r);
@@ -321,96 +321,96 @@ const ue = (e, s, t) => H(e, (r) => (r.id === t && (r.children = s == null ? voi
321
321
  printSelectedResource: () => {
322
322
  try {
323
323
  const {
324
- searchParams: t,
324
+ searchParams: s,
325
325
  selectedResources: r,
326
326
  resourceIds: n
327
- } = s();
327
+ } = t();
328
328
  if (r.length !== 1)
329
329
  throw new Error("Cannot open more than 1 resource");
330
330
  const a = r.find((o) => o.id === n[0]);
331
331
  He({
332
- searchParams: t,
332
+ searchParams: s,
333
333
  assetId: a.assetId
334
334
  });
335
- } catch (t) {
336
- console.error("explorer print failed: ", t);
335
+ } catch (s) {
336
+ console.error("explorer print failed: ", s);
337
337
  }
338
338
  },
339
339
  openFolder: ({
340
- folderId: t,
340
+ folderId: s,
341
341
  folder: r
342
342
  }) => {
343
343
  const {
344
344
  searchParams: n,
345
345
  treeData: a
346
- } = s(), o = n.filters.folder, l = We(t, a), d = te([...l, t]);
347
- o !== t && e((u) => ({
348
- ...u,
346
+ } = t(), o = n.filters.folder, l = We(s, a), h = te([...l, s]);
347
+ o !== s && e((d) => ({
348
+ ...d,
349
349
  // reset selection when changing folder
350
350
  folderIds: [],
351
351
  resourceIds: [],
352
- selectedNodesIds: d,
352
+ selectedNodesIds: h,
353
353
  currentFolder: r || {
354
- id: t
354
+ id: s
355
355
  },
356
356
  searchParams: {
357
357
  ...n,
358
358
  search: void 0,
359
359
  filters: {
360
360
  ...n.filters,
361
- folder: t
361
+ folder: s
362
362
  },
363
- trashed: t === C.BIN
363
+ trashed: s === C.BIN
364
364
  }
365
365
  }));
366
366
  },
367
- foldTreeItem: () => e((t) => ({
368
- ...t,
367
+ foldTreeItem: () => e((s) => ({
368
+ ...s,
369
369
  status: "fold"
370
370
  })),
371
- unfoldTreeItem: async (t, r) => {
371
+ unfoldTreeItem: async (s, r) => {
372
372
  const {
373
373
  treeData: n,
374
374
  searchParams: a
375
- } = s();
375
+ } = t();
376
376
  if (e((o) => ({
377
377
  ...o,
378
378
  status: "unfold"
379
- })), !le(t, n)) {
379
+ })), !de(s, n)) {
380
380
  await r.prefetchInfiniteQuery({
381
381
  initialPageParam: 0,
382
382
  queryKey: ["prefetchContext", {
383
- folderId: t,
383
+ folderId: s,
384
384
  trashed: !1
385
385
  }],
386
386
  queryFn: async () => await ie({
387
387
  ...a,
388
388
  filters: {
389
389
  ...a.filters,
390
- folder: t
390
+ folder: s
391
391
  }
392
392
  })
393
393
  });
394
394
  const o = r.getQueryData(["prefetchContext", {
395
- folderId: t,
395
+ folderId: s,
396
396
  trashed: !1
397
397
  }]);
398
398
  e((l) => {
399
- var d;
399
+ var h;
400
400
  return {
401
401
  ...l,
402
- treeData: ue(n, (d = o == null ? void 0 : o.pages[0]) == null ? void 0 : d.folders, t || C.DEFAULT)
402
+ treeData: he(n, (h = o == null ? void 0 : o.pages[0]) == null ? void 0 : h.folders, s || C.DEFAULT)
403
403
  };
404
404
  });
405
405
  }
406
406
  },
407
- selectTreeItem: (t) => {
407
+ selectTreeItem: (s) => {
408
408
  const {
409
409
  treeData: r
410
- } = s(), {
410
+ } = t(), {
411
411
  openFolder: n
412
- } = s().updaters, a = V(t, r);
413
- ye()(), e((l) => ({
412
+ } = t().updaters, a = H(s, r);
413
+ Ie()(), e((l) => ({
414
414
  ...l,
415
415
  searchParams: {
416
416
  ...l.searchParams,
@@ -420,33 +420,33 @@ const ue = (e, s, t) => H(e, (r) => (r.id === t && (r.children = s == null ? voi
420
420
  selectedResources: []
421
421
  })), n({
422
422
  folder: a,
423
- folderId: t
423
+ folderId: s
424
424
  });
425
425
  },
426
426
  gotoPreviousFolder: () => {
427
427
  const {
428
- selectedNodesIds: t,
428
+ selectedNodesIds: s,
429
429
  treeData: r
430
- } = s(), {
430
+ } = t(), {
431
431
  openFolder: n
432
- } = s().updaters, a = t.length;
432
+ } = t().updaters, a = s.length;
433
433
  if (a < 2)
434
434
  return;
435
- const o = V(t[a - 2], r);
435
+ const o = H(s[a - 2], r);
436
436
  n({
437
437
  folder: o,
438
438
  folderId: (o == null ? void 0 : o.id) || C.DEFAULT
439
439
  });
440
440
  },
441
- goToTrash: () => e((t) => ({
442
- ...t,
441
+ goToTrash: () => e((s) => ({
442
+ ...s,
443
443
  selectedNodesIds: [],
444
444
  selectedResources: [],
445
445
  resourceIds: [],
446
446
  folderIds: [],
447
447
  status: "select",
448
448
  searchParams: {
449
- ...t.searchParams,
449
+ ...s.searchParams,
450
450
  search: void 0,
451
451
  filters: {
452
452
  folder: C.BIN
@@ -458,104 +458,104 @@ const ue = (e, s, t) => H(e, (r) => (r.id === t && (r.children = s == null ? voi
458
458
  }
459
459
  }))
460
460
  }
461
- })), D = () => w((e) => e.searchParams), se = () => w((e) => e.selectedNodesIds), z = () => w((e) => e.treeData), _t = () => w((e) => e.selectedFolders), $t = () => w((e) => e.selectedResources), Ge = () => w((e) => e.searchConfig), J = () => w((e) => e.folderIds), X = () => w((e) => e.resourceIds), Y = () => w((e) => e.selectedResources.map((s) => s.assetId)), Z = () => w((e) => e.selectedResources.filter((s) => s.assetId === s.id)), W = () => w((e) => e.currentFolder), T = () => w((e) => e.updaters), re = () => {
462
- const e = W();
461
+ })), D = () => w((e) => e.searchParams), se = () => w((e) => e.selectedNodesIds), z = () => w((e) => e.treeData), _t = () => w((e) => e.selectedFolders), $t = () => w((e) => e.selectedResources), Ge = () => w((e) => e.searchConfig), J = () => w((e) => e.folderIds), X = () => w((e) => e.resourceIds), Y = () => w((e) => e.selectedResources.map((t) => t.assetId)), Z = () => w((e) => e.selectedResources.filter((t) => t.assetId === t.id)), V = () => w((e) => e.currentFolder), T = () => w((e) => e.updaters), re = () => {
462
+ const e = V();
463
463
  return (e == null ? void 0 : e.id) === C.BIN;
464
464
  }, Je = () => w((e) => e.resourceIsTrash), Xe = () => w((e) => e.resourceActionDisable), Ye = () => {
465
- const e = W();
465
+ const e = V();
466
466
  return (e == null ? void 0 : e.id) === "default";
467
- }, Ze = () => se().length > 1, et = () => w((e) => e.status), he = () => {
468
- const e = D(), [s, t] = ae(""), r = Ge(), n = et(), a = me(null), {
467
+ }, Ze = () => se().length > 1, et = () => w((e) => e.status), fe = () => {
468
+ const e = D(), [t, s] = ae(""), r = Ge(), n = et(), a = ge(null), {
469
469
  setSearchParams: o
470
- } = T(), l = (h) => {
471
- const f = h.target.value;
472
- t(f.toString());
473
- }, d = (h) => {
474
- (h.key === "Enter" || h.key === "Return") && (h.preventDefault(), o({
475
- search: s || void 0
470
+ } = T(), l = (u) => {
471
+ const f = u.target.value;
472
+ s(f.toString());
473
+ }, h = (u) => {
474
+ (u.key === "Enter" || u.key === "Return") && (u.preventDefault(), o({
475
+ search: t || void 0
476
476
  }));
477
- }, u = (h) => {
478
- h.preventDefault(), o({
479
- search: s || void 0
477
+ }, d = (u) => {
478
+ u.preventDefault(), o({
479
+ search: t || void 0
480
480
  });
481
481
  };
482
482
  return L(() => {
483
- const f = s.length == 0 || s.length >= r.minLength ? {
484
- search: s || void 0
483
+ const f = t.length == 0 || t.length >= r.minLength ? {
484
+ search: t || void 0
485
485
  } : {};
486
486
  o({
487
487
  ...e,
488
488
  ...f
489
489
  });
490
- }, [s, r.minLength]), L(() => {
491
- n === "select" && t("");
490
+ }, [t, r.minLength]), L(() => {
491
+ n === "select" && s("");
492
492
  }, [n]), L(() => {
493
- t(() => {
494
- var h;
495
- return ((h = e.search) == null ? void 0 : h.toString()) ?? "";
493
+ s(() => {
494
+ var u;
495
+ return ((u = e.search) == null ? void 0 : u.toString()) ?? "";
496
496
  });
497
497
  }, [e]), {
498
498
  formRef: a,
499
- inputSearch: s,
499
+ inputSearch: t,
500
500
  handleInputSearchChange: l,
501
- handleKeyPress: d,
502
- handleSearchSubmit: u
501
+ handleKeyPress: h,
502
+ handleSearchSubmit: d
503
503
  };
504
504
  };
505
505
  function tt() {
506
506
  const {
507
507
  appCode: e
508
508
  } = M(), {
509
- gotoPreviousFolder: s
509
+ gotoPreviousFolder: t
510
510
  } = T(), {
511
- t
511
+ t: s
512
512
  } = j(), {
513
513
  inputSearch: r
514
- } = he(), n = se(), a = re(), o = W(), l = t("explorer.tree.trash"), d = t("explorer.tree.search"), u = t("explorer.filters.mine", {
514
+ } = fe(), n = se(), a = re(), o = V(), l = s("explorer.tree.trash"), h = s("explorer.tree.search"), d = s("explorer.filters.mine", {
515
515
  ns: e
516
- }), h = (o == null ? void 0 : o.name) || u;
517
- return /* @__PURE__ */ i("div", { className: "py-16", children: n.length > 1 && !a ? /* @__PURE__ */ N("div", { className: "d-flex align-items-center gap-8", children: [
518
- /* @__PURE__ */ i(Ie, { icon: /* @__PURE__ */ i(Ae, {}), variant: "ghost", color: "tertiary", "aria-label": t("back"), className: "ms-n16", onClick: s }),
519
- /* @__PURE__ */ i("p", { className: "body py-8 text-truncate", children: /* @__PURE__ */ i("strong", { children: h }) })
520
- ] }) : /* @__PURE__ */ i("h2", { className: "body py-8 fw-bold", children: r.length !== 0 ? d : a ? l : u }) });
516
+ }), u = (o == null ? void 0 : o.name) || d;
517
+ return /* @__PURE__ */ c("div", { className: "py-16", children: n.length > 1 && !a ? /* @__PURE__ */ N("div", { className: "d-flex align-items-center gap-8", children: [
518
+ /* @__PURE__ */ c(we, { icon: /* @__PURE__ */ c(Ee, {}), variant: "ghost", color: "tertiary", "aria-label": s("back"), className: "ms-n16", onClick: t }),
519
+ /* @__PURE__ */ c("p", { className: "body py-8 text-truncate", children: /* @__PURE__ */ c("strong", { children: u }) })
520
+ ] }) : /* @__PURE__ */ c("h2", { className: "body py-8 fw-bold", children: r.length !== 0 ? h : a ? l : d }) });
521
521
  }
522
522
  const st = () => {
523
523
  const e = Xe(), {
524
- clearSelectedIds: s,
525
- setResourceActionDisable: t,
524
+ clearSelectedIds: t,
525
+ setResourceActionDisable: s,
526
526
  clearSelectedItems: r
527
527
  } = T();
528
528
  return {
529
529
  isActionDisableModalOpen: e,
530
530
  onActionDisableCancel: () => {
531
- s(), r(), t(!1);
531
+ t(), r(), s(!1);
532
532
  }
533
533
  };
534
534
  }, rt = () => {
535
535
  const e = Je(), {
536
- clearSelectedIds: s,
537
- setResourceIsTrash: t,
536
+ clearSelectedIds: t,
537
+ setResourceIsTrash: s,
538
538
  clearSelectedItems: r
539
539
  } = T();
540
540
  return {
541
541
  isTrashedModalOpen: e,
542
542
  onTrashedCancel: () => {
543
- s(), r(), t(!1);
543
+ t(), r(), s(!1);
544
544
  }
545
545
  };
546
546
  };
547
547
  function nt(e, {
548
- parentId: s,
549
- newFolder: t
548
+ parentId: t,
549
+ newFolder: s
550
550
  }) {
551
- return H(e, (r) => {
551
+ return W(e, (r) => {
552
552
  var n;
553
- if (r.id === s) {
553
+ if (r.id === t) {
554
554
  const a = [...((n = r.folder) == null ? void 0 : n.ancestors) || []], o = te([...a, r.id]);
555
555
  return {
556
556
  ...r,
557
557
  children: [...r.children || [], new G({
558
- ...t,
558
+ ...s,
559
559
  ancestors: o
560
560
  })]
561
561
  };
@@ -564,82 +564,82 @@ function nt(e, {
564
564
  });
565
565
  }
566
566
  function ot(e, {
567
- folders: s
567
+ folders: t
568
568
  }) {
569
- return H(e, (t) => {
570
- if (!s.includes(t.id))
571
- return t;
569
+ return W(e, (s) => {
570
+ if (!t.includes(s.id))
571
+ return s;
572
572
  });
573
573
  }
574
574
  function at(e, {
575
- destinationId: s,
576
- folders: t
575
+ destinationId: t,
576
+ folders: s
577
577
  }) {
578
- return H(e, (r, n) => {
578
+ return W(e, (r, n) => {
579
579
  var a, o;
580
- if (s === r.id) {
581
- const l = [...((a = r.folder) == null ? void 0 : a.ancestors) || []], d = te([...l, r.id]), u = [...r.children || []], h = ((o = r.children) == null ? void 0 : o.map((c) => c.id)) || [];
582
- for (const c of t)
583
- if (!h.includes(c)) {
584
- const p = V(c, e);
585
- p && u.push({
580
+ if (t === r.id) {
581
+ const l = [...((a = r.folder) == null ? void 0 : a.ancestors) || []], h = te([...l, r.id]), d = [...r.children || []], u = ((o = r.children) == null ? void 0 : o.map((i) => i.id)) || [];
582
+ for (const i of s)
583
+ if (!u.includes(i)) {
584
+ const p = H(i, e);
585
+ p && d.push({
586
586
  ...p,
587
587
  folder: {
588
588
  ...p == null ? void 0 : p.folder,
589
- ancestors: d
589
+ ancestors: h
590
590
  }
591
591
  });
592
592
  }
593
593
  return {
594
594
  ...r,
595
- children: u
595
+ children: d
596
596
  };
597
597
  } else
598
- return t.includes(r.id) && s !== (n == null ? void 0 : n.id) ? void 0 : r;
598
+ return s.includes(r.id) && t !== (n == null ? void 0 : n.id) ? void 0 : r;
599
599
  });
600
600
  }
601
601
  function ct(e, {
602
- folderId: s,
603
- newFolder: t
602
+ folderId: t,
603
+ newFolder: s
604
604
  }) {
605
- return H(e, (r) => r.id === s ? new G(t) : r);
605
+ return W(e, (r) => r.id === t ? new G(s) : r);
606
606
  }
607
607
  const it = () => {
608
- const e = w((s) => s.config);
609
- return ke({
608
+ const e = w((t) => t.config);
609
+ return Ue({
610
610
  queryKey: ["actions"],
611
611
  queryFn: async () => {
612
- const s = e == null ? void 0 : e.actions.map((r) => r.workflow);
613
- return await je(s);
612
+ const t = e == null ? void 0 : e.actions.map((r) => r.workflow);
613
+ return await je(t);
614
614
  },
615
- select: (s) => e == null ? void 0 : e.actions.map((t) => ({
616
- ...t,
617
- available: s[t.workflow]
615
+ select: (t) => e == null ? void 0 : e.actions.map((s) => ({
616
+ ...s,
617
+ available: t[s.workflow]
618
618
  })),
619
619
  staleTime: 1 / 0,
620
620
  enabled: !!e
621
621
  });
622
622
  }, lt = () => {
623
- const e = w((o) => o.config), s = D(), {
624
- filters: t,
623
+ const e = w((o) => o.config), t = D(), {
624
+ filters: s,
625
625
  trashed: r,
626
626
  search: n
627
- } = s, a = ["context", {
628
- folderId: t.folder,
629
- filters: t,
627
+ } = t, a = ["context", {
628
+ folderId: s.folder,
629
+ filters: s,
630
630
  trashed: r,
631
631
  search: n
632
632
  }];
633
- return Ue({
633
+ return ve({
634
634
  queryKey: a,
635
635
  queryFn: async ({
636
636
  pageParam: o
637
637
  }) => await ie({
638
- ...s,
638
+ ...t,
639
639
  application: e == null ? void 0 : e.app,
640
640
  types: e == null ? void 0 : e.types,
641
641
  pagination: {
642
- ...s.pagination,
642
+ ...t.pagination,
643
643
  startIdx: o
644
644
  }
645
645
  }),
@@ -650,34 +650,34 @@ const it = () => {
650
650
  getNextPageParam: (o) => o.pagination.startIdx + o.pagination.pageSize
651
651
  });
652
652
  }, jt = () => {
653
- const e = k(), s = E(), t = D(), r = z(), n = J(), a = Y(), o = X(), l = Z().length > 0, d = l ? a : o, {
654
- clearSelectedItems: u,
655
- clearSelectedIds: h,
653
+ const e = k(), t = E(), s = D(), r = z(), n = J(), a = Y(), o = X(), l = Z().length > 0, h = l ? a : o, {
654
+ clearSelectedItems: d,
655
+ clearSelectedIds: u,
656
656
  setTreeData: f,
657
- setSearchParams: c
657
+ setSearchParams: i
658
658
  } = T(), {
659
659
  filters: p,
660
660
  trashed: m
661
- } = t, y = ["context", {
661
+ } = s, y = ["context", {
662
662
  folderId: p.folder,
663
663
  filters: p,
664
664
  trashed: m
665
665
  }];
666
666
  return v({
667
- mutationFn: async () => await Me({
668
- searchParams: t,
667
+ mutationFn: async () => await Ke({
668
+ searchParams: s,
669
669
  folderIds: n,
670
- resourceIds: d,
670
+ resourceIds: h,
671
671
  useAssetIds: l
672
672
  }),
673
673
  onError(g) {
674
674
  typeof g == "string" && e.error(S(g));
675
675
  },
676
676
  onSuccess: async (g) => {
677
- if (await s.cancelQueries({
677
+ if (await t.cancelQueries({
678
678
  queryKey: y
679
- }), s.getQueryData(y))
680
- return e.success(S("explorer.trash.title")), s.setQueryData(y, (F) => {
679
+ }), t.getQueryData(y))
680
+ return e.success(S("explorer.trash.title")), t.setQueryData(y, (F) => {
681
681
  var Q;
682
682
  if (F) {
683
683
  const U = {
@@ -692,44 +692,44 @@ const it = () => {
692
692
  // @ts-ignore
693
693
  maxIdx: ((P = R == null ? void 0 : R.pagination) == null ? void 0 : P.maxIdx) - g.resources.length
694
694
  },
695
- resources: R.resources.filter((q) => l ? !a.includes(q.assetId) : !d.includes(q.id))
695
+ resources: R.resources.filter((q) => l ? !a.includes(q.assetId) : !h.includes(q.id))
696
696
  };
697
697
  })
698
698
  }, K = ot(r, {
699
699
  folders: n
700
700
  });
701
- return f(K), c({
702
- ...t,
701
+ return f(K), i({
702
+ ...s,
703
703
  pagination: {
704
- ...t.pagination,
704
+ ...s.pagination,
705
705
  // @ts-ignore
706
- maxIdx: ((Q = t.pagination) == null ? void 0 : Q.maxIdx) - g.resources.length
706
+ maxIdx: ((Q = s.pagination) == null ? void 0 : Q.maxIdx) - g.resources.length
707
707
  }
708
708
  }), U;
709
709
  }
710
710
  });
711
711
  },
712
712
  onSettled: () => {
713
- u(), h();
713
+ d(), u();
714
714
  }
715
715
  });
716
716
  }, zt = () => {
717
- const e = k(), s = E(), t = D(), r = J(), n = Y(), a = X(), o = Z().length > 0, l = o ? n : a, {
718
- setFolderIds: d,
719
- setResourceIds: u,
720
- setSelectedResources: h,
717
+ const e = k(), t = E(), s = D(), r = J(), n = Y(), a = X(), o = Z().length > 0, l = o ? n : a, {
718
+ setFolderIds: h,
719
+ setResourceIds: d,
720
+ setSelectedResources: u,
721
721
  setSelectedFolders: f
722
722
  } = T(), {
723
- filters: c,
723
+ filters: i,
724
724
  trashed: p
725
- } = t, m = ["context", {
726
- folderId: c.folder,
727
- filters: c,
725
+ } = s, m = ["context", {
726
+ folderId: i.folder,
727
+ filters: i,
728
728
  trashed: p
729
729
  }];
730
730
  return v({
731
- mutationFn: async () => await Be({
732
- searchParams: t,
731
+ mutationFn: async () => await _e({
732
+ searchParams: s,
733
733
  folderIds: r,
734
734
  resourceIds: l,
735
735
  useAssetIds: o
@@ -738,10 +738,10 @@ const it = () => {
738
738
  typeof y == "string" && e.error(S(y));
739
739
  },
740
740
  onSuccess: async () => {
741
- if (await s.cancelQueries({
741
+ if (await t.cancelQueries({
742
742
  queryKey: m
743
- }), s.getQueryData(m))
744
- return e.success(S("explorer.trash.toast")), s.setQueryData(m, (g) => {
743
+ }), t.getQueryData(m))
744
+ return e.success(S("explorer.trash.toast")), t.setQueryData(m, (g) => {
745
745
  if (g)
746
746
  return {
747
747
  ...g,
@@ -754,24 +754,24 @@ const it = () => {
754
754
  });
755
755
  },
756
756
  onSettled: () => {
757
- u([]), h([]), d([]), f([]);
757
+ d([]), u([]), h([]), f([]);
758
758
  }
759
759
  });
760
760
  }, Vt = () => {
761
- const e = k(), s = E(), t = D(), r = J(), n = Y(), a = X(), o = Z().length > 0, l = o ? n : a, {
762
- clearSelectedItems: d,
763
- clearSelectedIds: u
761
+ const e = k(), t = E(), s = D(), r = J(), n = Y(), a = X(), o = Z().length > 0, l = o ? n : a, {
762
+ clearSelectedItems: h,
763
+ clearSelectedIds: d
764
764
  } = T(), {
765
- filters: h,
765
+ filters: u,
766
766
  trashed: f
767
- } = t, c = ["context", {
768
- folderId: h.folder,
769
- filters: h,
767
+ } = s, i = ["context", {
768
+ folderId: u.folder,
769
+ filters: u,
770
770
  trashed: f
771
771
  }];
772
772
  return v({
773
- mutationFn: async () => await Ke({
774
- searchParams: t,
773
+ mutationFn: async () => await Be({
774
+ searchParams: s,
775
775
  folderIds: r,
776
776
  resourceIds: l,
777
777
  useAssetIds: o
@@ -780,10 +780,10 @@ const it = () => {
780
780
  typeof p == "string" && e.error(S(p));
781
781
  },
782
782
  onSuccess: async () => {
783
- if (await s.cancelQueries({
784
- queryKey: c
785
- }), s.getQueryData(c))
786
- return e.success(S("explorer.removed.from.trash")), s.setQueryData(c, (m) => {
783
+ if (await t.cancelQueries({
784
+ queryKey: i
785
+ }), t.getQueryData(i))
786
+ return e.success(S("explorer.removed.from.trash")), t.setQueryData(i, (m) => {
787
787
  if (m)
788
788
  return {
789
789
  ...m,
@@ -796,29 +796,29 @@ const it = () => {
796
796
  });
797
797
  },
798
798
  onSettled: () => {
799
- d(), u();
799
+ h(), d();
800
800
  }
801
801
  });
802
802
  }, Ht = () => {
803
- const e = k(), s = D(), t = E(), {
803
+ const e = k(), t = D(), s = E(), {
804
804
  user: r
805
- } = ce(), {
806
- filters: n,
807
- trashed: a
808
- } = s, o = "duplicate_start", l = ["context", {
809
- folderId: n.folder,
810
- filters: n,
811
- trashed: a
805
+ } = ce(), n = V(), {
806
+ filters: a,
807
+ trashed: o
808
+ } = t, l = "duplicate_start", h = ["context", {
809
+ folderId: a.folder,
810
+ filters: a,
811
+ trashed: o
812
812
  }];
813
813
  return v({
814
814
  mutationFn: async (d) => (e.info(S("duplicate.start"), {
815
- id: o
816
- }), await _e(s, d.assetId)),
815
+ id: l
816
+ }), await $e(t, d.assetId)),
817
817
  onSuccess: async (d, u) => {
818
- e.remove(o), e.success(S("duplicate.done")), await t.cancelQueries({
819
- queryKey: l
818
+ e.remove(l), e.success(S("duplicate.done")), await s.cancelQueries({
819
+ queryKey: h
820
820
  });
821
- const h = t.getQueryData(l), f = {
821
+ const f = s.getQueryData(h), i = {
822
822
  ...u,
823
823
  name: `${u.name}${S("duplicate.suffix")}`,
824
824
  assetId: d.duplicateId,
@@ -834,50 +834,55 @@ const it = () => {
834
834
  trashed: !1,
835
835
  rights: [`creator:${r == null ? void 0 : r.userId}`]
836
836
  };
837
- if (h)
838
- return t.setQueryData(l, (c) => {
839
- if (c)
840
- return {
841
- ...c,
842
- pages: c == null ? void 0 : c.pages.map((p) => ({
843
- ...p,
844
- resources: [f, ...p.resources]
845
- }))
846
- };
847
- });
837
+ f && s.setQueryData(h, (p) => {
838
+ if (p)
839
+ return {
840
+ ...p,
841
+ pages: p == null ? void 0 : p.pages.map((m) => ({
842
+ ...m,
843
+ resources: [i, ...m.resources]
844
+ }))
845
+ };
846
+ }), n.id && n.id !== "default" && le({
847
+ searchParams: t,
848
+ resourceIds: [d.duplicateId],
849
+ folderId: n.id,
850
+ folderIds: [],
851
+ useAssetIds: !0
852
+ });
848
853
  },
849
854
  onError: (d) => {
850
- e.remove(o), typeof d == "string" && e.error(`${S("duplicate.error")}: ${d}`);
855
+ e.remove(l), typeof d == "string" && e.error(`${S("duplicate.error")}: ${d}`);
851
856
  }
852
857
  });
853
858
  }, Wt = () => {
854
- const e = k(), s = E(), t = D(), r = z(), n = J(), a = Y(), o = X(), l = Z().length > 0, d = l ? a : o, {
855
- clearSelectedIds: u,
856
- clearSelectedItems: h,
859
+ const e = k(), t = E(), s = D(), r = z(), n = J(), a = Y(), o = X(), l = Z().length > 0, h = l ? a : o, {
860
+ clearSelectedIds: d,
861
+ clearSelectedItems: u,
857
862
  setTreeData: f,
858
- setSearchParams: c
863
+ setSearchParams: i
859
864
  } = T(), {
860
865
  filters: p,
861
866
  trashed: m
862
- } = t, y = ["context", {
867
+ } = s, y = ["context", {
863
868
  folderId: p.folder,
864
869
  filters: p,
865
870
  trashed: m
866
871
  }];
867
872
  return v({
868
- mutationFn: async (g) => await $e({
869
- searchParams: t,
873
+ mutationFn: async (g) => await le({
874
+ searchParams: s,
870
875
  folderId: g,
871
876
  folderIds: n,
872
- resourceIds: d,
877
+ resourceIds: h,
873
878
  useAssetIds: l
874
879
  }),
875
880
  onError(g) {
876
881
  typeof g == "string" && e.error(S(g));
877
882
  },
878
883
  onSuccess: async (g, I) => {
879
- if (s.getQueryData(y))
880
- return s.setQueryData(y, (Q) => {
884
+ if (t.getQueryData(y))
885
+ return t.setQueryData(y, (Q) => {
881
886
  var U;
882
887
  if (Q) {
883
888
  const K = at(r, {
@@ -895,69 +900,69 @@ const it = () => {
895
900
  // @ts-ignore
896
901
  maxIdx: ((q = P.pagination) == null ? void 0 : q.maxIdx) - g.resources.length
897
902
  },
898
- resources: P.resources.filter((B) => l ? !a.includes(B.assetId) : !d.includes(B.id))
903
+ resources: P.resources.filter((B) => l ? !a.includes(B.assetId) : !h.includes(B.id))
899
904
  };
900
905
  })
901
906
  };
902
- return f(K), c({
903
- ...t,
907
+ return f(K), i({
908
+ ...s,
904
909
  pagination: {
905
- ...t.pagination,
910
+ ...s.pagination,
906
911
  // @ts-ignore
907
- maxIdx: ((U = t.pagination) == null ? void 0 : U.maxIdx) - g.resources.length
912
+ maxIdx: ((U = s.pagination) == null ? void 0 : U.maxIdx) - g.resources.length
908
913
  }
909
914
  }), R;
910
915
  }
911
916
  });
912
917
  },
913
918
  onSettled: () => {
914
- h(), u();
919
+ u(), d();
915
920
  }
916
921
  });
917
922
  }, Gt = () => {
918
- const e = k(), s = E(), t = D(), r = z(), {
923
+ const e = k(), t = E(), s = D(), r = z(), {
919
924
  setTreeData: n
920
925
  } = T(), {
921
926
  filters: a,
922
927
  trashed: o
923
- } = t, l = ["context", {
928
+ } = s, l = ["context", {
924
929
  folderId: a.folder,
925
930
  filters: a,
926
931
  trashed: o
927
932
  }];
928
933
  return v({
929
934
  mutationFn: async ({
930
- name: d,
931
- parentId: u
932
- }) => await ve({
933
- searchParams: t,
934
- name: d,
935
- parentId: u
935
+ name: h,
936
+ parentId: d
937
+ }) => await Le({
938
+ searchParams: s,
939
+ name: h,
940
+ parentId: d
936
941
  }),
937
- onError(d) {
938
- typeof d == "string" && e.error(S(d));
942
+ onError(h) {
943
+ typeof h == "string" && e.error(S(h));
939
944
  },
940
- onSuccess: async (d, u) => {
941
- await s.cancelQueries({
945
+ onSuccess: async (h, d) => {
946
+ await t.cancelQueries({
942
947
  queryKey: l
943
948
  });
944
- const h = s.getQueryData(l), f = {
945
- ...d,
946
- parentId: u.parentId,
949
+ const u = t.getQueryData(l), f = {
950
+ ...h,
951
+ parentId: d.parentId,
947
952
  children: [],
948
- rights: [`creator:${d == null ? void 0 : d.creator_id}`]
953
+ rights: [`creator:${h == null ? void 0 : h.creator_id}`]
949
954
  };
950
- if (h)
951
- return s.setQueryData(l, (c) => {
952
- if (c) {
955
+ if (u)
956
+ return t.setQueryData(l, (i) => {
957
+ if (i) {
953
958
  const p = {
954
- ...c,
955
- pages: c == null ? void 0 : c.pages.map((y) => ({
959
+ ...i,
960
+ pages: i == null ? void 0 : i.pages.map((y) => ({
956
961
  ...y,
957
962
  folders: [...y.folders, f]
958
963
  }))
959
964
  }, m = nt(r, {
960
- parentId: u.parentId,
965
+ parentId: d.parentId,
961
966
  newFolder: f
962
967
  });
963
968
  return n(m), p;
@@ -966,51 +971,51 @@ const it = () => {
966
971
  }
967
972
  });
968
973
  }, Jt = () => {
969
- const e = k(), s = E(), t = D(), r = z(), {
974
+ const e = k(), t = E(), s = D(), r = z(), {
970
975
  setFolderIds: n,
971
976
  setSelectedFolders: a,
972
977
  setTreeData: o
973
978
  } = T(), {
974
979
  filters: l,
975
- trashed: d
976
- } = t, u = ["context", {
980
+ trashed: h
981
+ } = s, d = ["context", {
977
982
  folderId: l.folder,
978
983
  filters: l,
979
- trashed: d
984
+ trashed: h
980
985
  }];
981
986
  return v({
982
987
  mutationFn: async ({
983
- folderId: h,
988
+ folderId: u,
984
989
  name: f,
985
- parentId: c
986
- }) => await Le({
987
- searchParams: t,
988
- folderId: h,
989
- parentId: c,
990
+ parentId: i
991
+ }) => await Me({
992
+ searchParams: s,
993
+ folderId: u,
994
+ parentId: i,
990
995
  name: f
991
996
  }),
992
- onError(h) {
993
- typeof h == "string" && e.error(S(h));
997
+ onError(u) {
998
+ typeof u == "string" && e.error(S(u));
994
999
  },
995
- onSuccess: async (h, f) => {
996
- if (await s.cancelQueries({
997
- queryKey: u
998
- }), s.getQueryData(u))
999
- return s.setQueryData(u, (p) => {
1000
+ onSuccess: async (u, f) => {
1001
+ if (await t.cancelQueries({
1002
+ queryKey: d
1003
+ }), t.getQueryData(d))
1004
+ return t.setQueryData(d, (p) => {
1000
1005
  if (p) {
1001
1006
  const m = {
1002
1007
  ...p,
1003
1008
  pages: p == null ? void 0 : p.pages.map((g) => ({
1004
1009
  ...g,
1005
- folders: g.folders.map((I) => I.id === h.id ? {
1006
- ...h,
1010
+ folders: g.folders.map((I) => I.id === u.id ? {
1011
+ ...u,
1007
1012
  parentId: f.parentId,
1008
1013
  rights: I.rights
1009
1014
  } : I)
1010
1015
  }))
1011
1016
  }, y = ct(r, {
1012
1017
  folderId: f.folderId,
1013
- newFolder: h
1018
+ newFolder: u
1014
1019
  });
1015
1020
  return o(y), m;
1016
1021
  }
@@ -1021,34 +1026,34 @@ const it = () => {
1021
1026
  }
1022
1027
  });
1023
1028
  }, Xt = (e) => {
1024
- const s = E(), t = D(), {
1029
+ const t = E(), s = D(), {
1025
1030
  setResourceIds: r,
1026
1031
  setSelectedResources: n
1027
1032
  } = T(), {
1028
1033
  filters: a,
1029
1034
  trashed: o
1030
- } = t, l = ["context", {
1035
+ } = s, l = ["context", {
1031
1036
  folderId: a.folder,
1032
1037
  filters: a,
1033
1038
  trashed: o
1034
1039
  }];
1035
- return we({
1040
+ return Se({
1036
1041
  application: e,
1037
1042
  options: {
1038
- onSuccess: async (d, u) => {
1039
- if (await s.cancelQueries({
1043
+ onSuccess: async (h, d) => {
1044
+ if (await t.cancelQueries({
1040
1045
  queryKey: l
1041
- }), s.getQueryData(l))
1042
- return s.setQueryData(l, (f) => {
1046
+ }), t.getQueryData(l))
1047
+ return t.setQueryData(l, (f) => {
1043
1048
  if (f)
1044
1049
  return {
1045
1050
  ...f,
1046
- pages: f == null ? void 0 : f.pages.map((c) => ({
1047
- ...c,
1048
- resources: c.resources.map((p) => {
1049
- if (p.assetId === (u == null ? void 0 : u.resourceId)) {
1051
+ pages: f == null ? void 0 : f.pages.map((i) => ({
1052
+ ...i,
1053
+ resources: i.resources.map((p) => {
1054
+ if (p.assetId === (d == null ? void 0 : d.resourceId)) {
1050
1055
  let m = [`creator:${p.creatorId}`];
1051
- return (u == null ? void 0 : u.rights.length) >= 1 && (m = [...m, ...u.rights.flatMap((y) => y.actions.map((g) => `${y.type}:${y.id}:${g.id}`))]), {
1056
+ return (d == null ? void 0 : d.rights.length) >= 1 && (m = [...m, ...d.rights.flatMap((y) => y.actions.map((g) => `${y.type}:${y.id}:${g.id}`))]), {
1052
1057
  ...p,
1053
1058
  rights: m
1054
1059
  };
@@ -1065,31 +1070,31 @@ const it = () => {
1065
1070
  }
1066
1071
  });
1067
1072
  }, Yt = (e) => {
1068
- const s = E(), t = D(), {
1073
+ const t = E(), s = D(), {
1069
1074
  filters: r,
1070
1075
  trashed: n
1071
- } = t, a = ["context", {
1076
+ } = s, a = ["context", {
1072
1077
  folderId: r.folder,
1073
1078
  filters: r,
1074
1079
  trashed: n
1075
1080
  }];
1076
- return Se({
1081
+ return xe({
1077
1082
  application: e,
1078
1083
  options: {
1079
1084
  onSuccess: async (o, l) => {
1080
- if (await s.cancelQueries({
1085
+ if (await t.cancelQueries({
1081
1086
  queryKey: a
1082
- }), s.getQueryData(a))
1083
- return s.setQueryData(a, (u) => {
1084
- if (u)
1087
+ }), t.getQueryData(a))
1088
+ return t.setQueryData(a, (d) => {
1089
+ if (d)
1085
1090
  return {
1086
- ...u,
1087
- pages: u == null ? void 0 : u.pages.map((h) => ({
1088
- ...h,
1089
- resources: h.resources.map((f) => {
1091
+ ...d,
1092
+ pages: d == null ? void 0 : d.pages.map((u) => ({
1093
+ ...u,
1094
+ resources: u.resources.map((f) => {
1090
1095
  if (f.assetId === (l == null ? void 0 : l.entId)) {
1091
1096
  const {
1092
- name: c,
1097
+ name: i,
1093
1098
  thumbnail: p,
1094
1099
  public: m,
1095
1100
  description: y,
@@ -1100,7 +1105,7 @@ const it = () => {
1100
1105
  ...f,
1101
1106
  ...I,
1102
1107
  // add any custom field
1103
- name: c,
1108
+ name: i,
1104
1109
  thumbnail: typeof p == "string" ? p : URL.createObjectURL(p),
1105
1110
  public: m,
1106
1111
  description: y,
@@ -1117,33 +1122,33 @@ const it = () => {
1117
1122
  });
1118
1123
  };
1119
1124
  const Zt = () => {
1120
- const e = k(), s = E(), t = D(), {
1125
+ const e = k(), t = E(), s = D(), {
1121
1126
  user: r
1122
1127
  } = ce(), {
1123
1128
  appCode: n
1124
1129
  } = M(), a = ["context", {
1125
- folderId: t.filters.folder,
1126
- filters: t.filters,
1127
- trashed: t.trashed
1130
+ folderId: s.filters.folder,
1131
+ filters: s.filters,
1132
+ trashed: s.trashed
1128
1133
  }];
1129
1134
  return v({
1130
1135
  mutationFn: async (o) => await Ve({
1131
- searchParams: t,
1136
+ searchParams: s,
1132
1137
  params: o
1133
1138
  }),
1134
1139
  onError(o) {
1135
1140
  typeof o == "string" && e.error(S(o));
1136
1141
  },
1137
1142
  onSuccess: async (o, l) => {
1138
- var f, c, p;
1139
- await s.cancelQueries({
1143
+ var f, i, p;
1144
+ await t.cancelQueries({
1140
1145
  queryKey: a
1141
1146
  });
1142
- const d = s.getQueryData(a), {
1143
- thumbnail: u
1144
- } = l, h = {
1147
+ const h = t.getQueryData(a), {
1148
+ thumbnail: d
1149
+ } = l, u = {
1145
1150
  ...l,
1146
- thumbnail: u ? URL.createObjectURL(u) : "",
1151
+ thumbnail: d ? URL.createObjectURL(d) : "",
1147
1152
  application: n,
1148
1153
  assetId: o._id || o.entId || "",
1149
1154
  id: o._id || o.entId || "",
@@ -1152,207 +1157,207 @@ const Zt = () => {
1152
1157
  createdAt: Date.now(),
1153
1158
  slug: l.slug || "",
1154
1159
  modifiedAt: ((f = o.modified) == null ? void 0 : f.$date) || "",
1155
- modifierId: ((c = o.author) == null ? void 0 : c.userId) || "",
1160
+ modifierId: ((i = o.author) == null ? void 0 : i.userId) || "",
1156
1161
  modifierName: ((p = o.author) == null ? void 0 : p.username) || "",
1157
1162
  updatedAt: Date.now(),
1158
1163
  trashed: !1,
1159
1164
  rights: [`creator:${r == null ? void 0 : r.userId}`]
1160
1165
  };
1161
- if (d)
1162
- return s.setQueryData(a, (m) => {
1166
+ if (h)
1167
+ return t.setQueryData(a, (m) => {
1163
1168
  if (m)
1164
1169
  return {
1165
1170
  ...m,
1166
1171
  pages: m == null ? void 0 : m.pages.map((y) => ({
1167
1172
  ...y,
1168
- resources: [h, ...y.resources]
1173
+ resources: [u, ...y.resources]
1169
1174
  }))
1170
1175
  };
1171
1176
  });
1172
1177
  }
1173
1178
  });
1174
1179
  }, dt = /* @__PURE__ */ b(async () => await import("./EmptyScreenApp.js")), ut = /* @__PURE__ */ b(async () => await import("./EmptyScreenSearch.js")), ht = /* @__PURE__ */ b(async () => await import("./EmptyScreenError.js")), ft = /* @__PURE__ */ b(async () => await import("./EmptyScreenNoContentInFolder.js")), pt = /* @__PURE__ */ b(async () => await import("./EmptyScreenTrash.js")), mt = /* @__PURE__ */ b(async () => await import("./FoldersList.js")), gt = /* @__PURE__ */ b(async () => await import("./ResourcesList.js")), yt = () => {
1175
- const e = Ye(), s = re(), t = Ze(), r = D(), n = W(), a = z(), o = k(), {
1180
+ const e = Ye(), t = re(), s = Ze(), r = D(), n = V(), a = z(), o = k(), {
1176
1181
  appCode: l
1177
1182
  } = M(), {
1178
- t: d
1183
+ t: h
1179
1184
  } = j(), {
1180
- setSearchParams: u,
1181
- setSearchConfig: h,
1185
+ setSearchParams: d,
1186
+ setSearchConfig: u,
1182
1187
  setTreeData: f
1183
1188
  } = T(), {
1184
- data: c,
1189
+ data: i,
1185
1190
  isError: p,
1186
1191
  error: m,
1187
1192
  isLoading: y,
1188
1193
  isFetching: g,
1189
1194
  fetchNextPage: I
1190
- } = lt(), F = (c == null ? void 0 : c.pages[0].folders.length) === 0, Q = (c == null ? void 0 : c.pages[0].resources.length) === 0, U = F && Q;
1195
+ } = lt(), F = (i == null ? void 0 : i.pages[0].folders.length) === 0, Q = (i == null ? void 0 : i.pages[0].resources.length) === 0, U = F && Q;
1191
1196
  return L(() => {
1192
1197
  var K, R, P;
1193
- if (c) {
1194
- const q = [...((K = c == null ? void 0 : c.pages[0]) == null ? void 0 : K.folders) ?? []];
1195
- (R = c == null ? void 0 : c.pages[0]) != null && R.searchConfig && h(c.pages[0].searchConfig), r.search || ((n == null ? void 0 : n.id) === "default" ? f({
1198
+ if (i) {
1199
+ const q = [...((K = i == null ? void 0 : i.pages[0]) == null ? void 0 : K.folders) ?? []];
1200
+ (R = i == null ? void 0 : i.pages[0]) != null && R.searchConfig && u(i.pages[0].searchConfig), r.search || ((n == null ? void 0 : n.id) === "default" ? f({
1196
1201
  id: C.DEFAULT,
1197
1202
  section: !0,
1198
1203
  children: q.map((B) => new G(B)),
1199
- name: d("explorer.filters.mine", {
1204
+ name: h("explorer.filters.mine", {
1200
1205
  ns: l
1201
1206
  })
1202
- }) : f(ue(a, q, r.filters.folder || C.DEFAULT))), u({
1207
+ }) : f(he(a, q, r.filters.folder || C.DEFAULT))), d({
1203
1208
  ...r,
1204
- pagination: (P = c == null ? void 0 : c.pages[(c == null ? void 0 : c.pages.length) - 1]) == null ? void 0 : P.pagination
1209
+ pagination: (P = i == null ? void 0 : i.pages[(i == null ? void 0 : i.pages.length) - 1]) == null ? void 0 : P.pagination
1205
1210
  });
1206
1211
  }
1207
- }, [c]), L(() => {
1208
- m && typeof m == "string" && o.error(d(m));
1209
- }, [m]), y ? /* @__PURE__ */ i(A, {}) : p ? /* @__PURE__ */ i(O, { fallback: /* @__PURE__ */ i(A, {}), children: /* @__PURE__ */ i(ht, {}) }) : r.search && U ? /* @__PURE__ */ i(O, { fallback: /* @__PURE__ */ i(A, {}), children: /* @__PURE__ */ i(ut, {}) }) : e && U ? /* @__PURE__ */ i(O, { fallback: /* @__PURE__ */ i(A, {}), children: /* @__PURE__ */ i(dt, {}) }) : t && U && !s ? /* @__PURE__ */ i(O, { fallback: /* @__PURE__ */ i(A, {}), children: /* @__PURE__ */ i(ft, {}) }) : s && (c == null ? void 0 : c.pages[0].resources.length) === 0 ? /* @__PURE__ */ i(O, { fallback: /* @__PURE__ */ i(A, {}), children: /* @__PURE__ */ i(pt, {}) }) : /* @__PURE__ */ N(O, { fallback: /* @__PURE__ */ i(A, {}), children: [
1210
- /* @__PURE__ */ i(mt, { data: c, isFetching: g }),
1211
- /* @__PURE__ */ i(gt, { data: c, isFetching: g, fetchNextPage: I })
1212
+ }, [i]), L(() => {
1213
+ m && typeof m == "string" && o.error(h(m));
1214
+ }, [m]), y ? /* @__PURE__ */ c(A, {}) : p ? /* @__PURE__ */ c(O, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(ht, {}) }) : r.search && U ? /* @__PURE__ */ c(O, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(ut, {}) }) : e && U ? /* @__PURE__ */ c(O, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(dt, {}) }) : s && U && !t ? /* @__PURE__ */ c(O, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(ft, {}) }) : t && (i == null ? void 0 : i.pages[0].resources.length) === 0 ? /* @__PURE__ */ c(O, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(pt, {}) }) : /* @__PURE__ */ N(O, { fallback: /* @__PURE__ */ c(A, {}), children: [
1215
+ /* @__PURE__ */ c(mt, { data: i, isFetching: g }),
1216
+ /* @__PURE__ */ c(gt, { data: i, isFetching: g, fetchNextPage: I })
1212
1217
  ] });
1213
1218
  }, It = () => {
1214
1219
  const {
1215
1220
  appCode: e,
1216
- currentApp: s
1221
+ currentApp: t
1217
1222
  } = M(), {
1218
- t
1219
- } = j(), [r, n] = ae(""), a = (h) => {
1220
- if (h === "0") {
1223
+ t: s
1224
+ } = j(), [r, n] = ae(""), a = (u) => {
1225
+ if (u === "0") {
1221
1226
  n("");
1222
1227
  return;
1223
1228
  }
1224
- n(h);
1225
- }, o = W(), l = D(), {
1226
- setSearchParams: d
1229
+ n(u);
1230
+ }, o = V(), l = D(), {
1231
+ setSearchParams: h
1227
1232
  } = T();
1228
1233
  L(() => {
1229
- const h = () => r.includes("1") ? !0 : void 0, f = () => r.includes("2") ? !0 : void 0, c = () => r.includes("7") ? !0 : void 0;
1230
- d({
1234
+ const u = () => r.includes("1") ? !0 : void 0, f = () => r.includes("2") ? !0 : void 0, i = () => r.includes("7") ? !0 : void 0;
1235
+ h({
1231
1236
  ...l,
1232
1237
  filters: {
1233
- owner: h(),
1234
- public: c(),
1238
+ owner: u(),
1239
+ public: i(),
1235
1240
  shared: f(),
1236
1241
  folder: o ? o.id : "default"
1237
1242
  }
1238
1243
  });
1239
- }, [o, d, r]);
1240
- const u = [{
1241
- label: t("explorer.filter.all", {
1244
+ }, [o, h, r]);
1245
+ const d = [{
1246
+ label: s("explorer.filter.all", {
1242
1247
  ns: e
1243
1248
  }),
1244
1249
  value: "0"
1245
1250
  }, {
1246
- label: t("explorer.filter.owner", {
1251
+ label: s("explorer.filter.owner", {
1247
1252
  ns: e
1248
1253
  }),
1249
1254
  value: "1"
1250
1255
  }, {
1251
- label: t("explorer.filter.shared", {
1256
+ label: s("explorer.filter.shared", {
1252
1257
  ns: e
1253
1258
  }),
1254
1259
  value: "2"
1255
- }, ...(s == null ? void 0 : s.displayName) == "exercizer" ? [{
1260
+ }, ...(t == null ? void 0 : t.displayName) == "exercizer" ? [{
1256
1261
  label: "Exercices interactifs",
1257
1262
  value: "3"
1258
- }] : [], ...(s == null ? void 0 : s.displayName) == "exercizer" ? [{
1263
+ }] : [], ...(t == null ? void 0 : t.displayName) == "exercizer" ? [{
1259
1264
  label: "Exercices à rendre",
1260
1265
  value: "4"
1261
- }] : [], ...(s == null ? void 0 : s.displayName) == "pages" ? [{
1266
+ }] : [], ...(t == null ? void 0 : t.displayName) == "pages" ? [{
1262
1267
  label: "Projets publics",
1263
1268
  value: "5"
1264
- }] : [], ...(s == null ? void 0 : s.displayName) == "pages" ? [{
1269
+ }] : [], ...(t == null ? void 0 : t.displayName) == "pages" ? [{
1265
1270
  label: "Projets internes",
1266
1271
  value: "6"
1267
- }] : [], ...(s == null ? void 0 : s.displayName) == "blog" ? [{
1268
- label: t("explorer.filter.public", {
1272
+ }] : [], ...(t == null ? void 0 : t.displayName) == "blog" ? [{
1273
+ label: s("explorer.filter.public", {
1269
1274
  ns: e
1270
1275
  }),
1271
1276
  value: "7"
1272
1277
  }] : []];
1273
1278
  return {
1274
1279
  selectedFilters: r,
1275
- options: u,
1280
+ options: d,
1276
1281
  handleOnSelectFilter: a
1277
1282
  };
1278
1283
  }, wt = () => {
1279
1284
  const {
1280
1285
  appCode: e
1281
1286
  } = M(), {
1282
- t: s
1287
+ t
1283
1288
  } = j(), {
1284
- selectedFilters: t,
1289
+ selectedFilters: s,
1285
1290
  options: r,
1286
1291
  handleOnSelectFilter: n
1287
1292
  } = It(), {
1288
1293
  formRef: a,
1289
1294
  inputSearch: o,
1290
1295
  handleInputSearchChange: l,
1291
- handleKeyPress: d,
1292
- handleSearchSubmit: u
1293
- } = he(), h = t.length > 0 ? t.length : void 0;
1296
+ handleKeyPress: h,
1297
+ handleSearchSubmit: d
1298
+ } = fe(), u = s.length > 0 ? s.length : void 0;
1294
1299
  return /* @__PURE__ */ N("form", { noValidate: !0, className: "bg-light p-16 ps-24 ms-n16 ms-lg-n24 me-n16 position-relative z-3 d-flex gap-8", ref: a, children: [
1295
- /* @__PURE__ */ N(xe, { id: "search", className: "input-group", children: [
1296
- /* @__PURE__ */ i(De, { type: "search", placeholder: s("explorer.label.search", {
1300
+ /* @__PURE__ */ N(De, { id: "search", className: "input-group", children: [
1301
+ /* @__PURE__ */ c(Te, { type: "search", placeholder: t("explorer.label.search", {
1297
1302
  ns: e
1298
- }), size: "lg", noValidationIcon: !0, value: o, onChange: l, onKeyDown: d }),
1299
- /* @__PURE__ */ i(Te, { type: "submit", "aria-label": s("explorer.label.search", {
1303
+ }), size: "lg", noValidationIcon: !0, value: o, onChange: l, onKeyDown: h }),
1304
+ /* @__PURE__ */ c(be, { type: "submit", "aria-label": t("explorer.label.search", {
1300
1305
  ns: e
1301
- }), onClick: u })
1306
+ }), onClick: d })
1302
1307
  ] }),
1303
1308
  /* @__PURE__ */ N($, { placement: "bottom-end", children: [
1304
- /* @__PURE__ */ i($.Trigger, { label: s("explorer.filters"), icon: /* @__PURE__ */ i(Ee, { width: 20 }), variant: "ghost", badgeContent: h }),
1305
- /* @__PURE__ */ i($.Menu, { children: r.map((f) => f.value === "0" ? /* @__PURE__ */ N(ge, { children: [
1306
- /* @__PURE__ */ i($.RadioItem, { value: f.value, model: t, onChange: () => n(f.value), children: f.label }),
1307
- /* @__PURE__ */ i($.Separator, {})
1308
- ] }, "0") : /* @__PURE__ */ i($.RadioItem, { value: f.value, model: t, onChange: () => n(f.value), children: f.label }, f.value)) })
1309
+ /* @__PURE__ */ c($.Trigger, { label: t("explorer.filters"), icon: /* @__PURE__ */ c(Qe, { width: 20 }), variant: "ghost", badgeContent: u }),
1310
+ /* @__PURE__ */ c($.Menu, { children: r.map((f) => f.value === "0" ? /* @__PURE__ */ N(ye, { children: [
1311
+ /* @__PURE__ */ c($.RadioItem, { value: f.value, model: s, onChange: () => n(f.value), children: f.label }),
1312
+ /* @__PURE__ */ c($.Separator, {})
1313
+ ] }, "0") : /* @__PURE__ */ c($.RadioItem, { value: f.value, model: s, onChange: () => n(f.value), children: f.label }, f.value)) })
1309
1314
  ] })
1310
1315
  ] });
1311
1316
  }, St = ({
1312
1317
  id: e,
1313
- selected: s,
1314
- onSelect: t
1318
+ selected: t,
1319
+ onSelect: s
1315
1320
  }) => {
1316
1321
  const {
1317
1322
  t: r
1318
1323
  } = j();
1319
- return /* @__PURE__ */ i("div", { className: "treeview", children: /* @__PURE__ */ i("ul", { role: "tree", className: "m-0 p-0", children: /* @__PURE__ */ i("li", { id: e, role: "treeitem", "aria-selected": s, children: /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i("div", { className: "action-container", children: /* @__PURE__ */ i("div", { onClick: t, role: "button", tabIndex: 0, children: /* @__PURE__ */ N("div", { className: "d-flex align-items-center gap-8 py-8 ps-24", children: [
1320
- /* @__PURE__ */ i(Qe, { width: "20", height: "20" }),
1321
- /* @__PURE__ */ i("span", { children: r("explorer.tree.trash") })
1324
+ return /* @__PURE__ */ c("div", { className: "treeview", children: /* @__PURE__ */ c("ul", { role: "tree", className: "m-0 p-0", children: /* @__PURE__ */ c("li", { id: e, role: "treeitem", "aria-selected": t, children: /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c("div", { className: "action-container", children: /* @__PURE__ */ c("div", { onClick: s, role: "button", tabIndex: 0, children: /* @__PURE__ */ N("div", { className: "d-flex align-items-center gap-8 py-8 ps-24", children: [
1325
+ /* @__PURE__ */ c(qe, { width: "20", height: "20" }),
1326
+ /* @__PURE__ */ c("span", { children: r("explorer.tree.trash") })
1322
1327
  ] }) }) }) }) }) }) });
1323
1328
  }, xt = /* @__PURE__ */ b(async () => await import("./FolderModal.js")), Dt = () => {
1324
- const e = E(), [s, t] = be(), r = z(), n = re(), a = se(), {
1329
+ const e = E(), [t, s] = Fe(), r = z(), n = re(), a = se(), {
1325
1330
  appCode: o
1326
1331
  } = M(), {
1327
1332
  t: l
1328
1333
  } = j(["common", o]), {
1329
- goToTrash: d,
1330
- selectTreeItem: u,
1331
- unfoldTreeItem: h,
1334
+ goToTrash: h,
1335
+ selectTreeItem: d,
1336
+ unfoldTreeItem: u,
1332
1337
  foldTreeItem: f,
1333
- clearSelectedItems: c,
1338
+ clearSelectedItems: i,
1334
1339
  clearSelectedIds: p
1335
1340
  } = T(), m = async (g) => {
1336
- await h(g, e);
1341
+ await u(g, e);
1337
1342
  }, y = () => {
1338
- c(), p(), t();
1343
+ i(), p(), s();
1339
1344
  };
1340
1345
  return /* @__PURE__ */ N(oe, { children: [
1341
- /* @__PURE__ */ i(Fe, { data: r, selectedNodesIds: a, onTreeItemSelect: u, onTreeItemFold: f, onTreeItemUnfold: m }),
1342
- /* @__PURE__ */ i(St, { id: C.BIN, selected: n, onSelect: d }),
1343
- /* @__PURE__ */ i("div", { className: "d-grid my-16", children: /* @__PURE__ */ i(Ce, { disabled: n, type: "button", color: "primary", variant: "outline", leftIcon: /* @__PURE__ */ i(qe, {}), onClick: y, children: l("explorer.folder.new") }) }),
1344
- /* @__PURE__ */ i(O, { fallback: /* @__PURE__ */ i(A, {}), children: s && /* @__PURE__ */ i(xt, { edit: !1, isOpen: s, onSuccess: t, onCancel: t }) })
1346
+ /* @__PURE__ */ c(Ce, { data: r, selectedNodesIds: a, onTreeItemSelect: d, onTreeItemFold: f, onTreeItemUnfold: m }),
1347
+ /* @__PURE__ */ c(St, { id: C.BIN, selected: n, onSelect: h }),
1348
+ /* @__PURE__ */ c("div", { className: "d-grid my-16", children: /* @__PURE__ */ c(Ne, { disabled: n, type: "button", color: "primary", variant: "outline", leftIcon: /* @__PURE__ */ c(Oe, {}), onClick: y, children: l("explorer.folder.new") }) }),
1349
+ /* @__PURE__ */ c(O, { fallback: /* @__PURE__ */ c(A, {}), children: t && /* @__PURE__ */ c(xt, { edit: !1, isOpen: t, onSuccess: s, onCancel: s }) })
1345
1350
  ] });
1346
1351
  }, Tt = /* @__PURE__ */ b(async () => await import("./AppAction.js")), bt = /* @__PURE__ */ b(async () => await import("./Library.js")), Ft = /* @__PURE__ */ b(async () => await import("./ActionBarContainer.js")), Ct = /* @__PURE__ */ b(async () => await import("./DisableModal.js")), Nt = /* @__PURE__ */ b(async () => await import("./TrashModal.js")), Rt = /* @__PURE__ */ b(async () => await import("./OnboardingModal.js")), es = ({
1347
1352
  config: e
1348
1353
  }) => {
1349
- const s = D(), {
1350
- setConfig: t,
1354
+ const t = D(), {
1355
+ setConfig: s,
1351
1356
  setSearchParams: r
1352
1357
  } = T();
1353
1358
  L(() => {
1354
- t(e || {}), r({
1355
- ...s,
1359
+ s(e || {}), r({
1360
+ ...t,
1356
1361
  application: e.app,
1357
1362
  types: e.types
1358
1363
  });
@@ -1365,26 +1370,26 @@ const Zt = () => {
1365
1370
  isTrashedModalOpen: o,
1366
1371
  onTrashedCancel: l
1367
1372
  } = rt(), {
1368
- isActionDisableModalOpen: d,
1369
- onActionDisableCancel: u
1373
+ isActionDisableModalOpen: h,
1374
+ onActionDisableCancel: d
1370
1375
  } = st();
1371
- Ne();
1372
- const h = ne("publish", a), f = ne("create", a);
1376
+ Re();
1377
+ const u = ne("publish", a), f = ne("create", a);
1373
1378
  return e && /* @__PURE__ */ N(oe, { children: [
1374
- /* @__PURE__ */ i(Re, { render: () => f ? /* @__PURE__ */ i(O, { fallback: /* @__PURE__ */ i(A, {}), children: /* @__PURE__ */ i(Tt, {}) }) : null, children: /* @__PURE__ */ i(Pe, { app: n }) }),
1379
+ /* @__PURE__ */ c(Pe, { render: () => f ? /* @__PURE__ */ c(O, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(Tt, {}) }) : null, children: /* @__PURE__ */ c(Ae, { app: n }) }),
1375
1380
  /* @__PURE__ */ N(ee, { className: "flex-grow-1", children: [
1376
- /* @__PURE__ */ i(ee.Col, { sm: "3", lg: "2", xl: "3", className: "border-end pt-16 pe-16 d-none d-lg-block", as: "aside", children: /* @__PURE__ */ N(O, { fallback: /* @__PURE__ */ i(A, {}), children: [
1377
- /* @__PURE__ */ i(Dt, {}),
1378
- h && /* @__PURE__ */ i(bt, {})
1381
+ /* @__PURE__ */ c(ee.Col, { sm: "3", lg: "2", xl: "3", className: "border-end pt-16 pe-16 d-none d-lg-block", as: "aside", children: /* @__PURE__ */ N(O, { fallback: /* @__PURE__ */ c(A, {}), children: [
1382
+ /* @__PURE__ */ c(Dt, {}),
1383
+ u && /* @__PURE__ */ c(bt, {})
1379
1384
  ] }) }),
1380
1385
  /* @__PURE__ */ N(ee.Col, { sm: "4", md: "8", lg: "6", xl: "9", children: [
1381
- /* @__PURE__ */ i(wt, {}),
1382
- /* @__PURE__ */ i(tt, {}),
1383
- /* @__PURE__ */ i(yt, {})
1386
+ /* @__PURE__ */ c(wt, {}),
1387
+ /* @__PURE__ */ c(tt, {}),
1388
+ /* @__PURE__ */ c(yt, {})
1384
1389
  ] }),
1385
- /* @__PURE__ */ N(O, { fallback: /* @__PURE__ */ i(A, {}), children: [
1386
- /* @__PURE__ */ i(Ft, {}),
1387
- /* @__PURE__ */ i(Rt, { id: "showOnboardingTrash", items: [{
1390
+ /* @__PURE__ */ N(O, { fallback: /* @__PURE__ */ c(A, {}), children: [
1391
+ /* @__PURE__ */ c(Ft, {}),
1392
+ /* @__PURE__ */ c(Rt, { id: "showOnboardingTrash", items: [{
1388
1393
  src: "onboarding/illu-trash-menu.svg",
1389
1394
  alt: "explorer.modal.onboarding.trash.screen1.alt",
1390
1395
  text: "explorer.modal.onboarding.trash.screen1.title"
@@ -1402,8 +1407,8 @@ const Zt = () => {
1402
1407
  nextText: "explorer.modal.onboarding.trash.next",
1403
1408
  closeText: "explorer.modal.onboarding.trash.close"
1404
1409
  } }),
1405
- o && /* @__PURE__ */ i(Nt, { isOpen: o, onCancel: l }),
1406
- d && /* @__PURE__ */ i(Ct, { isOpen: d, onCancel: u })
1410
+ o && /* @__PURE__ */ c(Nt, { isOpen: o, onCancel: l }),
1411
+ h && /* @__PURE__ */ c(Ct, { isOpen: h, onCancel: d })
1407
1412
  ] })
1408
1413
  ] })
1409
1414
  ] });
@@ -1411,7 +1416,7 @@ const Zt = () => {
1411
1416
  export {
1412
1417
  es as E,
1413
1418
  it as a,
1414
- W as b,
1419
+ V as b,
1415
1420
  Zt as c,
1416
1421
  D as d,
1417
1422
  re as e,