ode-explorer 1.3.2-develop-pedago.202401291510 → 1.3.3-develop.202402061659

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,22 +1,22 @@
1
1
  var he = Object.defineProperty;
2
2
  var fe = (e, t, s) => t in e ? he(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
- var _ = (e, t, s) => (fe(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 pe, useEffect as U, lazy as b, Suspense as v, Fragment as me } from "react";
6
- import { useScrollToTop as ge, useOdeClient as M, IconButton as ye, useToast as q, useUser as Ie, LoadingScreen as A, FormControl as we, Input as Se, SearchButton as xe, Dropdown as $, useToggle as De, TreeView as be, Button as Te, useXitiTrackPageLoad as Fe, isActionAvailable as ne, AppHeader as Ce, Breadcrumb as Ne, Grid as ee } from "@edifice-ui/react";
7
- import { ArrowLeft as Re, Filter as Pe, Delete as Ae, Plus as Ee } from "@edifice-ui/icons";
8
- import { useTranslation as j } from "react-i18next";
9
- import { odeServices as S, FOLDER as C } from "edifice-ts-client";
10
- import { t as D } from "i18next";
11
- import { create as Qe } from "zustand";
12
- import { useQuery as ve, useInfiniteQuery as qe, useQueryClient as k, useMutation as O } from "@tanstack/react-query";
3
+ var $ = (e, t, s) => (fe(e, typeof t != "symbol" ? t + "" : t, s), s);
4
+ import { jsx as c, jsxs as F, Fragment as oe } from "react/jsx-runtime";
5
+ import { useState as ae, useRef as pe, useEffect as L, lazy as x, Suspense as q, Fragment as me } from "react";
6
+ import { useScrollToTop as ge, useOdeClient as U, IconButton as ye, useToast as O, useShareMutation as Ie, useUpdateMutation as Se, useUser as we, LoadingScreen as R, FormControl as xe, Input as De, SearchButton as be, Dropdown as j, useToggle as Te, 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 Qe, Delete as Ee, Plus as qe } from "@edifice-ui/icons";
8
+ import { useTranslation as z } from "react-i18next";
9
+ import { odeServices as A, FOLDER as T } from "edifice-ts-client";
10
+ import { t as P } from "i18next";
11
+ import { create as ve } from "zustand";
12
+ import { useQuery as ke, useInfiniteQuery as Oe, useQueryClient as v, useMutation as M } from "@tanstack/react-query";
13
13
  const ce = async (e) => {
14
- const t = await S.resource(e.application).searchContext(e);
14
+ const t = await A.resource(e.application).searchContext(e);
15
15
  return {
16
16
  ...t,
17
17
  folders: t.folders.filter((s) => !s.trashed)
18
18
  };
19
- }, ke = async ({
19
+ }, Le = async ({
20
20
  searchParams: e,
21
21
  name: t,
22
22
  parentId: s
@@ -27,8 +27,8 @@ const ce = async (e) => {
27
27
  application: e.application,
28
28
  type: e.types[0]
29
29
  };
30
- return await S.resource(e.application).createFolder(r);
31
- }, Oe = async ({
30
+ return await A.resource(e.application).createFolder(r);
31
+ }, Ue = async ({
32
32
  folderId: e,
33
33
  searchParams: t,
34
34
  parentId: s,
@@ -41,8 +41,8 @@ const ce = async (e) => {
41
41
  application: t.application,
42
42
  type: t.types[0]
43
43
  };
44
- return await S.resource(t.application).updateFolder(n);
45
- }, Le = async ({
44
+ return await A.resource(t.application).updateFolder(n);
45
+ }, Me = async ({
46
46
  searchParams: e,
47
47
  resourceIds: t,
48
48
  useAssetIds: s,
@@ -54,8 +54,8 @@ const ce = async (e) => {
54
54
  resourceIds: t,
55
55
  folderIds: r
56
56
  };
57
- return await S.resource(e.application).trashAll(n, s);
58
- }, Ue = async ({
57
+ return await A.resource(e.application).trashAll(n, s);
58
+ }, Be = async ({
59
59
  searchParams: e,
60
60
  resourceIds: t,
61
61
  useAssetIds: s,
@@ -67,8 +67,8 @@ const ce = async (e) => {
67
67
  resourceIds: t,
68
68
  folderIds: r
69
69
  };
70
- return await S.resource(e.application).deleteAll(n, s);
71
- }, Me = async ({
70
+ return await A.resource(e.application).deleteAll(n, s);
71
+ }, Ke = async ({
72
72
  searchParams: e,
73
73
  resourceIds: t,
74
74
  folderIds: s,
@@ -80,8 +80,8 @@ const ce = async (e) => {
80
80
  resourceIds: t,
81
81
  folderIds: s
82
82
  };
83
- return await S.resource(e.application).restoreAll(n, r);
84
- }, Be = async ({
83
+ return await A.resource(e.application).restoreAll(n, r);
84
+ }, $e = async ({
85
85
  searchParams: e,
86
86
  resourceIds: t,
87
87
  folderId: s,
@@ -94,47 +94,23 @@ const ce = async (e) => {
94
94
  resourceIds: t,
95
95
  folderIds: r
96
96
  };
97
- return await S.resource(e.application).moveToFolder(a, n);
98
- }, Ke = async ({
99
- searchParams: e,
100
- resourceId: t,
101
- rights: s
102
- }) => await S.share().saveRights(e.application, t, s), _e = async ({
103
- searchParams: e,
104
- params: t
105
- }) => await S.resource(e.application).update(t), $e = async (e) => await S.rights().sessionHasWorkflowRights(e), je = ({
97
+ return await A.resource(e.application).moveToFolder(a, n);
98
+ };
99
+ const je = async (e) => await A.rights().sessionHasWorkflowRights(e), ze = ({
106
100
  searchParams: e,
107
101
  assetId: t
108
102
  }) => {
109
- const s = S.resource(e.application).getViewUrl(t);
103
+ const s = A.resource(e.application).getViewUrl(t);
110
104
  window.open(s, "_self");
111
- }, ze = ({
105
+ }, _e = ({
112
106
  searchParams: e,
113
107
  params: t
114
- }) => S.resource(e.application).create(t), Ve = ({
108
+ }) => A.resource(e.application).create(t), Ve = ({
115
109
  searchParams: e,
116
110
  assetId: t
117
111
  }) => {
118
- const s = S.resource(e.application).getPrintUrl(t);
112
+ const s = A.resource(e.application).getPrintUrl(t);
119
113
  return window.open(s, "_blank");
120
- }, Us = ({
121
- searchParams: e,
122
- folderId: t
123
- }) => {
124
- const s = S.resource(e.application).getFormUrl(t);
125
- return window.open(s, "_self");
126
- }, Ms = ({
127
- searchParams: e,
128
- assetId: t
129
- }) => {
130
- const s = S.resource(e.application).getEditUrl(t);
131
- return window.open(s, "_self");
132
- }, Bs = ({
133
- searchParams: e,
134
- assetId: t
135
- }) => {
136
- const s = S.resource(e.application).getExportUrl(t);
137
- return window.open(s, "_self");
138
114
  };
139
115
  function se(e) {
140
116
  return e.filter((t, s) => e.indexOf(t) === s);
@@ -147,7 +123,7 @@ function V(e, t) {
147
123
  function He(e, t) {
148
124
  var r;
149
125
  const s = V(e, t);
150
- 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];
126
+ return (r = s == null ? void 0 : s.folder) != null && r.ancestors ? [...(s == null ? void 0 : s.folder.ancestors) || [], e] : e === T.BIN ? [T.BIN] : [T.DEFAULT];
151
127
  }
152
128
  function ie(e, t) {
153
129
  return t.id === e && t.children ? t.children.length > 0 : t.children ? t.children.some((s) => ie(t.id, s)) : !1;
@@ -173,15 +149,15 @@ function le(e, t, s) {
173
149
  }
174
150
  class G {
175
151
  constructor(t) {
176
- _(this, "id");
177
- _(this, "name");
178
- _(this, "childNumber");
179
- _(this, "section", !1);
180
- _(this, "children", []);
152
+ $(this, "id");
153
+ $(this, "name");
154
+ $(this, "childNumber");
155
+ $(this, "section", !1);
156
+ $(this, "children", []);
181
157
  this.folder = t, this.id = t.id, this.name = t.name, this.childNumber = t.childNumber;
182
158
  }
183
159
  }
184
- const de = (e, t, s) => H(e, (r) => (r.id === s && (r.children = t == null ? void 0 : t.map((n) => new G(n))), r)), w = Qe()((e, t) => ({
160
+ const de = (e, t, s) => H(e, (r) => (r.id === s && (r.children = t == null ? void 0 : t.map((n) => new G(n))), r)), S = ve()((e, t) => ({
185
161
  config: null,
186
162
  searchConfig: {
187
163
  minLength: 1
@@ -206,8 +182,8 @@ const de = (e, t, s) => H(e, (r) => (r.id === s && (r.children = t == null ? voi
206
182
  trashed: !1
207
183
  },
208
184
  treeData: {
209
- id: C.DEFAULT,
210
- name: D("explorer.filters.mine"),
185
+ id: T.DEFAULT,
186
+ name: P("explorer.filters.mine"),
211
187
  section: !0,
212
188
  children: []
213
189
  },
@@ -313,7 +289,7 @@ const de = (e, t, s) => H(e, (r) => (r.id === s && (r.children = t == null ? voi
313
289
  const {
314
290
  searchParams: r
315
291
  } = t();
316
- je({
292
+ ze({
317
293
  searchParams: r,
318
294
  assetId: s.assetId
319
295
  });
@@ -346,13 +322,13 @@ const de = (e, t, s) => H(e, (r) => (r.id === s && (r.children = t == null ? voi
346
322
  const {
347
323
  searchParams: n,
348
324
  treeData: a
349
- } = t(), o = n.filters.folder, l = He(s, a), h = se([...l, s]);
350
- o !== s && e((d) => ({
351
- ...d,
325
+ } = t(), o = n.filters.folder, l = He(s, a), f = se([...l, s]);
326
+ o !== s && e((u) => ({
327
+ ...u,
352
328
  // reset selection when changing folder
353
329
  folderIds: [],
354
330
  resourceIds: [],
355
- selectedNodesIds: h,
331
+ selectedNodesIds: f,
356
332
  currentFolder: r || {
357
333
  id: s
358
334
  },
@@ -363,7 +339,7 @@ const de = (e, t, s) => H(e, (r) => (r.id === s && (r.children = t == null ? voi
363
339
  ...n.filters,
364
340
  folder: s
365
341
  },
366
- trashed: s === C.BIN
342
+ trashed: s === T.BIN
367
343
  }
368
344
  }));
369
345
  },
@@ -399,10 +375,10 @@ const de = (e, t, s) => H(e, (r) => (r.id === s && (r.children = t == null ? voi
399
375
  trashed: !1
400
376
  }]);
401
377
  e((l) => {
402
- var h;
378
+ var f;
403
379
  return {
404
380
  ...l,
405
- treeData: de(n, (h = o == null ? void 0 : o.pages[0]) == null ? void 0 : h.folders, s || C.DEFAULT)
381
+ treeData: de(n, (f = o == null ? void 0 : o.pages[0]) == null ? void 0 : f.folders, s || T.DEFAULT)
406
382
  };
407
383
  });
408
384
  }
@@ -438,7 +414,7 @@ const de = (e, t, s) => H(e, (r) => (r.id === s && (r.children = t == null ? voi
438
414
  const o = V(s[a - 2], r);
439
415
  n({
440
416
  folder: o,
441
- folderId: (o == null ? void 0 : o.id) || C.DEFAULT
417
+ folderId: (o == null ? void 0 : o.id) || T.DEFAULT
442
418
  });
443
419
  },
444
420
  goToTrash: () => e((s) => ({
@@ -452,82 +428,82 @@ const de = (e, t, s) => H(e, (r) => (r.id === s && (r.children = t == null ? voi
452
428
  ...s.searchParams,
453
429
  search: void 0,
454
430
  filters: {
455
- folder: C.BIN
431
+ folder: T.BIN
456
432
  },
457
433
  trashed: !0
458
434
  },
459
435
  currentFolder: {
460
- id: C.BIN
436
+ id: T.BIN
461
437
  }
462
438
  }))
463
439
  }
464
- })), T = () => w((e) => e.searchParams), te = () => w((e) => e.selectedNodesIds), z = () => w((e) => e.treeData), Ks = () => w((e) => e.selectedFolders), _s = () => w((e) => e.selectedResources), We = () => 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)), W = () => w((e) => e.currentFolder), x = () => w((e) => e.updaters), re = () => {
440
+ })), D = () => S((e) => e.searchParams), te = () => S((e) => e.selectedNodesIds), _ = () => S((e) => e.treeData), Us = () => S((e) => e.selectedFolders), Ms = () => S((e) => e.selectedResources), We = () => S((e) => e.searchConfig), J = () => S((e) => e.folderIds), X = () => S((e) => e.resourceIds), Y = () => S((e) => e.selectedResources.map((t) => t.assetId)), Z = () => S((e) => e.selectedResources.filter((t) => t.assetId === t.id)), W = () => S((e) => e.currentFolder), w = () => S((e) => e.updaters), re = () => {
465
441
  const e = W();
466
- return (e == null ? void 0 : e.id) === C.BIN;
467
- }, Ge = () => w((e) => e.resourceIsTrash), Je = () => w((e) => e.resourceActionDisable), Xe = () => {
442
+ return (e == null ? void 0 : e.id) === T.BIN;
443
+ }, Ge = () => S((e) => e.resourceIsTrash), Je = () => S((e) => e.resourceActionDisable), Xe = () => {
468
444
  const e = W();
469
445
  return (e == null ? void 0 : e.id) === "default";
470
- }, Ye = () => te().length > 1, Ze = () => w((e) => e.status), ue = () => {
471
- const e = T(), [t, s] = ae(""), r = We(), n = Ze(), a = pe(null), {
446
+ }, Ye = () => te().length > 1, Ze = () => S((e) => e.status), ue = () => {
447
+ const e = D(), [t, s] = ae(""), r = We(), n = Ze(), a = pe(null), {
472
448
  setSearchParams: o
473
- } = x(), l = (u) => {
474
- const f = u.target.value;
475
- s(f.toString());
476
- }, h = (u) => {
477
- (u.key === "Enter" || u.key === "Return") && (u.preventDefault(), o({
449
+ } = w(), l = (d) => {
450
+ const h = d.target.value;
451
+ s(h.toString());
452
+ }, f = (d) => {
453
+ (d.key === "Enter" || d.key === "Return") && (d.preventDefault(), o({
478
454
  search: t || void 0
479
455
  }));
480
- }, d = (u) => {
481
- u.preventDefault(), o({
456
+ }, u = (d) => {
457
+ d.preventDefault(), o({
482
458
  search: t || void 0
483
459
  });
484
460
  };
485
- return U(() => {
486
- const f = t.length == 0 || t.length >= r.minLength ? {
461
+ return L(() => {
462
+ const h = t.length == 0 || t.length >= r.minLength ? {
487
463
  search: t || void 0
488
464
  } : {};
489
465
  o({
490
466
  ...e,
491
- ...f
467
+ ...h
492
468
  });
493
- }, [t, r.minLength]), U(() => {
469
+ }, [t, r.minLength]), L(() => {
494
470
  n === "select" && s("");
495
- }, [n]), U(() => {
471
+ }, [n]), L(() => {
496
472
  s(() => {
497
- var u;
498
- return ((u = e.search) == null ? void 0 : u.toString()) ?? "";
473
+ var d;
474
+ return ((d = e.search) == null ? void 0 : d.toString()) ?? "";
499
475
  });
500
476
  }, [e]), {
501
477
  formRef: a,
502
478
  inputSearch: t,
503
479
  handleInputSearchChange: l,
504
- handleKeyPress: h,
505
- handleSearchSubmit: d
480
+ handleKeyPress: f,
481
+ handleSearchSubmit: u
506
482
  };
507
483
  };
508
484
  function es() {
509
485
  const {
510
486
  appCode: e
511
- } = M(), {
487
+ } = U(), {
512
488
  gotoPreviousFolder: t
513
- } = x(), {
489
+ } = w(), {
514
490
  t: s
515
- } = j(), {
491
+ } = z(), {
516
492
  inputSearch: r
517
- } = ue(), n = te(), a = re(), o = W(), l = s("explorer.tree.trash"), h = s("explorer.tree.search"), d = s("explorer.filters.mine", {
493
+ } = ue(), n = te(), a = re(), o = W(), l = s("explorer.tree.trash"), f = s("explorer.tree.search"), u = s("explorer.filters.mine", {
518
494
  ns: e
519
- }), u = (o == null ? void 0 : o.name) || d;
520
- return /* @__PURE__ */ c("div", { className: "py-16", children: n.length > 1 && !a ? /* @__PURE__ */ N("div", { className: "d-flex align-items-center gap-8", children: [
521
- /* @__PURE__ */ c(ye, { icon: /* @__PURE__ */ c(Re, {}), variant: "ghost", color: "tertiary", "aria-label": s("back"), className: "ms-n16", onClick: t }),
522
- /* @__PURE__ */ c("p", { className: "body py-8 text-truncate", children: /* @__PURE__ */ c("strong", { children: u }) })
523
- ] }) : /* @__PURE__ */ c("h2", { className: "body py-8 fw-bold", children: r.length !== 0 ? h : a ? l : d }) });
495
+ }), d = (o == null ? void 0 : o.name) || u;
496
+ return /* @__PURE__ */ c("div", { className: "py-16", children: n.length > 1 && !a ? /* @__PURE__ */ F("div", { className: "d-flex align-items-center gap-8", children: [
497
+ /* @__PURE__ */ c(ye, { icon: /* @__PURE__ */ c(Ae, {}), variant: "ghost", color: "tertiary", "aria-label": s("back"), className: "ms-n16", onClick: t }),
498
+ /* @__PURE__ */ c("p", { className: "body py-8 text-truncate", children: /* @__PURE__ */ c("strong", { children: d }) })
499
+ ] }) : /* @__PURE__ */ c("h2", { className: "body py-8 fw-bold", children: r.length !== 0 ? f : a ? l : u }) });
524
500
  }
525
501
  const ss = () => {
526
502
  const e = Je(), {
527
503
  clearSelectedIds: t,
528
504
  setResourceActionDisable: s,
529
505
  clearSelectedItems: r
530
- } = x();
506
+ } = w();
531
507
  return {
532
508
  isActionDisableModalOpen: e,
533
509
  onActionDisableCancel: () => {
@@ -539,7 +515,7 @@ const ss = () => {
539
515
  clearSelectedIds: t,
540
516
  setResourceIsTrash: s,
541
517
  clearSelectedItems: r
542
- } = x();
518
+ } = w();
543
519
  return {
544
520
  isTrashedModalOpen: e,
545
521
  onTrashedCancel: () => {
@@ -581,21 +557,21 @@ function os(e, {
581
557
  return H(e, (r, n) => {
582
558
  var a, o;
583
559
  if (t === r.id) {
584
- const l = [...((a = r.folder) == null ? void 0 : a.ancestors) || []], h = se([...l, r.id]), d = [...r.children || []], u = ((o = r.children) == null ? void 0 : o.map((i) => i.id)) || [];
560
+ const l = [...((a = r.folder) == null ? void 0 : a.ancestors) || []], f = se([...l, r.id]), u = [...r.children || []], d = ((o = r.children) == null ? void 0 : o.map((i) => i.id)) || [];
585
561
  for (const i of s)
586
- if (!u.includes(i)) {
562
+ if (!d.includes(i)) {
587
563
  const p = V(i, e);
588
- p && d.push({
564
+ p && u.push({
589
565
  ...p,
590
566
  folder: {
591
567
  ...p == null ? void 0 : p.folder,
592
- ancestors: h
568
+ ancestors: f
593
569
  }
594
570
  });
595
571
  }
596
572
  return {
597
573
  ...r,
598
- children: d
574
+ children: u
599
575
  };
600
576
  } else
601
577
  return s.includes(r.id) && t !== (n == null ? void 0 : n.id) ? void 0 : r;
@@ -608,12 +584,12 @@ function as(e, {
608
584
  return H(e, (r) => r.id === t ? new G(s) : r);
609
585
  }
610
586
  const cs = () => {
611
- const e = w((t) => t.config);
612
- return ve({
587
+ const e = S((t) => t.config);
588
+ return ke({
613
589
  queryKey: ["actions"],
614
590
  queryFn: async () => {
615
591
  const t = e == null ? void 0 : e.actions.map((r) => r.workflow);
616
- return await $e(t);
592
+ return await je(t);
617
593
  },
618
594
  select: (t) => e == null ? void 0 : e.actions.map((s) => ({
619
595
  ...s,
@@ -623,7 +599,7 @@ const cs = () => {
623
599
  enabled: !!e
624
600
  });
625
601
  }, is = () => {
626
- const e = w((o) => o.config), t = T(), {
602
+ const e = S((o) => o.config), t = D(), {
627
603
  filters: s,
628
604
  trashed: r,
629
605
  search: n
@@ -633,7 +609,7 @@ const cs = () => {
633
609
  trashed: r,
634
610
  search: n
635
611
  }];
636
- return qe({
612
+ return Oe({
637
613
  queryKey: a,
638
614
  queryFn: async ({
639
615
  pageParam: o
@@ -646,18 +622,19 @@ const cs = () => {
646
622
  startIdx: o
647
623
  }
648
624
  }),
625
+ staleTime: 5e3,
649
626
  initialPageParam: 0,
650
627
  enabled: !!e,
651
628
  retry: !1,
652
629
  getNextPageParam: (o) => o.pagination.startIdx + o.pagination.pageSize
653
630
  });
654
- }, $s = () => {
655
- const e = q(), t = k(), s = T(), r = z(), n = J(), a = Y(), o = X(), l = Z().length > 0, h = l ? a : o, {
656
- clearSelectedItems: d,
657
- clearSelectedIds: u,
658
- setTreeData: f,
631
+ }, Bs = () => {
632
+ const e = O(), t = v(), s = D(), r = _(), n = J(), a = Y(), o = X(), l = Z().length > 0, f = l ? a : o, {
633
+ clearSelectedItems: u,
634
+ clearSelectedIds: d,
635
+ setTreeData: h,
659
636
  setSearchParams: i
660
- } = x(), {
637
+ } = w(), {
661
638
  filters: p,
662
639
  trashed: m
663
640
  } = s, y = ["context", {
@@ -665,63 +642,63 @@ const cs = () => {
665
642
  filters: p,
666
643
  trashed: m
667
644
  }];
668
- return O({
669
- mutationFn: async () => await Le({
645
+ return M({
646
+ mutationFn: async () => await Me({
670
647
  searchParams: s,
671
648
  folderIds: n,
672
- resourceIds: h,
649
+ resourceIds: f,
673
650
  useAssetIds: l
674
651
  }),
675
652
  onError(g) {
676
- typeof g == "string" && e.error(D(g));
653
+ typeof g == "string" && e.error(P(g));
677
654
  },
678
655
  onSuccess: async (g) => {
679
656
  if (await t.cancelQueries({
680
657
  queryKey: y
681
658
  }), t.getQueryData(y))
682
- return e.success(D("explorer.trash.title")), t.setQueryData(y, (F) => {
683
- var E;
684
- if (F) {
685
- const L = {
686
- ...F,
687
- pages: F == null ? void 0 : F.pages.map((R) => {
688
- var P;
659
+ return e.success(P("explorer.trash.title")), t.setQueryData(y, (b) => {
660
+ var Q;
661
+ if (b) {
662
+ const k = {
663
+ ...b,
664
+ pages: b == null ? void 0 : b.pages.map((C) => {
665
+ var N;
689
666
  return {
690
- ...R,
691
- folders: R.folders.filter((Q) => !n.includes(Q.id)),
667
+ ...C,
668
+ folders: C.folders.filter((E) => !n.includes(E.id)),
692
669
  pagination: {
693
- ...R.pagination,
670
+ ...C.pagination,
694
671
  // @ts-ignore
695
- maxIdx: ((P = R == null ? void 0 : R.pagination) == null ? void 0 : P.maxIdx) - g.resources.length
672
+ maxIdx: ((N = C == null ? void 0 : C.pagination) == null ? void 0 : N.maxIdx) - g.resources.length
696
673
  },
697
- resources: R.resources.filter((Q) => l ? !a.includes(Q.assetId) : !h.includes(Q.id))
674
+ resources: C.resources.filter((E) => l ? !a.includes(E.assetId) : !f.includes(E.id))
698
675
  };
699
676
  })
700
677
  }, B = ns(r, {
701
678
  folders: n
702
679
  });
703
- return f(B), i({
680
+ return h(B), i({
704
681
  ...s,
705
682
  pagination: {
706
683
  ...s.pagination,
707
684
  // @ts-ignore
708
- maxIdx: ((E = s.pagination) == null ? void 0 : E.maxIdx) - g.resources.length
685
+ maxIdx: ((Q = s.pagination) == null ? void 0 : Q.maxIdx) - g.resources.length
709
686
  }
710
- }), L;
687
+ }), k;
711
688
  }
712
689
  });
713
690
  },
714
691
  onSettled: () => {
715
- d(), u();
692
+ u(), d();
716
693
  }
717
694
  });
718
- }, js = () => {
719
- const e = q(), t = k(), s = T(), r = J(), n = Y(), a = X(), o = Z().length > 0, l = o ? n : a, {
720
- setFolderIds: h,
721
- setResourceIds: d,
722
- setSelectedResources: u,
723
- setSelectedFolders: f
724
- } = x(), {
695
+ }, Ks = () => {
696
+ const e = O(), t = v(), s = D(), r = J(), n = Y(), a = X(), o = Z().length > 0, l = o ? n : a, {
697
+ setFolderIds: f,
698
+ setResourceIds: u,
699
+ setSelectedResources: d,
700
+ setSelectedFolders: h
701
+ } = w(), {
725
702
  filters: i,
726
703
  trashed: p
727
704
  } = s, m = ["context", {
@@ -729,63 +706,63 @@ const cs = () => {
729
706
  filters: i,
730
707
  trashed: p
731
708
  }];
732
- return O({
733
- mutationFn: async () => await Me({
709
+ return M({
710
+ mutationFn: async () => await Ke({
734
711
  searchParams: s,
735
712
  folderIds: r,
736
713
  resourceIds: l,
737
714
  useAssetIds: o
738
715
  }),
739
716
  onError(y) {
740
- typeof y == "string" && e.error(D(y));
717
+ typeof y == "string" && e.error(P(y));
741
718
  },
742
719
  onSuccess: async () => {
743
720
  if (await t.cancelQueries({
744
721
  queryKey: m
745
722
  }), t.getQueryData(m))
746
- return e.success(D("explorer.trash.toast")), t.setQueryData(m, (g) => {
723
+ return e.success(P("explorer.trash.toast")), t.setQueryData(m, (g) => {
747
724
  if (g)
748
725
  return {
749
726
  ...g,
750
727
  pages: g == null ? void 0 : g.pages.map((I) => ({
751
728
  ...I,
752
- folders: I.folders.filter((F) => !r.includes(F.id)),
753
- resources: I.resources.filter((F) => o ? !n.includes(F.assetId) : !l.includes(F.id))
729
+ folders: I.folders.filter((b) => !r.includes(b.id)),
730
+ resources: I.resources.filter((b) => o ? !n.includes(b.assetId) : !l.includes(b.id))
754
731
  }))
755
732
  };
756
733
  });
757
734
  },
758
735
  onSettled: () => {
759
- d([]), u([]), h([]), f([]);
736
+ u([]), d([]), f([]), h([]);
760
737
  }
761
738
  });
762
- }, zs = () => {
763
- const e = q(), t = k(), s = T(), r = J(), n = Y(), a = X(), o = Z().length > 0, l = o ? n : a, {
764
- clearSelectedItems: h,
765
- clearSelectedIds: d
766
- } = x(), {
767
- filters: u,
768
- trashed: f
739
+ }, $s = () => {
740
+ const e = O(), t = v(), s = D(), r = J(), n = Y(), a = X(), o = Z().length > 0, l = o ? n : a, {
741
+ clearSelectedItems: f,
742
+ clearSelectedIds: u
743
+ } = w(), {
744
+ filters: d,
745
+ trashed: h
769
746
  } = s, i = ["context", {
770
- folderId: u.folder,
771
- filters: u,
772
- trashed: f
747
+ folderId: d.folder,
748
+ filters: d,
749
+ trashed: h
773
750
  }];
774
- return O({
775
- mutationFn: async () => await Ue({
751
+ return M({
752
+ mutationFn: async () => await Be({
776
753
  searchParams: s,
777
754
  folderIds: r,
778
755
  resourceIds: l,
779
756
  useAssetIds: o
780
757
  }),
781
758
  onError(p) {
782
- typeof p == "string" && e.error(D(p));
759
+ typeof p == "string" && e.error(P(p));
783
760
  },
784
761
  onSuccess: async () => {
785
762
  if (await t.cancelQueries({
786
763
  queryKey: i
787
764
  }), t.getQueryData(i))
788
- return e.success(D("explorer.removed.from.trash")), t.setQueryData(i, (m) => {
765
+ return e.success(P("explorer.removed.from.trash")), t.setQueryData(i, (m) => {
789
766
  if (m)
790
767
  return {
791
768
  ...m,
@@ -798,16 +775,16 @@ const cs = () => {
798
775
  });
799
776
  },
800
777
  onSettled: () => {
801
- h(), d();
778
+ f(), u();
802
779
  }
803
780
  });
804
- }, Vs = () => {
805
- const e = q(), t = k(), s = T(), r = z(), n = J(), a = Y(), o = X(), l = Z().length > 0, h = l ? a : o, {
806
- clearSelectedIds: d,
807
- clearSelectedItems: u,
808
- setTreeData: f,
781
+ }, js = () => {
782
+ const e = O(), t = v(), s = D(), r = _(), n = J(), a = Y(), o = X(), l = Z().length > 0, f = l ? a : o, {
783
+ clearSelectedIds: u,
784
+ clearSelectedItems: d,
785
+ setTreeData: h,
809
786
  setSearchParams: i
810
- } = x(), {
787
+ } = w(), {
811
788
  filters: p,
812
789
  trashed: m
813
790
  } = s, y = ["context", {
@@ -815,60 +792,60 @@ const cs = () => {
815
792
  filters: p,
816
793
  trashed: m
817
794
  }];
818
- return O({
819
- mutationFn: async (g) => await Be({
795
+ return M({
796
+ mutationFn: async (g) => await $e({
820
797
  searchParams: s,
821
798
  folderId: g,
822
799
  folderIds: n,
823
- resourceIds: h,
800
+ resourceIds: f,
824
801
  useAssetIds: l
825
802
  }),
826
803
  onError(g) {
827
- typeof g == "string" && e.error(D(g));
804
+ typeof g == "string" && e.error(P(g));
828
805
  },
829
806
  onSuccess: async (g, I) => {
830
807
  if (t.getQueryData(y))
831
- return t.setQueryData(y, (E) => {
832
- var L;
833
- if (E) {
808
+ return t.setQueryData(y, (Q) => {
809
+ var k;
810
+ if (Q) {
834
811
  const B = os(r, {
835
812
  destinationId: I,
836
813
  folders: n
837
- }), R = {
838
- ...E,
839
- pages: E == null ? void 0 : E.pages.map((P) => {
840
- var Q;
814
+ }), C = {
815
+ ...Q,
816
+ pages: Q == null ? void 0 : Q.pages.map((N) => {
817
+ var E;
841
818
  return {
842
- ...P,
843
- folders: P.folders.filter((K) => !n.includes(K.id)),
819
+ ...N,
820
+ folders: N.folders.filter((K) => !n.includes(K.id)),
844
821
  pagination: {
845
- ...P.pagination,
822
+ ...N.pagination,
846
823
  // @ts-ignore
847
- maxIdx: ((Q = P.pagination) == null ? void 0 : Q.maxIdx) - g.resources.length
824
+ maxIdx: ((E = N.pagination) == null ? void 0 : E.maxIdx) - g.resources.length
848
825
  },
849
- resources: P.resources.filter((K) => l ? !a.includes(K.assetId) : !h.includes(K.id))
826
+ resources: N.resources.filter((K) => l ? !a.includes(K.assetId) : !f.includes(K.id))
850
827
  };
851
828
  })
852
829
  };
853
- return f(B), i({
830
+ return h(B), i({
854
831
  ...s,
855
832
  pagination: {
856
833
  ...s.pagination,
857
834
  // @ts-ignore
858
- maxIdx: ((L = s.pagination) == null ? void 0 : L.maxIdx) - g.resources.length
835
+ maxIdx: ((k = s.pagination) == null ? void 0 : k.maxIdx) - g.resources.length
859
836
  }
860
- }), R;
837
+ }), C;
861
838
  }
862
839
  });
863
840
  },
864
841
  onSettled: () => {
865
- u(), d();
842
+ d(), u();
866
843
  }
867
844
  });
868
- }, Hs = () => {
869
- const e = q(), t = k(), s = T(), r = z(), {
845
+ }, zs = () => {
846
+ const e = O(), t = v(), s = D(), r = _(), {
870
847
  setTreeData: n
871
- } = x(), {
848
+ } = w(), {
872
849
  filters: a,
873
850
  trashed: o
874
851
  } = s, l = ["context", {
@@ -876,92 +853,92 @@ const cs = () => {
876
853
  filters: a,
877
854
  trashed: o
878
855
  }];
879
- return O({
856
+ return M({
880
857
  mutationFn: async ({
881
- name: h,
882
- parentId: d
883
- }) => await ke({
858
+ name: f,
859
+ parentId: u
860
+ }) => await Le({
884
861
  searchParams: s,
885
- name: h,
886
- parentId: d
862
+ name: f,
863
+ parentId: u
887
864
  }),
888
- onError(h) {
889
- typeof h == "string" && e.error(D(h));
865
+ onError(f) {
866
+ typeof f == "string" && e.error(P(f));
890
867
  },
891
- onSuccess: async (h, d) => {
868
+ onSuccess: async (f, u) => {
892
869
  await t.cancelQueries({
893
870
  queryKey: l
894
871
  });
895
- const u = t.getQueryData(l), f = {
896
- ...h,
897
- parentId: d.parentId,
872
+ const d = t.getQueryData(l), h = {
873
+ ...f,
874
+ parentId: u.parentId,
898
875
  children: [],
899
- rights: [`creator:${h == null ? void 0 : h.creator_id}`]
876
+ rights: [`creator:${f == null ? void 0 : f.creator_id}`]
900
877
  };
901
- if (u)
878
+ if (d)
902
879
  return t.setQueryData(l, (i) => {
903
880
  if (i) {
904
881
  const p = {
905
882
  ...i,
906
883
  pages: i == null ? void 0 : i.pages.map((y) => ({
907
884
  ...y,
908
- folders: [...y.folders, f]
885
+ folders: [...y.folders, h]
909
886
  }))
910
887
  }, m = rs(r, {
911
- parentId: d.parentId,
912
- newFolder: f
888
+ parentId: u.parentId,
889
+ newFolder: h
913
890
  });
914
891
  return n(m), p;
915
892
  }
916
893
  });
917
894
  }
918
895
  });
919
- }, Ws = () => {
920
- const e = q(), t = k(), s = T(), r = z(), {
896
+ }, _s = () => {
897
+ const e = O(), t = v(), s = D(), r = _(), {
921
898
  setFolderIds: n,
922
899
  setSelectedFolders: a,
923
900
  setTreeData: o
924
- } = x(), {
901
+ } = w(), {
925
902
  filters: l,
926
- trashed: h
927
- } = s, d = ["context", {
903
+ trashed: f
904
+ } = s, u = ["context", {
928
905
  folderId: l.folder,
929
906
  filters: l,
930
- trashed: h
907
+ trashed: f
931
908
  }];
932
- return O({
909
+ return M({
933
910
  mutationFn: async ({
934
- folderId: u,
935
- name: f,
911
+ folderId: d,
912
+ name: h,
936
913
  parentId: i
937
- }) => await Oe({
914
+ }) => await Ue({
938
915
  searchParams: s,
939
- folderId: u,
916
+ folderId: d,
940
917
  parentId: i,
941
- name: f
918
+ name: h
942
919
  }),
943
- onError(u) {
944
- typeof u == "string" && e.error(D(u));
920
+ onError(d) {
921
+ typeof d == "string" && e.error(P(d));
945
922
  },
946
- onSuccess: async (u, f) => {
923
+ onSuccess: async (d, h) => {
947
924
  if (await t.cancelQueries({
948
- queryKey: d
949
- }), t.getQueryData(d))
950
- return t.setQueryData(d, (p) => {
925
+ queryKey: u
926
+ }), t.getQueryData(u))
927
+ return t.setQueryData(u, (p) => {
951
928
  if (p) {
952
929
  const m = {
953
930
  ...p,
954
931
  pages: p == null ? void 0 : p.pages.map((g) => ({
955
932
  ...g,
956
- folders: g.folders.map((I) => I.id === u.id ? {
957
- ...u,
958
- parentId: f.parentId,
933
+ folders: g.folders.map((I) => I.id === d.id ? {
934
+ ...d,
935
+ parentId: h.parentId,
959
936
  rights: I.rights
960
937
  } : I)
961
938
  }))
962
939
  }, y = as(r, {
963
- folderId: f.folderId,
964
- newFolder: u
940
+ folderId: h.folderId,
941
+ newFolder: d
965
942
  });
966
943
  return o(y), m;
967
944
  }
@@ -971,11 +948,11 @@ const cs = () => {
971
948
  n([]), a([]);
972
949
  }
973
950
  });
974
- }, Gs = () => {
975
- const e = q(), t = k(), s = T(), {
951
+ }, Vs = (e) => {
952
+ const t = v(), s = D(), {
976
953
  setResourceIds: r,
977
954
  setSelectedResources: n
978
- } = x(), {
955
+ } = w(), {
979
956
  filters: a,
980
957
  trashed: o
981
958
  } = s, l = ["context", {
@@ -983,48 +960,40 @@ const cs = () => {
983
960
  filters: a,
984
961
  trashed: o
985
962
  }];
986
- return O({
987
- mutationFn: async ({
988
- resourceId: h,
989
- rights: d
990
- }) => await Ke({
991
- searchParams: s,
992
- resourceId: h,
993
- rights: d
994
- }),
995
- onError(h) {
996
- typeof h == "string" && e.error(D("explorer.shared.status.error"));
997
- },
998
- onSuccess: async (h, d) => {
999
- if (await t.cancelQueries({
1000
- queryKey: l
1001
- }), t.getQueryData(l))
1002
- return e.success(D("explorer.shared.status.saved")), t.setQueryData(l, (f) => {
1003
- if (f)
1004
- return {
1005
- ...f,
1006
- pages: f == null ? void 0 : f.pages.map((i) => ({
1007
- ...i,
1008
- resources: i.resources.map((p) => {
1009
- if (p.assetId === (d == null ? void 0 : d.resourceId)) {
1010
- let m = [`creator:${p.creatorId}`];
1011
- 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}`))]), {
1012
- ...p,
1013
- rights: m
1014
- };
1015
- } else
1016
- return p;
1017
- })
1018
- }))
1019
- };
1020
- });
1021
- },
1022
- onSettled: () => {
1023
- r([]), n([]);
963
+ return Ie({
964
+ application: e,
965
+ options: {
966
+ onSuccess: async (f, u) => {
967
+ if (await t.cancelQueries({
968
+ queryKey: l
969
+ }), t.getQueryData(l))
970
+ return t.setQueryData(l, (h) => {
971
+ if (h)
972
+ return {
973
+ ...h,
974
+ pages: h == null ? void 0 : h.pages.map((i) => ({
975
+ ...i,
976
+ resources: i.resources.map((p) => {
977
+ if (p.assetId === (u == null ? void 0 : u.resourceId)) {
978
+ let m = [`creator:${p.creatorId}`];
979
+ 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}`))]), {
980
+ ...p,
981
+ rights: m
982
+ };
983
+ } else
984
+ return p;
985
+ })
986
+ }))
987
+ };
988
+ });
989
+ },
990
+ onSettled: () => {
991
+ r([]), n([]);
992
+ }
1024
993
  }
1025
994
  });
1026
- }, Js = () => {
1027
- const e = q(), t = k(), s = T(), {
995
+ }, Hs = (e) => {
996
+ const t = v(), s = D(), {
1028
997
  filters: r,
1029
998
  trashed: n
1030
999
  } = s, a = ["context", {
@@ -1032,80 +1001,77 @@ const cs = () => {
1032
1001
  filters: r,
1033
1002
  trashed: n
1034
1003
  }];
1035
- return O({
1036
- mutationFn: async (o) => await _e({
1037
- searchParams: s,
1038
- params: o
1039
- }),
1040
- onError(o) {
1041
- typeof o == "string" && e.error(D(o));
1042
- },
1043
- onSuccess: async (o, l) => {
1044
- if (await t.cancelQueries({
1045
- queryKey: a
1046
- }), t.getQueryData(a))
1047
- return t.setQueryData(a, (d) => {
1048
- if (d)
1049
- return {
1050
- ...d,
1051
- pages: d == null ? void 0 : d.pages.map((u) => ({
1004
+ return Se({
1005
+ application: e,
1006
+ options: {
1007
+ onSuccess: async (o, l) => {
1008
+ if (await t.cancelQueries({
1009
+ queryKey: a
1010
+ }), t.getQueryData(a))
1011
+ return t.setQueryData(a, (u) => {
1012
+ if (u)
1013
+ return {
1052
1014
  ...u,
1053
- resources: u.resources.map((f) => {
1054
- if (f.assetId === (l == null ? void 0 : l.entId)) {
1055
- const {
1056
- name: i,
1057
- thumbnail: p,
1058
- public: m,
1059
- description: y,
1060
- slug: g,
1061
- ...I
1062
- } = l;
1063
- return {
1064
- ...f,
1065
- ...I,
1066
- // add any custom field
1067
- name: i,
1068
- thumbnail: typeof p == "string" || !p ? p : URL.createObjectURL(p),
1069
- public: m,
1070
- description: y,
1071
- slug: g
1072
- };
1073
- } else
1074
- return f;
1075
- })
1076
- }))
1077
- };
1078
- });
1015
+ pages: u == null ? void 0 : u.pages.map((d) => ({
1016
+ ...d,
1017
+ resources: d.resources.map((h) => {
1018
+ if (h.assetId === (l == null ? void 0 : l.entId)) {
1019
+ const {
1020
+ name: i,
1021
+ thumbnail: p,
1022
+ public: m,
1023
+ description: y,
1024
+ slug: g,
1025
+ ...I
1026
+ } = l;
1027
+ return {
1028
+ ...h,
1029
+ ...I,
1030
+ // add any custom field
1031
+ name: i,
1032
+ thumbnail: typeof p == "string" ? p : URL.createObjectURL(p),
1033
+ public: m,
1034
+ description: y,
1035
+ slug: g
1036
+ };
1037
+ } else
1038
+ return h;
1039
+ })
1040
+ }))
1041
+ };
1042
+ });
1043
+ }
1079
1044
  }
1080
1045
  });
1081
- }, Xs = () => {
1082
- const e = q(), t = k(), s = T(), {
1046
+ };
1047
+ const Ws = () => {
1048
+ const e = O(), t = v(), s = D(), {
1083
1049
  user: r
1084
- } = Ie(), {
1050
+ } = we(), {
1085
1051
  appCode: n
1086
- } = M(), a = ["context", {
1052
+ } = U(), a = ["context", {
1087
1053
  folderId: s.filters.folder,
1088
1054
  filters: s.filters,
1089
1055
  trashed: s.trashed
1090
1056
  }];
1091
- return O({
1092
- mutationFn: async (o) => await ze({
1057
+ return M({
1058
+ mutationFn: async (o) => await _e({
1093
1059
  searchParams: s,
1094
1060
  params: o
1095
1061
  }),
1096
1062
  onError(o) {
1097
- typeof o == "string" && e.error(D(o));
1063
+ typeof o == "string" && e.error(P(o));
1098
1064
  },
1099
1065
  onSuccess: async (o, l) => {
1100
- var f, i, p;
1066
+ var h, i, p;
1101
1067
  await t.cancelQueries({
1102
1068
  queryKey: a
1103
1069
  });
1104
- const h = t.getQueryData(a), {
1105
- thumbnail: d
1106
- } = l, u = {
1070
+ const f = t.getQueryData(a), {
1071
+ thumbnail: u
1072
+ } = l, d = {
1107
1073
  ...l,
1108
- thumbnail: d ? URL.createObjectURL(d) : "",
1074
+ thumbnail: u ? URL.createObjectURL(u) : "",
1109
1075
  application: n,
1110
1076
  assetId: o._id || o.entId || "",
1111
1077
  id: o._id || o.entId || "",
@@ -1113,62 +1079,62 @@ const cs = () => {
1113
1079
  creatorName: r == null ? void 0 : r.username,
1114
1080
  createdAt: Date.now(),
1115
1081
  slug: l.slug || "",
1116
- modifiedAt: ((f = o.modified) == null ? void 0 : f.$date) || "",
1082
+ modifiedAt: ((h = o.modified) == null ? void 0 : h.$date) || "",
1117
1083
  modifierId: ((i = o.author) == null ? void 0 : i.userId) || "",
1118
1084
  modifierName: ((p = o.author) == null ? void 0 : p.username) || "",
1119
1085
  updatedAt: Date.now(),
1120
1086
  trashed: !1,
1121
1087
  rights: [`creator:${r == null ? void 0 : r.userId}`]
1122
1088
  };
1123
- if (h)
1089
+ if (f)
1124
1090
  return t.setQueryData(a, (m) => {
1125
1091
  if (m)
1126
1092
  return {
1127
1093
  ...m,
1128
1094
  pages: m == null ? void 0 : m.pages.map((y) => ({
1129
1095
  ...y,
1130
- resources: [u, ...y.resources]
1096
+ resources: [d, ...y.resources]
1131
1097
  }))
1132
1098
  };
1133
1099
  });
1134
1100
  }
1135
1101
  });
1136
- }, ls = /* @__PURE__ */ b(async () => await import("./EmptyScreenApp.js")), ds = /* @__PURE__ */ b(async () => await import("./EmptyScreenSearch.js")), us = /* @__PURE__ */ b(async () => await import("./EmptyScreenError.js")), hs = /* @__PURE__ */ b(async () => await import("./EmptyScreenNoContentInFolder.js")), fs = /* @__PURE__ */ b(async () => await import("./EmptyScreenTrash.js")), ps = /* @__PURE__ */ b(async () => await import("./FoldersList.js")), ms = /* @__PURE__ */ b(async () => await import("./ResourcesList.js")), gs = () => {
1137
- const e = Xe(), t = re(), s = Ye(), r = T(), n = W(), a = z(), o = q(), {
1102
+ }, ls = /* @__PURE__ */ x(async () => await import("./EmptyScreenApp.js")), ds = /* @__PURE__ */ x(async () => await import("./EmptyScreenSearch.js")), us = /* @__PURE__ */ x(async () => await import("./EmptyScreenError.js")), hs = /* @__PURE__ */ x(async () => await import("./EmptyScreenNoContentInFolder.js")), fs = /* @__PURE__ */ x(async () => await import("./EmptyScreenTrash.js")), ps = /* @__PURE__ */ x(async () => await import("./FoldersList.js")), ms = /* @__PURE__ */ x(async () => await import("./ResourcesList.js")), gs = () => {
1103
+ const e = Xe(), t = re(), s = Ye(), r = D(), n = W(), a = _(), o = O(), {
1138
1104
  appCode: l
1139
- } = M(), {
1140
- t: h
1141
- } = j(), {
1142
- setSearchParams: d,
1143
- setSearchConfig: u,
1144
- setTreeData: f
1145
- } = x(), {
1105
+ } = U(), {
1106
+ t: f
1107
+ } = z(), {
1108
+ setSearchParams: u,
1109
+ setSearchConfig: d,
1110
+ setTreeData: h
1111
+ } = w(), {
1146
1112
  data: i,
1147
1113
  isError: p,
1148
1114
  error: m,
1149
1115
  isLoading: y,
1150
1116
  isFetching: g,
1151
1117
  fetchNextPage: I
1152
- } = is(), F = (i == null ? void 0 : i.pages[0].folders.length) === 0, E = (i == null ? void 0 : i.pages[0].resources.length) === 0, L = F && E;
1153
- return U(() => {
1154
- var B, R, P;
1118
+ } = is(), b = (i == null ? void 0 : i.pages[0].folders.length) === 0, Q = (i == null ? void 0 : i.pages[0].resources.length) === 0, k = b && Q;
1119
+ return L(() => {
1120
+ var B, C, N;
1155
1121
  if (i) {
1156
- const Q = [...((B = i == null ? void 0 : i.pages[0]) == null ? void 0 : B.folders) ?? []];
1157
- (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({
1158
- id: C.DEFAULT,
1122
+ const E = [...((B = i == null ? void 0 : i.pages[0]) == null ? void 0 : B.folders) ?? []];
1123
+ (C = i == null ? void 0 : i.pages[0]) != null && C.searchConfig && d(i.pages[0].searchConfig), r.search || ((n == null ? void 0 : n.id) === "default" ? h({
1124
+ id: T.DEFAULT,
1159
1125
  section: !0,
1160
- children: Q.map((K) => new G(K)),
1161
- name: h("explorer.filters.mine", {
1126
+ children: E.map((K) => new G(K)),
1127
+ name: f("explorer.filters.mine", {
1162
1128
  ns: l
1163
1129
  })
1164
- }) : f(de(a, Q, r.filters.folder || C.DEFAULT))), d({
1130
+ }) : h(de(a, E, r.filters.folder || T.DEFAULT))), u({
1165
1131
  ...r,
1166
- pagination: (P = i == null ? void 0 : i.pages[(i == null ? void 0 : i.pages.length) - 1]) == null ? void 0 : P.pagination
1132
+ pagination: (N = i == null ? void 0 : i.pages[(i == null ? void 0 : i.pages.length) - 1]) == null ? void 0 : N.pagination
1167
1133
  });
1168
1134
  }
1169
- }, [i]), U(() => {
1170
- m && typeof m == "string" && o.error(h(m));
1171
- }, [m]), y ? /* @__PURE__ */ c(A, {}) : p ? /* @__PURE__ */ c(v, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(us, {}) }) : r.search && L ? /* @__PURE__ */ c(v, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(ds, {}) }) : e && L ? /* @__PURE__ */ c(v, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(ls, {}) }) : s && L && !t ? /* @__PURE__ */ c(v, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(hs, {}) }) : t && (i == null ? void 0 : i.pages[0].resources.length) === 0 ? /* @__PURE__ */ c(v, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(fs, {}) }) : /* @__PURE__ */ N(v, { fallback: /* @__PURE__ */ c(A, {}), children: [
1135
+ }, [i]), L(() => {
1136
+ m && typeof m == "string" && o.error(f(m));
1137
+ }, [m]), y ? /* @__PURE__ */ c(R, {}) : p ? /* @__PURE__ */ c(q, { fallback: /* @__PURE__ */ c(R, {}), children: /* @__PURE__ */ c(us, {}) }) : r.search && k ? /* @__PURE__ */ c(q, { fallback: /* @__PURE__ */ c(R, {}), children: /* @__PURE__ */ c(ds, {}) }) : e && k ? /* @__PURE__ */ c(q, { fallback: /* @__PURE__ */ c(R, {}), children: /* @__PURE__ */ c(ls, {}) }) : s && k && !t ? /* @__PURE__ */ c(q, { fallback: /* @__PURE__ */ c(R, {}), children: /* @__PURE__ */ c(hs, {}) }) : t && (i == null ? void 0 : i.pages[0].resources.length) === 0 ? /* @__PURE__ */ c(q, { fallback: /* @__PURE__ */ c(R, {}), children: /* @__PURE__ */ c(fs, {}) }) : /* @__PURE__ */ F(q, { fallback: /* @__PURE__ */ c(R, {}), children: [
1172
1138
  /* @__PURE__ */ c(ps, { data: i, isFetching: g }),
1173
1139
  /* @__PURE__ */ c(ms, { data: i, isFetching: g, fetchNextPage: I })
1174
1140
  ] });
@@ -1176,30 +1142,30 @@ const cs = () => {
1176
1142
  const {
1177
1143
  appCode: e,
1178
1144
  currentApp: t
1179
- } = M(), {
1145
+ } = U(), {
1180
1146
  t: s
1181
- } = j(), [r, n] = ae(""), a = (u) => {
1182
- if (u === "0") {
1147
+ } = z(), [r, n] = ae(""), a = (d) => {
1148
+ if (d === "0") {
1183
1149
  n("");
1184
1150
  return;
1185
1151
  }
1186
- n(u);
1187
- }, o = W(), l = T(), {
1188
- setSearchParams: h
1189
- } = x();
1190
- U(() => {
1191
- const u = () => r.includes("1") ? !0 : void 0, f = () => r.includes("2") ? !0 : void 0, i = () => r.includes("7") ? !0 : void 0;
1192
- h({
1152
+ n(d);
1153
+ }, o = W(), l = D(), {
1154
+ setSearchParams: f
1155
+ } = w();
1156
+ L(() => {
1157
+ const d = () => r.includes("1") ? !0 : void 0, h = () => r.includes("2") ? !0 : void 0, i = () => r.includes("7") ? !0 : void 0;
1158
+ f({
1193
1159
  ...l,
1194
1160
  filters: {
1195
- owner: u(),
1161
+ owner: d(),
1196
1162
  public: i(),
1197
- shared: f(),
1163
+ shared: h(),
1198
1164
  folder: o ? o.id : "default"
1199
1165
  }
1200
1166
  });
1201
- }, [o, h, r]);
1202
- const d = [{
1167
+ }, [o, f, r]);
1168
+ const u = [{
1203
1169
  label: s("explorer.filter.all", {
1204
1170
  ns: e
1205
1171
  }),
@@ -1234,15 +1200,15 @@ const cs = () => {
1234
1200
  }] : []];
1235
1201
  return {
1236
1202
  selectedFilters: r,
1237
- options: d,
1203
+ options: u,
1238
1204
  handleOnSelectFilter: a
1239
1205
  };
1240
1206
  }, Is = () => {
1241
1207
  const {
1242
1208
  appCode: e
1243
- } = M(), {
1209
+ } = U(), {
1244
1210
  t
1245
- } = j(), {
1211
+ } = z(), {
1246
1212
  selectedFilters: s,
1247
1213
  options: r,
1248
1214
  handleOnSelectFilter: n
@@ -1250,69 +1216,69 @@ const cs = () => {
1250
1216
  formRef: a,
1251
1217
  inputSearch: o,
1252
1218
  handleInputSearchChange: l,
1253
- handleKeyPress: h,
1254
- handleSearchSubmit: d
1255
- } = ue(), u = s.length > 0 ? s.length : void 0;
1256
- 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: [
1257
- /* @__PURE__ */ N(we, { id: "search", className: "input-group", children: [
1258
- /* @__PURE__ */ c(Se, { type: "search", placeholder: t("explorer.label.search", {
1219
+ handleKeyPress: f,
1220
+ handleSearchSubmit: u
1221
+ } = ue(), d = s.length > 0 ? s.length : void 0;
1222
+ return /* @__PURE__ */ F("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: [
1223
+ /* @__PURE__ */ F(xe, { id: "search", className: "input-group", children: [
1224
+ /* @__PURE__ */ c(De, { type: "search", placeholder: t("explorer.label.search", {
1259
1225
  ns: e
1260
- }), size: "lg", noValidationIcon: !0, value: o, onChange: l, onKeyDown: h }),
1261
- /* @__PURE__ */ c(xe, { type: "submit", "aria-label": t("explorer.label.search", {
1226
+ }), size: "lg", noValidationIcon: !0, value: o, onChange: l, onKeyDown: f }),
1227
+ /* @__PURE__ */ c(be, { type: "submit", "aria-label": t("explorer.label.search", {
1262
1228
  ns: e
1263
- }), onClick: d })
1229
+ }), onClick: u })
1264
1230
  ] }),
1265
- /* @__PURE__ */ N($, { placement: "bottom-end", children: [
1266
- /* @__PURE__ */ c($.Trigger, { label: t("explorer.filters"), icon: /* @__PURE__ */ c(Pe, { width: 20 }), variant: "ghost", badgeContent: u }),
1267
- /* @__PURE__ */ c($.Menu, { children: r.map((f) => f.value === "0" ? /* @__PURE__ */ N(me, { children: [
1268
- /* @__PURE__ */ c($.RadioItem, { value: f.value, model: s, onChange: () => n(f.value), children: f.label }),
1269
- /* @__PURE__ */ c($.Separator, {})
1270
- ] }, "0") : /* @__PURE__ */ c($.RadioItem, { value: f.value, model: s, onChange: () => n(f.value), children: f.label }, f.value)) })
1231
+ /* @__PURE__ */ F(j, { placement: "bottom-end", children: [
1232
+ /* @__PURE__ */ c(j.Trigger, { label: t("explorer.filters"), icon: /* @__PURE__ */ c(Qe, { width: 20 }), variant: "ghost", badgeContent: d }),
1233
+ /* @__PURE__ */ c(j.Menu, { children: r.map((h) => h.value === "0" ? /* @__PURE__ */ F(me, { children: [
1234
+ /* @__PURE__ */ c(j.RadioItem, { value: h.value, model: s, onChange: () => n(h.value), children: h.label }),
1235
+ /* @__PURE__ */ c(j.Separator, {})
1236
+ ] }, "0") : /* @__PURE__ */ c(j.RadioItem, { value: h.value, model: s, onChange: () => n(h.value), children: h.label }, h.value)) })
1271
1237
  ] })
1272
1238
  ] });
1273
- }, ws = ({
1239
+ }, Ss = ({
1274
1240
  id: e,
1275
1241
  selected: t,
1276
1242
  onSelect: s
1277
1243
  }) => {
1278
1244
  const {
1279
1245
  t: r
1280
- } = j();
1281
- 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: [
1282
- /* @__PURE__ */ c(Ae, { width: "20", height: "20" }),
1246
+ } = z();
1247
+ 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__ */ F("div", { className: "d-flex align-items-center gap-8 py-8 ps-24", children: [
1248
+ /* @__PURE__ */ c(Ee, { width: "20", height: "20" }),
1283
1249
  /* @__PURE__ */ c("span", { children: r("explorer.tree.trash") })
1284
1250
  ] }) }) }) }) }) }) });
1285
- }, Ss = /* @__PURE__ */ b(async () => await import("./FolderModal.js")), xs = () => {
1286
- const e = k(), [t, s] = De(), r = z(), n = re(), a = te(), {
1251
+ }, ws = /* @__PURE__ */ x(async () => await import("./FolderModal.js")), xs = () => {
1252
+ const e = v(), [t, s] = Te(), r = _(), n = re(), a = te(), {
1287
1253
  appCode: o
1288
- } = M(), {
1254
+ } = U(), {
1289
1255
  t: l
1290
- } = j(["common", o]), {
1291
- goToTrash: h,
1292
- selectTreeItem: d,
1293
- unfoldTreeItem: u,
1294
- foldTreeItem: f,
1256
+ } = z(["common", o]), {
1257
+ goToTrash: f,
1258
+ selectTreeItem: u,
1259
+ unfoldTreeItem: d,
1260
+ foldTreeItem: h,
1295
1261
  clearSelectedItems: i,
1296
1262
  clearSelectedIds: p
1297
- } = x(), m = async (g) => {
1298
- await u(g, e);
1263
+ } = w(), m = async (g) => {
1264
+ await d(g, e);
1299
1265
  }, y = () => {
1300
1266
  i(), p(), s();
1301
1267
  };
1302
- return /* @__PURE__ */ N(oe, { children: [
1303
- /* @__PURE__ */ c(be, { data: r, selectedNodesIds: a, onTreeItemSelect: d, onTreeItemFold: f, onTreeItemUnfold: m }),
1304
- /* @__PURE__ */ c(ws, { id: C.BIN, selected: n, onSelect: h }),
1305
- /* @__PURE__ */ c("div", { className: "d-grid my-16", children: /* @__PURE__ */ c(Te, { disabled: n, type: "button", color: "primary", variant: "outline", leftIcon: /* @__PURE__ */ c(Ee, {}), onClick: y, children: l("explorer.folder.new") }) }),
1306
- /* @__PURE__ */ c(v, { fallback: /* @__PURE__ */ c(A, {}), children: t && /* @__PURE__ */ c(Ss, { edit: !1, isOpen: t, onSuccess: s, onCancel: s }) })
1268
+ return /* @__PURE__ */ F(oe, { children: [
1269
+ /* @__PURE__ */ c(Fe, { data: r, selectedNodesIds: a, onTreeItemSelect: u, onTreeItemFold: h, onTreeItemUnfold: m }),
1270
+ /* @__PURE__ */ c(Ss, { id: T.BIN, selected: n, onSelect: f }),
1271
+ /* @__PURE__ */ c("div", { className: "d-grid my-16", children: /* @__PURE__ */ c(Ce, { disabled: n, type: "button", color: "primary", variant: "outline", leftIcon: /* @__PURE__ */ c(qe, {}), onClick: y, children: l("explorer.folder.new") }) }),
1272
+ /* @__PURE__ */ c(q, { fallback: /* @__PURE__ */ c(R, {}), children: t && /* @__PURE__ */ c(ws, { edit: !1, isOpen: t, onSuccess: s, onCancel: s }) })
1307
1273
  ] });
1308
- }, Ds = /* @__PURE__ */ b(async () => await import("./AppAction.js")), bs = /* @__PURE__ */ b(async () => await import("./Library.js")), Ts = /* @__PURE__ */ b(async () => await import("./ActionBarContainer.js")), Fs = /* @__PURE__ */ b(async () => await import("./DisableModal.js")), Cs = /* @__PURE__ */ b(async () => await import("./TrashModal.js")), Ns = /* @__PURE__ */ b(async () => await import("./OnboardingModal.js")), Ys = ({
1274
+ }, Ds = /* @__PURE__ */ x(async () => await import("./AppAction.js")), bs = /* @__PURE__ */ x(async () => await import("./Library.js")), Ts = /* @__PURE__ */ x(async () => await import("./ActionBarContainer.js")), Fs = /* @__PURE__ */ x(async () => await import("./DisableModal.js")), Cs = /* @__PURE__ */ x(async () => await import("./TrashModal.js")), Ns = /* @__PURE__ */ x(async () => await import("./OnboardingModal.js")), Gs = ({
1309
1275
  config: e
1310
1276
  }) => {
1311
- const t = T(), {
1277
+ const t = D(), {
1312
1278
  setConfig: s,
1313
1279
  setSearchParams: r
1314
- } = x();
1315
- U(() => {
1280
+ } = w();
1281
+ L(() => {
1316
1282
  s(e || {}), r({
1317
1283
  ...t,
1318
1284
  application: e.app,
@@ -1321,30 +1287,30 @@ const cs = () => {
1321
1287
  }, [e]);
1322
1288
  const {
1323
1289
  currentApp: n
1324
- } = M(), {
1290
+ } = U(), {
1325
1291
  data: a
1326
1292
  } = cs(), {
1327
1293
  isTrashedModalOpen: o,
1328
1294
  onTrashedCancel: l
1329
1295
  } = ts(), {
1330
- isActionDisableModalOpen: h,
1331
- onActionDisableCancel: d
1296
+ isActionDisableModalOpen: f,
1297
+ onActionDisableCancel: u
1332
1298
  } = ss();
1333
- Fe();
1334
- const u = ne("publish", a), f = ne("create", a);
1335
- return e && /* @__PURE__ */ N(oe, { children: [
1336
- /* @__PURE__ */ c(Ce, { render: () => f ? /* @__PURE__ */ c(v, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(Ds, {}) }) : null, children: /* @__PURE__ */ c(Ne, { app: n }) }),
1337
- /* @__PURE__ */ N(ee, { className: "flex-grow-1", children: [
1338
- /* @__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(v, { fallback: /* @__PURE__ */ c(A, {}), children: [
1299
+ Ne();
1300
+ const d = ne("publish", a), h = ne("create", a);
1301
+ return e && /* @__PURE__ */ F(oe, { children: [
1302
+ /* @__PURE__ */ c(Re, { render: () => h ? /* @__PURE__ */ c(q, { fallback: /* @__PURE__ */ c(R, {}), children: /* @__PURE__ */ c(Ds, {}) }) : null, children: /* @__PURE__ */ c(Pe, { app: n }) }),
1303
+ /* @__PURE__ */ F(ee, { className: "flex-grow-1", children: [
1304
+ /* @__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__ */ F(q, { fallback: /* @__PURE__ */ c(R, {}), children: [
1339
1305
  /* @__PURE__ */ c(xs, {}),
1340
- u && /* @__PURE__ */ c(bs, {})
1306
+ d && /* @__PURE__ */ c(bs, {})
1341
1307
  ] }) }),
1342
- /* @__PURE__ */ N(ee.Col, { sm: "4", md: "8", lg: "6", xl: "9", children: [
1308
+ /* @__PURE__ */ F(ee.Col, { sm: "4", md: "8", lg: "6", xl: "9", children: [
1343
1309
  /* @__PURE__ */ c(Is, {}),
1344
1310
  /* @__PURE__ */ c(es, {}),
1345
1311
  /* @__PURE__ */ c(gs, {})
1346
1312
  ] }),
1347
- /* @__PURE__ */ N(v, { fallback: /* @__PURE__ */ c(A, {}), children: [
1313
+ /* @__PURE__ */ F(q, { fallback: /* @__PURE__ */ c(R, {}), children: [
1348
1314
  /* @__PURE__ */ c(Ts, {}),
1349
1315
  /* @__PURE__ */ c(Ns, { id: "showOnboardingTrash", items: [{
1350
1316
  src: "onboarding/illu-trash-menu.svg",
@@ -1365,35 +1331,32 @@ const cs = () => {
1365
1331
  closeText: "explorer.modal.onboarding.trash.close"
1366
1332
  } }),
1367
1333
  o && /* @__PURE__ */ c(Cs, { isOpen: o, onCancel: l }),
1368
- h && /* @__PURE__ */ c(Fs, { isOpen: h, onCancel: d })
1334
+ f && /* @__PURE__ */ c(Fs, { isOpen: f, onCancel: u })
1369
1335
  ] })
1370
1336
  ] })
1371
1337
  ] });
1372
1338
  };
1373
1339
  export {
1374
- Ys as E,
1340
+ Gs as E,
1375
1341
  cs as a,
1376
1342
  W as b,
1377
- Xs as c,
1378
- T as d,
1379
- re as e,
1380
- w as f,
1381
- Us as g,
1382
- X as h,
1383
- _s as i,
1343
+ Ws as c,
1344
+ re as d,
1345
+ S as e,
1346
+ X as f,
1347
+ Ms as g,
1348
+ Us as h,
1349
+ J as i,
1384
1350
  Ks as j,
1385
- J as k,
1386
- js as l,
1387
- Ge as m,
1388
- Ms as n,
1389
- Bs as o,
1390
- Gs as p,
1391
- Js as q,
1392
- Hs as r,
1393
- Ws as s,
1394
- zs as t,
1395
- x as u,
1396
- $s as v,
1397
- Vs as w,
1398
- z as x
1351
+ Ge as k,
1352
+ Vs as l,
1353
+ Hs as m,
1354
+ D as n,
1355
+ zs as o,
1356
+ _s as p,
1357
+ $s as q,
1358
+ Bs as r,
1359
+ js as s,
1360
+ _ as t,
1361
+ w as u
1399
1362
  };