ode-explorer 1.4.2 → 1.4.8-develop-pedago.202406041429

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