@anzusystems/common-admin 2.0.0-rc.28 → 2.0.0-rc.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/domains/dam/api/damAssetApi.d.ts +12 -1
  2. package/dist/domains/dam/api/damAssetApi.js +151 -95
  3. package/dist/domains/dam/api/damAssetApi.js.map +1 -1
  4. package/dist/domains/dam/api/damMetadataOnServer.d.ts +35 -0
  5. package/dist/domains/dam/api/damMetadataOnServer.js +28 -0
  6. package/dist/domains/dam/api/damMetadataOnServer.js.map +1 -0
  7. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarMetadata.vue.js +26 -25
  8. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarMetadata.vue.js.map +1 -1
  9. package/dist/domains/dam/assetDetail/store/assetDetailStore.js +40 -39
  10. package/dist/domains/dam/assetDetail/store/assetDetailStore.js.map +1 -1
  11. package/dist/domains/dam/cropper/components/ACropper.vue.d.ts +1 -1
  12. package/dist/domains/dam/cropper/components/ACropper.vue.js +153 -136
  13. package/dist/domains/dam/cropper/components/ACropper.vue.js.map +1 -1
  14. package/dist/domains/dam/imageWidget/components/AImageMediaWidget.vue.d.ts +1 -1
  15. package/dist/domains/dam/imageWidget/components/AImagePublicInput.vue.d.ts +1 -1
  16. package/dist/domains/dam/imageWidget/components/AImageWidget.vue.d.ts +1 -1
  17. package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.vue.d.ts +1 -1
  18. package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue.d.ts +1 -1
  19. package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue.d.ts +1 -1
  20. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue.d.ts +1 -1
  21. package/dist/domains/dam/uploadQueue/components/UploadQueueDialog.vue.js +106 -106
  22. package/dist/domains/dam/uploadQueue/components/UploadQueueDialog.vue.js.map +1 -1
  23. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingle.vue.js +13 -13
  24. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingle.vue.js.map +1 -1
  25. package/dist/domains/dam/uploadQueue/settlement/uploadSettle.js +115 -114
  26. package/dist/domains/dam/uploadQueue/settlement/uploadSettle.js.map +1 -1
  27. package/dist/domains/dam/uploadQueue/store/uploadQueuesStore.js +147 -143
  28. package/dist/domains/dam/uploadQueue/store/uploadQueuesStore.js.map +1 -1
  29. package/dist/domains/filters/components/FiltersSelected.vue.js +5 -5
  30. package/dist/domains/filters/components/FiltersSelected.vue.js.map +1 -1
  31. package/dist/domains/filters/composables/filterFactory.js +41 -38
  32. package/dist/domains/filters/composables/filterFactory.js.map +1 -1
  33. package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocomplete.vue.js +46 -38
  34. package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocomplete.vue.js.map +1 -1
  35. package/dist/domains/system/composables/alerts.js +8 -2
  36. package/dist/domains/system/composables/alerts.js.map +1 -1
  37. package/dist/domains/system/systemBar/utils/appReload.d.ts +9 -1
  38. package/dist/domains/system/systemBar/utils/appReload.js +3 -3
  39. package/dist/domains/system/systemBar/utils/appReload.js.map +1 -1
  40. package/dist/lib.d.ts +2 -2
  41. package/package.json +2 -2
@@ -2,59 +2,60 @@ import { requestedUrl as e } from "../../../api/composables/request.js";
2
2
  import { apiErrorIsReported as t, apiErrorStatus as n, mapApiError as r, report as i } from "../../../api/utils/apiErrors.js";
3
3
  import { useCommonAdminCoreDamOptions as a } from "../../composables/commonAdminCoreDamOptions.js";
4
4
  import { ENTITY as o, fetchAsset as s, fetchAssetByFileId as c, fetchAssetListByIds as l } from "../../api/damAssetApi.js";
5
- import { SYSTEM_CORE_DAM as u } from "../../api/damConstants.js";
6
- import { useDamCachedAuthors as d } from "../../author/composables/cachedAuthors.js";
7
- import { useUploadQueueItemFactory as f } from "../factory/UploadQueueItemFactory.js";
8
- import { useAssetSuggestions as p } from "../composables/assetSuggestions.js";
9
- import { useDamConfigState as m } from "../../config/composables/damConfigState.js";
10
- import { useDamNotifications as h } from "../../composables/damNotifications.js";
11
- import { useDamNotificationsConnection as g } from "../../composables/damNotificationsConnection.js";
12
- import { DamNotificationName as _ } from "../../composables/damNotificationsEventBus.js";
13
- import { getAssetTypeByMimeType as v } from "../utils/mimeTypeHelper.js";
14
- import { UPLOAD_QUEUE_ITEM_CHUNK_SIZE as y, createUploadQueueCore as b } from "../core/uploadQueueCore.js";
15
- import { libraryQueuePreset as x } from "../presets/queuePresets.js";
16
- import { UploadRowRole as S } from "../settlement/uploadSettlementTypes.js";
17
- import { useDamCachedKeywords as C } from "../../keyword/composables/cachedKeywords.js";
18
- import { damFileTypeFix as w } from "../../../ui/file/utils/fileType.js";
19
- import { DamAssetType as T } from "../../types/Asset.js";
20
- import { UploadQueueItemStatus as E, UploadQueueItemType as D } from "../../types/UploadQueue.js";
21
- import { AnzuApiResponseCodeError as O } from "../../../../shared/error/AnzuApiResponseCodeError.js";
22
- import { cloneDeep as k, isArray as A, isString as j, isUndefined as M } from "../../../../shared/utils/common.js";
23
- import { commonT as N } from "../../../../plugins/i18n.js";
24
- import { defineStore as P } from "pinia";
25
- import { getCurrentScope as ee, ref as te } from "vue";
5
+ import { metadataOfAsset as u, metadataOnServer as d, setMetadataOnServer as f } from "../../api/damMetadataOnServer.js";
6
+ import { SYSTEM_CORE_DAM as p } from "../../api/damConstants.js";
7
+ import { useDamCachedAuthors as m } from "../../author/composables/cachedAuthors.js";
8
+ import { useUploadQueueItemFactory as h } from "../factory/UploadQueueItemFactory.js";
9
+ import { useAssetSuggestions as ee } from "../composables/assetSuggestions.js";
10
+ import { useDamConfigState as g } from "../../config/composables/damConfigState.js";
11
+ import { useDamNotifications as _ } from "../../composables/damNotifications.js";
12
+ import { useDamNotificationsConnection as v } from "../../composables/damNotificationsConnection.js";
13
+ import { DamNotificationName as y } from "../../composables/damNotificationsEventBus.js";
14
+ import { getAssetTypeByMimeType as b } from "../utils/mimeTypeHelper.js";
15
+ import { UPLOAD_QUEUE_ITEM_CHUNK_SIZE as x, createUploadQueueCore as S } from "../core/uploadQueueCore.js";
16
+ import { libraryQueuePreset as C } from "../presets/queuePresets.js";
17
+ import { UploadRowRole as w } from "../settlement/uploadSettlementTypes.js";
18
+ import { useDamCachedKeywords as T } from "../../keyword/composables/cachedKeywords.js";
19
+ import { damFileTypeFix as E } from "../../../ui/file/utils/fileType.js";
20
+ import { DamAssetType as D } from "../../types/Asset.js";
21
+ import { UploadQueueItemStatus as O, UploadQueueItemType as k } from "../../types/UploadQueue.js";
22
+ import { AnzuApiResponseCodeError as A } from "../../../../shared/error/AnzuApiResponseCodeError.js";
23
+ import { cloneDeep as j, isArray as M, isString as te, isUndefined as N } from "../../../../shared/utils/common.js";
24
+ import { commonT as P } from "../../../../plugins/i18n.js";
25
+ import { defineStore as F } from "pinia";
26
+ import { getCurrentScope as ne, ref as re } from "vue";
26
27
  // src/domains/dam/uploadQueue/store/uploadQueuesStore.ts
27
- var ne = (e) => k({
28
+ var ie = (e) => j({
28
29
  keywords: e.keywords,
29
30
  authors: e.authors,
30
31
  sources: e.sources,
31
32
  customData: e.customData,
32
33
  mainFileSingleUse: e.mainFileSingleUse
33
- }), F = (e, t) => JSON.stringify(e) === JSON.stringify(t), I = (e, t, n) => {
34
+ }), I = (e, t) => JSON.stringify(e) === JSON.stringify(t), L = (e, t, n) => {
34
35
  let r = {
35
36
  fields: /* @__PURE__ */ new Set(),
36
37
  customKeys: /* @__PURE__ */ new Set()
37
- }, i = (n) => !t || F(e[n], t[n]) ? !0 : (r.fields.add(n), !1);
38
+ }, i = (n) => !t || I(e[n], t[n]) ? !0 : (r.fields.add(n), !1);
38
39
  i("keywords") && (e.keywords = [...n.keywords]), i("authors") && (e.authors = [...n.authors]), i("sources") && (e.sources = [...n.sources ?? []]);
39
- let a = k(n.customData);
40
+ let a = j(n.customData);
40
41
  if (t && a) {
41
42
  let n = e.customData ?? {}, i = t.customData ?? {};
42
43
  (/* @__PURE__ */ new Set([...Object.keys(n), ...Object.keys(i)])).forEach((e) => {
43
- F(n[e], i[e]) || (r.customKeys.add(e), e in n ? a[e] = k(n[e]) : delete a[e]);
44
+ I(n[e], i[e]) || (r.customKeys.add(e), e in n ? a[e] = j(n[e]) : delete a[e]);
44
45
  });
45
46
  }
46
- return e.customData = a, M(n.mainFileSingleUse) ? r.fields.add("mainFileSingleUse") : i("mainFileSingleUse") && (e.mainFileSingleUse = n.mainFileSingleUse), r;
47
- }, L = (e, t, n) => {
47
+ return e.customData = a, N(n.mainFileSingleUse) ? r.fields.add("mainFileSingleUse") : i("mainFileSingleUse") && (e.mainFileSingleUse = n.mainFileSingleUse), r;
48
+ }, R = (e, t, n) => {
48
49
  let r = e.rows.get(t);
49
50
  if (!r) return;
50
51
  n.fields.has("keywords") || (r.keywords = [...t.keywords]), n.fields.has("authors") || (r.authors = [...t.authors]), n.fields.has("sources") || (r.sources = [...t.sources ?? []]), n.fields.has("mainFileSingleUse") || (r.mainFileSingleUse = t.mainFileSingleUse);
51
52
  let i = t.customData ?? {}, a = r.customData = { ...r.customData };
52
53
  (/* @__PURE__ */ new Set([...Object.keys(i), ...Object.keys(a)])).forEach((e) => {
53
- n.customKeys.has(e) || (e in i ? a[e] = k(i[e]) : delete a[e]);
54
+ n.customKeys.has(e) || (e in i ? a[e] = j(i[e]) : delete a[e]);
54
55
  });
55
- }, R = P("commonAdminUploadQueuesStore", () => {
56
- let k = te(/* @__PURE__ */ new Map()), { createDefault: P } = f(), F = /* @__PURE__ */ new Map(), R = (e) => (M(e) ? void 0 : F.get(e)) ?? "default", z = (e) => a(R(e)), B = {
57
- roleOf: (e) => e.type === D.Asset ? S.Copy : S.Upload,
56
+ }, z = F("commonAdminUploadQueuesStore", () => {
57
+ let j = re(/* @__PURE__ */ new Map()), { createDefault: F } = h(), I = /* @__PURE__ */ new Map(), z = (e) => (N(e) ? void 0 : I.get(e)) ?? "default", B = (e) => a(z(e)), V = {
58
+ roleOf: (e) => e.type === k.Asset ? w.Copy : w.Upload,
58
59
  policyFor: () => ({
59
60
  reader: "asset",
60
61
  settleOn: "read",
@@ -64,7 +65,7 @@ var ne = (e) => k({
64
65
  matches: (e, t) => e.assetId === t.assetId,
65
66
  readers: {
66
67
  asset: async (e, t) => {
67
- let { damClient: r, endPointAsset: i } = z(t?.queueKey);
68
+ let { damClient: r, endPointAsset: i } = B(t?.queueKey);
68
69
  try {
69
70
  return t?.report === !1 ? await s(r, i, e, { report: !1 }) : await s(r, i, e);
70
71
  } catch (e) {
@@ -73,70 +74,70 @@ var ne = (e) => k({
73
74
  }
74
75
  },
75
76
  assets: async (t, n, a) => {
76
- let { damClient: s, endPointAsset: c } = z(a?.queueKey);
77
+ let { damClient: s, endPointAsset: c } = B(a?.queueKey);
77
78
  try {
78
79
  return await l(s, c, n, t);
79
80
  } catch (l) {
80
81
  if (a?.report) {
81
- let a = A(l) ? l.at(-1) : void 0, d = `${c}/licence/${t}/ids/${n.join(",")}`, f = {
82
- system: u,
82
+ let a = M(l) ? l.at(-1) : void 0, u = `${c}/licence/${t}/ids/${n.join(",")}`, d = {
83
+ system: p,
83
84
  entity: o,
84
- url: e(s, d, {}, l, a?.config)
85
- }, p = A(l) ? new O(a?.status ?? 0) : l;
86
- throw i(r(p, f), f);
85
+ url: e(s, u, {}, l, a?.config)
86
+ }, f = M(l) ? new A(a?.status ?? 0) : l;
87
+ throw i(r(f, d), d);
87
88
  }
88
89
  throw l;
89
90
  }
90
91
  },
91
92
  duplicateOriginAsset: async (e, t) => {
92
- let { damClient: n, endPointAsset: r } = z(t?.queueKey);
93
+ let { damClient: n, endPointAsset: r } = B(t?.queueKey);
93
94
  return c(n, r, e);
94
95
  },
95
96
  failureReported: t
96
97
  },
97
- configOf: R,
98
+ configOf: z,
98
99
  caches: {
99
- addAuthors: (e, t) => d(R(t)).addToCachedAuthors(e),
100
- addKeywords: (e, t) => C(R(t)).addToCachedKeywords(e),
101
- fetchAuthors: (e) => d(R(e)).fetchCachedAuthors(),
102
- fetchKeywords: (e) => C(R(e)).fetchCachedKeywords()
100
+ addAuthors: (e, t) => m(z(t)).addToCachedAuthors(e),
101
+ addKeywords: (e, t) => T(z(t)).addToCachedKeywords(e),
102
+ fetchAuthors: (e) => m(z(e)).fetchCachedAuthors(),
103
+ fetchKeywords: (e) => T(z(e)).fetchCachedKeywords()
103
104
  },
104
105
  messages: {
105
- processingTooLong: () => N("common.damImage.uploadErrors.processingTooLong"),
106
- readFailed: () => N("common.damImage.uploadErrors.readFailed"),
107
- assetMissing: () => N("common.damImage.uploadErrors.unknownError"),
108
- assetGone: () => N("common.damImage.queueItem.assetGone")
106
+ processingTooLong: () => P("common.damImage.uploadErrors.processingTooLong"),
107
+ readFailed: () => P("common.damImage.uploadErrors.readFailed"),
108
+ assetMissing: () => P("common.damImage.uploadErrors.unknownError"),
109
+ assetGone: () => P("common.damImage.queueItem.assetGone")
109
110
  },
110
111
  connection: {
111
- isPushAlive: (e) => g(R(e)).isPushAlive(),
112
- onChange: g().onChange
112
+ isPushAlive: (e) => v(z(e)).isPushAlive(),
113
+ onChange: v().onChange
113
114
  }
114
- }, V = b(x({
115
- queues: k,
116
- settlement: B,
117
- configOf: R
118
- })), { settlement: H } = V;
119
- function U(e, t, n) {
120
- let r = F.get(e);
121
- if (!M(r) && r !== t && V.getQueueItems(e).length > 0) throw Error(`useUploadQueuesStore: the queue "${e}" has rows under the DAM configuration "${r}", none is added under "${t}".`);
122
- F.set(e, t), V.addRow(e, n);
115
+ }, H = S(C({
116
+ queues: j,
117
+ settlement: V,
118
+ configOf: z
119
+ })), { settlement: U } = H;
120
+ function W(e, t, n) {
121
+ let r = I.get(e);
122
+ if (!N(r) && r !== t && H.getQueueItems(e).length > 0) throw Error(`useUploadQueuesStore: the queue "${e}" has rows under the DAM configuration "${r}", none is added under "${t}".`);
123
+ I.set(e, t), H.addRow(e, n);
123
124
  }
124
- let W = ee(), G = (e, t) => {
125
+ let G = ne(), ae = (e, t) => {
125
126
  switch (e.name) {
126
- case _.AssetFileProcessed: return {
127
+ case y.AssetFileProcessed: return {
127
128
  kind: "processed",
128
129
  assetId: e.data.asset,
129
130
  fileId: null,
130
131
  configNames: t
131
132
  };
132
- case _.AssetFileFailed: return {
133
+ case y.AssetFileFailed: return {
133
134
  kind: "failed",
134
135
  assetId: e.data.asset,
135
136
  fileId: null,
136
137
  failReason: e.data.failReason,
137
138
  configNames: t
138
139
  };
139
- case _.AssetFileDuplicate: return {
140
+ case y.AssetFileDuplicate: return {
140
141
  kind: "duplicate",
141
142
  assetId: e.data.asset,
142
143
  fileId: null,
@@ -144,13 +145,13 @@ var ne = (e) => k({
144
145
  assetType: e.data.assetType,
145
146
  configNames: t
146
147
  };
147
- case _.AssetMetadataProcessed: return {
148
+ case y.AssetMetadataProcessed: return {
148
149
  kind: "metadata",
149
150
  assetId: e.data.asset,
150
151
  fileId: null,
151
152
  configNames: t
152
153
  };
153
- case _.AssetFileCopied: return {
154
+ case y.AssetFileCopied: return {
154
155
  kind: "copied",
155
156
  assetId: e.data.asset,
156
157
  fileId: null,
@@ -158,72 +159,72 @@ var ne = (e) => k({
158
159
  };
159
160
  }
160
161
  return null;
161
- }, { addDamNotificationListener: re } = h(), K = !1;
162
+ }, { addDamNotificationListener: oe } = _(), K = !1;
162
163
  function q() {
163
164
  if (K) return;
164
165
  K = !0;
165
- let e = () => re((e, t) => {
166
- let n = G(e, t);
167
- n && H.notify(n);
166
+ let e = () => oe((e, t) => {
167
+ let n = ae(e, t);
168
+ n && U.notify(n);
168
169
  }, { all: !0 });
169
- W ? W.run(e) : e();
170
+ G ? G.run(e) : e();
170
171
  }
171
- async function ie(e, t, n, r, i) {
172
+ async function se(e, t, n, r, i) {
172
173
  a(i);
173
- let { getDamConfigExtSystem: o } = m(void 0, i), s = o(t);
174
- if (M(s)) throw Error("useUploadQueuesStore.addByCopyToLicence: Ext system must be initialised.");
174
+ let { getDamConfigExtSystem: o } = g(void 0, i), s = o(t);
175
+ if (N(s)) throw Error("useUploadQueuesStore.addByCopyToLicence: Ext system must be initialised.");
175
176
  q();
176
177
  for (let t of r) {
177
- let r = P(V.uniqueKey("asset_" + t), D.Asset, E.Processing, T.Image, y, n);
178
- r.assetId = t, U(e, i, r);
179
- let a = V.getQueueItems(e).at(-1);
180
- a && V.track(e, a);
178
+ let r = F(H.uniqueKey("asset_" + t), k.Asset, O.Processing, D.Image, x, n);
179
+ r.assetId = t, W(e, i, r);
180
+ let a = H.getQueueItems(e).at(-1);
181
+ a && H.track(e, a);
181
182
  }
182
183
  }
183
- async function ae(e, t, n, r, i) {
184
+ async function ce(e, t, n, r, i) {
184
185
  a(i);
185
- let { getDamConfigExtSystem: o } = m(void 0, i), s = o(t);
186
- if (M(s)) throw Error("useUploadQueuesStore.addByFiles: Ext system must be initialised.");
186
+ let { getDamConfigExtSystem: o } = g(void 0, i), s = o(t);
187
+ if (N(s)) throw Error("useUploadQueuesStore.addByFiles: Ext system must be initialised.");
187
188
  q();
188
189
  for await (let t of r) {
189
- let r = v(w(t), s);
190
- if (!r || r !== T.Image) continue;
191
- let a = P(V.uniqueKey("file_" + t.name), D.File, E.Waiting, r, y, n);
192
- a.file = t, a.displayTitle = t.name, U(e, i, a);
190
+ let r = b(E(t), s);
191
+ if (!r || r !== D.Image) continue;
192
+ let a = F(H.uniqueKey("file_" + t.name), k.File, O.Waiting, r, x, n);
193
+ a.file = t, a.displayTitle = t.name, W(e, i, a);
193
194
  }
194
195
  }
195
196
  let J = (e, t) => ({
196
197
  assetId: e,
197
198
  fileId: null,
198
- configNames: [j(t) ? t : R(t.queueKey)]
199
+ configNames: [te(t) ? t : z(t.queueKey)]
199
200
  });
200
- function oe(e, t) {
201
- return H.notify({
201
+ function le(e, t) {
202
+ return U.notify({
202
203
  kind: "processed",
203
204
  ...J(e, t)
204
205
  });
205
206
  }
206
- function se(e, t) {
207
- return H.settleKnownProcessed(J(e, t), { withMetadata: !0 });
207
+ function ue(e, t) {
208
+ return U.settleKnownProcessed(J(e, t), { withMetadata: !0 });
208
209
  }
209
- function ce(e, t, n, r) {
210
- return H.settleKnownDuplicate(J(e, r), t, n);
210
+ function de(e, t, n, r) {
211
+ return U.settleKnownDuplicate(J(e, r), t, n);
211
212
  }
212
- async function le(e, t, n) {
213
- H.settleKnownFailed(J(e, n), t);
213
+ async function fe(e, t, n) {
214
+ U.settleKnownFailed(J(e, n), t);
214
215
  }
215
- function ue(e, t) {
216
- return H.refreshAsset(J(e, t));
216
+ function pe(e, t) {
217
+ return U.refreshAsset(J(e, t));
217
218
  }
218
- async function de(e, t, n) {
219
- V.stopItemUpload(e, t);
219
+ async function me(e, t, n) {
220
+ H.stopItemUpload(e, t);
220
221
  }
221
- let Y = /* @__PURE__ */ new Map(), fe = (e, t) => `${e}\u0000${t}`, pe = 0, X = /* @__PURE__ */ new Set();
222
+ let Y = /* @__PURE__ */ new Map(), he = (e, t) => `${e}\u0000${t}`, ge = 0, X = /* @__PURE__ */ new Set();
222
223
  function Z(e, t) {
223
224
  let n = /* @__PURE__ */ new Map();
224
- k.value.forEach((r, i) => {
225
- R(i) === t && r.items.forEach((t) => {
226
- t.assetId === e && t.type && n.set(t, ne(t));
225
+ j.value.forEach((r, i) => {
226
+ z(i) === t && r.items.forEach((t) => {
227
+ t.assetId === e && t.type && n.set(t, ie(t));
227
228
  });
228
229
  });
229
230
  let r = {
@@ -238,85 +239,88 @@ var ne = (e) => k({
238
239
  }
239
240
  let $ = (e, t, n) => {
240
241
  X.forEach((r) => {
241
- r !== e && r.assetId === e.assetId && r.configName === e.configName && L(r, t, n);
242
+ r !== e && r.assetId === e.assetId && r.configName === e.configName && R(r, t, n);
242
243
  });
243
244
  };
244
- async function me(e, t, n, r) {
245
- let { updateNewNames: i, getAuthorConflicts: o } = p(), c;
245
+ async function _e(e, t, n, r) {
246
+ let { updateNewNames: i, getAuthorConflicts: o } = ee(), c;
246
247
  try {
247
248
  c = a(t);
248
249
  } catch {
249
250
  return;
250
251
  }
251
- let { addToCachedKeywords: l, fetchCachedKeywords: u } = C(t), { addToCachedAuthors: f, fetchCachedAuthors: m } = d(t), h = () => Array.from(k.value.entries()).filter(([e]) => R(e) === t), g = h().flatMap(([, e]) => e.items);
252
- if (!g.some((t) => t.assetId === e.id && !!t.type) && !g.some((t) => !!t.type && t.status === E.Processing && t.licenceId === e.licence)) {
252
+ let { addToCachedKeywords: l, fetchCachedKeywords: p } = T(t), { addToCachedAuthors: h, fetchCachedAuthors: g } = m(t), _ = () => Array.from(j.value.entries()).filter(([e]) => z(e) === t), v = _().flatMap(([, e]) => e.items);
253
+ if (!v.some((t) => t.assetId === e.id && !!t.type) && !v.some((t) => !!t.type && t.status === O.Processing && t.licenceId === e.licence)) {
253
254
  r && Q(r);
254
255
  return;
255
256
  }
256
- let _ = r ?? Z(e.id, t), v = _.rows, y = ++pe, b = fe(t, e.id);
257
- Y.set(b, y);
258
- let x = () => Y.get(b) === y;
257
+ let y = r ?? Z(e.id, t), b = y.rows, x = ++ge, S = he(t, e.id);
258
+ Y.set(S, x);
259
+ let C = () => Y.get(S) === x;
259
260
  try {
260
261
  let t = await s(c.damClient, c.endPointAsset, e.id);
261
- if (!x()) return;
262
- h().forEach(([e, n]) => {
262
+ if (!C()) return;
263
+ _().forEach(([e, n]) => {
263
264
  n.items.forEach((e) => {
264
265
  if (e.assetId === t.id && e.type) {
265
- let r = I(e, v.get(e), {
266
+ let r = L(e, b.get(e), {
266
267
  keywords: t.keywords,
267
268
  authors: t.authors,
268
269
  sources: t.sources,
269
270
  customData: t.metadata.customData,
270
271
  mainFileSingleUse: t.mainFileSingleUse
271
272
  });
272
- $(_, e, r), i(t.metadata.authorSuggestions, n.suggestions.newAuthorNames), i(t.metadata.keywordSuggestions, n.suggestions.newKeywordNames), e.authorConflicts = o(t.metadata.authorSuggestions), l(e.keywords), f(e.authors), f(e.sources), f(e.authorConflicts);
273
+ f(e, u(t)), $(y, e, r), i(t.metadata.authorSuggestions, n.suggestions.newAuthorNames), i(t.metadata.keywordSuggestions, n.suggestions.newKeywordNames), e.authorConflicts = o(t.metadata.authorSuggestions), l(e.keywords), h(e.authors), h(e.sources), h(e.authorConflicts);
273
274
  }
274
- }), V.recalculateQueueCounts(e), m(), u();
275
+ }), H.recalculateQueueCounts(e), g(), p();
275
276
  });
276
277
  } catch {
277
- if (!x()) return;
278
- h().forEach(([, t]) => {
278
+ if (!C()) return;
279
+ _().forEach(([, t]) => {
279
280
  t.items.forEach((t) => {
280
281
  if (t.assetId === e.id && t.type) {
281
- let r = I(t, v.get(t), {
282
+ let r = L(t, b.get(t), {
282
283
  keywords: e.keywords,
283
284
  authors: e.authors,
284
285
  sources: e.sources,
285
286
  customData: e.metadata.customData,
286
- mainFileSingleUse: M(n) ? void 0 : n
287
- });
288
- $(_, t, r), l(t.keywords), f(t.authors), f(t.sources);
287
+ mainFileSingleUse: N(n) ? void 0 : n
288
+ }), i = d(t);
289
+ i && f(t, {
290
+ ...u(e),
291
+ mainFileSingleUse: N(n) ? i.mainFileSingleUse : n
292
+ }), $(y, t, r), l(t.keywords), h(t.authors), h(t.sources);
289
293
  }
290
294
  });
291
- }), m(), u();
295
+ }), g(), p();
292
296
  } finally {
293
- Q(_), x() && Y.delete(b);
297
+ Q(y), C() && Y.delete(S);
294
298
  }
295
299
  }
296
300
  return {
297
- getQueue: V.getQueue,
298
- getQueueItems: V.getQueueItems,
299
- addByFiles: ae,
300
- addByCopyToLicence: ie,
301
- queueItemProcessed: oe,
302
- queueItemFullyProcessed: se,
303
- queueItemDuplicate: ce,
304
- queueItemFailed: le,
305
- refreshAsset: ue,
306
- refreshMayHelp: V.refreshMayHelp,
307
- isGivenUpMissing: (e) => H.isGivenUpMissing(e),
308
- removeByIndex: V.removeByIndex,
309
- stopItemUpload: de,
310
- getQueueTotalCount: V.getQueueTotalCount,
311
- getQueueProcessedCount: V.getQueueProcessedCount,
312
- stopUpload: V.stopUpload,
313
- getQueueItemsTypes: V.getQueueItemsTypes,
314
- updateFromDetail: me,
301
+ getQueue: H.getQueue,
302
+ getQueueItems: H.getQueueItems,
303
+ addByFiles: ce,
304
+ addByCopyToLicence: se,
305
+ queueItemProcessed: le,
306
+ queueItemFullyProcessed: ue,
307
+ queueItemDuplicate: de,
308
+ queueItemFailed: fe,
309
+ refreshAsset: pe,
310
+ refreshMayHelp: H.refreshMayHelp,
311
+ isGivenUpMissing: (e) => U.isGivenUpMissing(e),
312
+ removeByIndex: H.removeByIndex,
313
+ stopItemUpload: me,
314
+ getQueueTotalCount: H.getQueueTotalCount,
315
+ getQueueProcessedCount: H.getQueueProcessedCount,
316
+ stopUpload: H.stopUpload,
317
+ getQueueItemsTypes: H.getQueueItemsTypes,
318
+ updateFromDetail: _e,
315
319
  noteRowsOfAsset: Z,
316
320
  forgetRowsNote: Q,
317
- forceReloadFileInput: V.forceReloadFileInput
321
+ forceReloadFileInput: H.forceReloadFileInput
318
322
  };
319
323
  });
320
- export { R as useUploadQueuesStore };
324
+ export { z as useUploadQueuesStore };
321
325
 
322
326
  //# sourceMappingURL=uploadQueuesStore.js.map