@feedmepos/mf-menu 1.0.1-dev.2 → 1.0.1-dev.4

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 (60) hide show
  1. package/dist/{App-CdIN4s5n.js → App-DhYTzDY0.js} +546 -533
  2. package/dist/{BindingTable.vue_vue_type_script_setup_true_lang-CoHlJwpz.js → BindingTable.vue_vue_type_script_setup_true_lang-BUiZxX6w.js} +1 -1
  3. package/dist/{Catalog-DjAubC9s.js → Catalog-DWj_TPwj.js} +4 -4
  4. package/dist/{CatalogBinding-5JNRTbyZ.js → CatalogBinding-DCUFGwTy.js} +3 -3
  5. package/dist/{CatalogEditTabs.vue_vue_type_script_setup_true_lang-BorOjk1k.js → CatalogEditTabs.vue_vue_type_script_setup_true_lang-BYeOydGv.js} +3 -3
  6. package/dist/{CatalogEditor.vue_vue_type_script_setup_true_lang-CkF7O_V-.js → CatalogEditor.vue_vue_type_script_setup_true_lang-BeuAv0jC.js} +6 -6
  7. package/dist/{CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-3fL43MuR.js → CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-EnajbZtY.js} +3 -3
  8. package/dist/{Category-COug7fz8.js → Category-B9jpP8pf.js} +2 -2
  9. package/dist/{Category-BbiN4hd7.js → Category-C9BtFwBO.js} +5 -5
  10. package/dist/{CategoryList.vue_vue_type_script_setup_true_lang-B_9aPMIN.js → CategoryList.vue_vue_type_script_setup_true_lang-C11l9kUD.js} +92 -91
  11. package/dist/{CookingGuide-Dg7kuF6l.js → CookingGuide-xx0mHc6j.js} +262 -256
  12. package/dist/{Group-BRpmTqyT.js → Group-BkyVQTHZ.js} +5 -5
  13. package/dist/{Group-C-hwlkgJ.js → Group-DaNj2hu9.js} +2 -2
  14. package/dist/{GroupList.vue_vue_type_script_setup_true_lang-DowoJ3WM.js → GroupList.vue_vue_type_script_setup_true_lang-By6udos1.js} +5 -5
  15. package/dist/{Ingredient-BQYnARdC.js → Ingredient-DbV2TbTY.js} +3 -3
  16. package/dist/{LinkProductSideSheet.vue_vue_type_script_setup_true_lang-CgTDkHle.js → LinkProductSideSheet.vue_vue_type_script_setup_true_lang-DS7hUQpE.js} +1 -1
  17. package/dist/{MenuSetting-DsdM2_OW.js → MenuSetting-COJaCmJN.js} +3 -3
  18. package/dist/{OrderPacing-5x2YH-_l.js → OrderPacing-D6y9LBM_.js} +96 -93
  19. package/dist/{OrderPacingFields.vue_vue_type_script_setup_true_lang-DVGJjpiM.js → OrderPacingFields.vue_vue_type_script_setup_true_lang--J9nxeca.js} +1 -1
  20. package/dist/Preview-B19pRXmI.js +325 -0
  21. package/dist/{PriceTierNotice.vue_vue_type_script_setup_true_lang-vmxVZ2ya.js → PriceTierNotice.vue_vue_type_script_setup_true_lang-DwwfXWL8.js} +1 -1
  22. package/dist/{PrintRoute-COkCv4gf.js → PrintRoute-DkZaQWrC.js} +158 -152
  23. package/dist/{Product-BJFb_J4h.js → Product-DkxV4IfT.js} +4 -4
  24. package/dist/{ProductEditorHost.vue_vue_type_script_setup_true_lang-Tpp8MBYS.js → ProductEditorHost.vue_vue_type_script_setup_true_lang-BuhTMFZF.js} +2 -2
  25. package/dist/{ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-C25Pwqme.js → ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-B_EmJhpN.js} +3 -3
  26. package/dist/{ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-BMAtAK9D.js → ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-CniqNe-9.js} +1 -1
  27. package/dist/{ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-Dl4Zr5tx.js → ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-Be9Y5Cc1.js} +1181 -1174
  28. package/dist/ProductInternalTools-CW7gKvtC.js +2147 -0
  29. package/dist/{ProductInventoryDialog-C3ruRWU5.js → ProductInventoryDialog-DA1A9YlU.js} +1 -1
  30. package/dist/{ProductInventoryDialog.vue_vue_type_script_setup_true_lang-MpdIixqI.js → ProductInventoryDialog.vue_vue_type_script_setup_true_lang-DDKjs88F.js} +1 -1
  31. package/dist/{ProductList.vue_vue_type_script_setup_true_lang-9_ohgfqE.js → ProductList.vue_vue_type_script_setup_true_lang-63u-Pxh-.js} +2328 -2298
  32. package/dist/{ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-Ctbz-8cd.js → ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-DjrHHLkY.js} +1 -1
  33. package/dist/{Products-DMrjQFfu.js → Products-CFxCduVf.js} +3 -3
  34. package/dist/{Publish-f6g0dIao.js → Publish-C50PRaWB.js} +3 -3
  35. package/dist/{Recipe-p-wxadSN.js → Recipe-CGwAatcb.js} +3 -3
  36. package/dist/{Scheduler-CtebRafn.js → Scheduler-hIe_BdwS.js} +3 -3
  37. package/dist/{ServingSequence-CEd4ywOQ.js → ServingSequence-CIzDiSll.js} +103 -97
  38. package/dist/{Setting-bPKadRu-.js → Setting-Cr6u3Vok.js} +6 -6
  39. package/dist/{Subcategory-DBCnIP0b.js → Subcategory-BYg9Z56P.js} +141 -129
  40. package/dist/{Takeaway-GNRHR5kN.js → Takeaway-BIF4hGTc.js} +2 -2
  41. package/dist/{Takeaway-VBkdW1DM.js → Takeaway-I5kTW17E.js} +5 -5
  42. package/dist/{TakeawayList.vue_vue_type_script_setup_true_lang-DvX3k0Jg.js → TakeawayList.vue_vue_type_script_setup_true_lang-Ph6sSiyp.js} +117 -111
  43. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-D1qaEVUu.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-B3SRYt9b.js} +6 -6
  44. package/dist/{Unit-DbGKIprZ.js → Unit-CHVucFRl.js} +2 -2
  45. package/dist/{Variant-_edSAKif.js → Variant-CS0gRkGz.js} +114 -108
  46. package/dist/{_id_-BNVtBV3q.js → _id_-BpCfEGRx.js} +3 -3
  47. package/dist/{app-BlTv5xag.js → app-BcGXBcUK.js} +420 -409
  48. package/dist/app.js +1 -1
  49. package/dist/apps/mf-menu/src/components/ProductList.vue.d.ts +3 -3
  50. package/dist/apps/mf-menu/src/router/shared.d.ts +33 -0
  51. package/dist/apps/mf-menu/src/sdk/import-export.d.ts +8 -2
  52. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  53. package/dist/assets/{menu-compute-BzchkTYh.js → menu-compute-CFLJZpef.js} +2 -2
  54. package/dist/assets/{validate-menu-CTV_cJNG.js → validate-menu-DPQnAO0-.js} +2 -2
  55. package/dist/mf-menu.css +1 -1
  56. package/dist/{provide-dbE6Qt1z.js → provide-FZ08sGZH.js} +56332 -55258
  57. package/dist/{useActionFeedback-CdY_C_HX.js → useActionFeedback-BNYAkEZw.js} +1 -1
  58. package/package.json +1 -1
  59. package/dist/Preview-AdgGTYlQ.js +0 -321
  60. package/dist/ProductInternalTools-thlSvqbA.js +0 -2906
@@ -0,0 +1,2147 @@
1
+ import { defineComponent as E, ref as M, computed as O, openBlock as d, createBlock as j, unref as t, withCtx as B, createElementVNode as l, toDisplayString as g, createElementBlock as $, Fragment as R, renderList as V, createVNode as k, createCommentVNode as U, normalizeClass as D, normalizeStyle as oe, createTextVNode as X, h as c, withModifiers as J, shallowRef as pe, onBeforeUnmount as ge, watch as fe } from "vue";
2
+ import { useI18n as P } from "@feedmepos/mf-common";
3
+ import { useSnackbar as ne, components as u, SnackbarPosition as W } from "@feedmepos/ui-library";
4
+ import { _ as _e } from "./PageLayout.vue_vue_type_script_setup_true_lang-B3szUH39.js";
5
+ import { B as se, z as be, c as ye, b as G, a as ee, u as Y } from "./provide-FZ08sGZH.js";
6
+ import { r as he, c as ve, _ as le, a as we } from "./ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-CniqNe-9.js";
7
+ import { _ as re } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
+ const ke = /\.(jpe?g|png|webp|gif|bmp|heic|heif|tiff?)$/i, xe = 4;
9
+ function $e(y) {
10
+ return y.split("/").some((r) => r.startsWith(".") || r === "__MACOSX");
11
+ }
12
+ function ie(y) {
13
+ return Array.from(y).map((r) => ({
14
+ path: r.webkitRelativePath || r.name,
15
+ file: r
16
+ }));
17
+ }
18
+ async function Fe(y) {
19
+ const r = Array.from(y.items).map((e) => {
20
+ var F;
21
+ return (F = e.webkitGetAsEntry) == null ? void 0 : F.call(e);
22
+ }).filter((e) => !!e);
23
+ if (!r.length) return ie(Array.from(y.files));
24
+ const s = [];
25
+ async function w(e, F) {
26
+ if (e.isFile) {
27
+ const C = await new Promise(
28
+ (h, b) => e.file(h, b)
29
+ );
30
+ s.push({ path: `${F}${e.name}`, file: C });
31
+ return;
32
+ }
33
+ const p = e.createReader();
34
+ for (; ; ) {
35
+ const C = await new Promise(
36
+ (h, b) => p.readEntries(h, b)
37
+ );
38
+ if (!C.length) break;
39
+ for (const h of C) await w(h, `${F}${e.name}/`);
40
+ }
41
+ }
42
+ for (const e of r) await w(e, "");
43
+ return s;
44
+ }
45
+ function Ie(y) {
46
+ return new Promise(
47
+ (r, s) => ye(y, (w, e) => w ? s(w) : r(e))
48
+ );
49
+ }
50
+ function Z(y) {
51
+ var s;
52
+ const r = ((s = y.split(".").pop()) == null ? void 0 : s.toLowerCase()) ?? "";
53
+ return {
54
+ jpg: "image/jpeg",
55
+ jpeg: "image/jpeg",
56
+ png: "image/png",
57
+ webp: "image/webp",
58
+ gif: "image/gif",
59
+ json: "application/json"
60
+ }[r] ?? "application/octet-stream";
61
+ }
62
+ async function Ce(y) {
63
+ const r = [];
64
+ for (const s of y) {
65
+ if (!/\.zip$/i.test(s.path)) {
66
+ r.push(s);
67
+ continue;
68
+ }
69
+ const w = await Ie(
70
+ new Uint8Array(await s.file.arrayBuffer())
71
+ );
72
+ for (const [e, F] of Object.entries(w)) {
73
+ if (e.endsWith("/")) continue;
74
+ const p = e.split("/").pop() ?? e;
75
+ r.push({
76
+ path: e,
77
+ file: new File([F], p, { type: Z(e) })
78
+ });
79
+ }
80
+ }
81
+ return r;
82
+ }
83
+ async function ce(y) {
84
+ const r = await crypto.subtle.digest("SHA-256", y);
85
+ return Array.from(new Uint8Array(r)).map((s) => s.toString(16).padStart(2, "0")).join("");
86
+ }
87
+ function ue(y) {
88
+ return {
89
+ contentType: y.blob.type || "image/jpeg",
90
+ fileName: y.fileName,
91
+ width: y.width,
92
+ height: y.height,
93
+ byteLength: y.blob.size,
94
+ bytes: y.blob,
95
+ readDataUrl: () => he(y.blob)
96
+ };
97
+ }
98
+ async function de(y, r, s) {
99
+ const w = new Array(y.length);
100
+ let e = 0, F = 0;
101
+ async function p() {
102
+ for (; e < y.length; ) {
103
+ const C = e++;
104
+ w[C] = await r(y[C], C), s == null || s(++F);
105
+ }
106
+ }
107
+ return await Promise.all(Array.from({ length: xe }, p)), w;
108
+ }
109
+ async function Se(y, r, s) {
110
+ const w = (await Ce(y)).filter((m) => !$e(m.path)), e = w.find(
111
+ (m) => m.path.split("/").pop() === se
112
+ );
113
+ let F = null;
114
+ if (e)
115
+ try {
116
+ F = {
117
+ path: e.path,
118
+ data: JSON.parse(await e.file.text())
119
+ };
120
+ } catch {
121
+ F = null;
122
+ }
123
+ const p = w.filter((m) => ke.test(m.path)), C = w.length - p.length - (e ? 1 : 0), h = /* @__PURE__ */ new Map(), b = await de(
124
+ p,
125
+ async (m, v) => {
126
+ const x = `file-${v}`, T = await m.file.arrayBuffer(), I = /\.(jpe?g|png|webp)$/i.test(m.path) ? await ve(
127
+ new File([T], m.file.name, {
128
+ type: m.file.type || Z(m.path)
129
+ })
130
+ ).catch(() => null) : null;
131
+ return I && h.set(x, URL.createObjectURL(I.blob)), {
132
+ key: x,
133
+ path: m.path,
134
+ contentType: m.file.type || Z(m.path),
135
+ byteLength: m.file.size,
136
+ sha256: await ce(T),
137
+ prepared: I ? ue(I) : null
138
+ };
139
+ },
140
+ (m) => s == null ? void 0 : s(m, p.length)
141
+ );
142
+ return {
143
+ source: {
144
+ label: r.label,
145
+ kind: r.kind,
146
+ totalBytes: y.reduce((m, v) => m + v.file.size, 0),
147
+ files: b,
148
+ ignoredCount: C,
149
+ manifest: F
150
+ },
151
+ previews: h
152
+ };
153
+ }
154
+ function Q(y) {
155
+ for (const r of y.values()) URL.revokeObjectURL(r);
156
+ y.clear();
157
+ }
158
+ function Be(y) {
159
+ return ue(y);
160
+ }
161
+ async function ze(y, r, s) {
162
+ const w = {}, e = {};
163
+ let F = 0;
164
+ await de(
165
+ y.entries,
166
+ async (h) => {
167
+ try {
168
+ const b = await fetch(h.url, { cache: "no-store" });
169
+ if (!b.ok) throw new Error(String(b.status));
170
+ const m = await b.arrayBuffer();
171
+ w[h.key] = await ce(m), e[h.path] = new Uint8Array(m);
172
+ } catch {
173
+ F++;
174
+ }
175
+ },
176
+ (h) => s == null ? void 0 : s(h, y.entries.length)
177
+ );
178
+ const p = r(w);
179
+ e[p.path] = new TextEncoder().encode(p.content);
180
+ const C = await new Promise(
181
+ (h, b) => be(
182
+ e,
183
+ { level: 0 },
184
+ (m, v) => m ? b(m) : h(v)
185
+ )
186
+ );
187
+ return { blob: new Blob([C], { type: "application/zip" }), failed: F };
188
+ }
189
+ function Ue(y, r) {
190
+ const s = URL.createObjectURL(y), w = document.createElement("a");
191
+ w.href = s, w.download = r, w.click(), setTimeout(() => URL.revokeObjectURL(s), 1e4);
192
+ }
193
+ const je = { class: "flex flex-col gap-4" }, Te = { class: "fm-typo-en-title-sm-600" }, Le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Oe = { class: "flex flex-col gap-16" }, Re = { class: "flex flex-col gap-8" }, Ae = { class: "fm-typo-en-body-lg-600" }, Me = { class: "grid grid-cols-4 gap-8" }, Ve = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ee = { class: "flex flex-col gap-8" }, Pe = { class: "fm-typo-en-body-lg-600" }, Ke = {
194
+ key: 0,
195
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
196
+ }, Ne = { class: "fm-typo-en-body-sm-600" }, De = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ge = {
197
+ key: 0,
198
+ class: "flex flex-col gap-4"
199
+ }, qe = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, He = { class: "flex w-full items-center justify-end gap-8" }, We = /* @__PURE__ */ E({
200
+ __name: "BatchImageDownloadDialog",
201
+ props: {
202
+ overview: {}
203
+ },
204
+ emits: ["close"],
205
+ setup(y, { emit: r }) {
206
+ const s = y, w = r, { t: e } = P(), F = G(), p = ne(), C = ee(), h = M(
207
+ s.overview.download.formats.filter(
208
+ (I) => I.kind === "original" || s.overview.coverage.ratios.some(
209
+ (z) => z.id === I.id && z.required
210
+ )
211
+ ).map((I) => I.id)
212
+ ), b = M(!1), m = O(() => {
213
+ const I = e("menu.product_batch_image.download.sample_category"), z = e("menu.product_batch_image.setup.naming.sample_name"), f = (n) => e("menu.product_batch_image.download.tree_entry", {
214
+ path: e("menu.product_batch_image.download.sample_entry", {
215
+ category: I,
216
+ name: z,
217
+ suffix: n
218
+ })
219
+ });
220
+ return [
221
+ f(".jpg"),
222
+ f("@16x9.jpg"),
223
+ f(" #2.jpg"),
224
+ e("menu.product_batch_image.download.tree_last", {
225
+ path: se
226
+ })
227
+ ];
228
+ }), v = M(null), x = O(
229
+ () => s.overview.download.formats.map((I) => ({
230
+ id: I.id,
231
+ label: I.label ?? e("menu.product_image.manage.original")
232
+ }))
233
+ );
234
+ function T(I, z) {
235
+ h.value = z ? [.../* @__PURE__ */ new Set([...h.value, I])] : h.value.filter((f) => f !== I);
236
+ }
237
+ async function A() {
238
+ var I;
239
+ v.value = { done: 0, total: 0 };
240
+ try {
241
+ const z = await C.productBatchImage.planDownload({
242
+ formatIds: h.value,
243
+ coverOnly: b.value
244
+ });
245
+ if (z.kind !== "success") {
246
+ p.open({
247
+ type: "error",
248
+ title: z.kind === "failure" ? F(z.error.message) : z.kind === "rejected" ? e(((I = z.issues[0]) == null ? void 0 : I.code) ?? "menu.error.unexpected") : e("menu.error.unexpected"),
249
+ position: W.BOTTOM
250
+ });
251
+ return;
252
+ }
253
+ const f = z.value, { blob: n, failed: i } = await ze(
254
+ f,
255
+ (o) => C.productBatchImage.downloadManifest(f, o),
256
+ (o, a) => {
257
+ v.value = { done: o, total: a };
258
+ }
259
+ );
260
+ Ue(n, f.archiveName), p.open({
261
+ type: i ? "warning" : "success",
262
+ title: i ? e("menu.product_batch_image.download.partial", { count: i }) : e("menu.product_batch_image.download.done", {
263
+ count: f.entries.length
264
+ }),
265
+ position: W.BOTTOM
266
+ }), w("close");
267
+ } finally {
268
+ v.value = null;
269
+ }
270
+ }
271
+ return (I, z) => (d(), j(t(u).FmDialog, {
272
+ "model-value": !0,
273
+ "max-width": 600,
274
+ "onUpdate:modelValue": z[2] || (z[2] = (f) => !f && !v.value && w("close"))
275
+ }, {
276
+ "dialog-header": B(() => [
277
+ l("div", je, [
278
+ l("p", Te, g(t(e)("menu.product_batch_image.download.title")), 1),
279
+ l("p", Le, g(t(e)("menu.product_batch_image.download.subtitle", {
280
+ count: I.overview.productCount,
281
+ images: I.overview.coverage.withImages + I.overview.coverage.legacyOnly
282
+ })), 1)
283
+ ])
284
+ ]),
285
+ "dialog-footer": B(() => [
286
+ l("div", He, [
287
+ k(t(u).FmButton, {
288
+ variant: "tertiary",
289
+ label: t(e)("menu.common.actions.cancel"),
290
+ disabled: !!v.value,
291
+ onClick: z[1] || (z[1] = (f) => w("close"))
292
+ }, null, 8, ["label", "disabled"]),
293
+ k(t(u).FmButton, {
294
+ variant: "primary",
295
+ "prepend-icon": "download",
296
+ label: t(e)("menu.product_batch_image.download.action"),
297
+ disabled: !!v.value || !h.value.length,
298
+ onClick: A
299
+ }, null, 8, ["label", "disabled"])
300
+ ])
301
+ ]),
302
+ default: B(() => [
303
+ l("div", Oe, [
304
+ l("section", Re, [
305
+ l("p", Ae, g(t(e)("menu.product_batch_image.download.formats")), 1),
306
+ l("div", Me, [
307
+ (d(!0), $(R, null, V(x.value, (f) => (d(), j(t(u).FmCheckbox, {
308
+ key: f.id,
309
+ "model-value": h.value.includes(f.id),
310
+ value: "",
311
+ label: f.label,
312
+ "onUpdate:modelValue": (n) => T(f.id, n)
313
+ }, null, 8, ["model-value", "label", "onUpdate:modelValue"]))), 128))
314
+ ]),
315
+ l("p", Ve, g(t(e)("menu.product_batch_image.download.formats_hint")), 1)
316
+ ]),
317
+ l("section", Ee, [
318
+ l("p", Pe, g(t(e)("menu.product_batch_image.download.images")), 1),
319
+ k(t(u).FmRadioGroup, {
320
+ "model-value": b.value ? "cover" : "all",
321
+ class: "flex gap-16",
322
+ "onUpdate:modelValue": z[0] || (z[0] = (f) => b.value = f === "cover")
323
+ }, {
324
+ default: B(() => [
325
+ k(t(u).FmRadio, {
326
+ value: "all",
327
+ label: t(e)("menu.product_batch_image.download.all_images", {
328
+ count: I.overview.download.allImages
329
+ })
330
+ }, null, 8, ["label"]),
331
+ k(t(u).FmRadio, {
332
+ value: "cover",
333
+ label: t(e)("menu.product_batch_image.download.cover_only", {
334
+ count: I.overview.download.coverImages
335
+ })
336
+ }, null, 8, ["label"])
337
+ ]),
338
+ _: 1
339
+ }, 8, ["model-value"]),
340
+ I.overview.download.legacyProducts ? (d(), $("p", Ke, g(t(e)("menu.product_batch_image.download.legacy_hint", {
341
+ count: I.overview.download.legacyProducts
342
+ })), 1)) : U("", !0)
343
+ ]),
344
+ k(t(u).FmCard, {
345
+ variant: "outlined",
346
+ class: "flex flex-col gap-4 p-12"
347
+ }, {
348
+ default: B(() => [
349
+ l("code", Ne, g(t(e)("menu.product_batch_image.download.sample_archive")), 1),
350
+ (d(!0), $(R, null, V(m.value, (f) => (d(), $("code", {
351
+ key: f,
352
+ class: "fm-typo-en-body-sm-400"
353
+ }, g(f), 1))), 128))
354
+ ]),
355
+ _: 1
356
+ }),
357
+ l("p", De, g(t(e)("menu.product_batch_image.download.round_trip_hint")), 1),
358
+ v.value ? (d(), $("div", Ge, [
359
+ l("p", qe, g(t(e)("menu.product_batch_image.download.progress", {
360
+ done: v.value.done,
361
+ total: v.value.total
362
+ })), 1),
363
+ k(t(u).FmProgressBar, {
364
+ value: v.value.total ? v.value.done / v.value.total * 100 : 0,
365
+ indeterminate: !v.value.total
366
+ }, null, 8, ["value", "indeterminate"])
367
+ ])) : U("", !0)
368
+ ])
369
+ ]),
370
+ _: 1
371
+ }));
372
+ }
373
+ }), Xe = { class: "flex flex-wrap gap-4" }, Je = /* @__PURE__ */ E({
374
+ __name: "BatchImageFormatChips",
375
+ props: {
376
+ formats: {}
377
+ },
378
+ setup(y) {
379
+ const r = y, { t: s } = P(), w = {
380
+ uploaded: "is-uploaded",
381
+ file: "is-uploaded",
382
+ ai: "is-ai",
383
+ generating: "is-generating",
384
+ failed: "is-failed",
385
+ missing: "is-missing"
386
+ };
387
+ function e(p) {
388
+ switch (p) {
389
+ case "ai":
390
+ return s("menu.product_batch_image.format.ai");
391
+ case "generating":
392
+ return s("menu.product_batch_image.format.generating");
393
+ case "failed":
394
+ return s("menu.product_batch_image.format.failed");
395
+ case "missing":
396
+ return s("menu.product_batch_image.format.missing");
397
+ case "file":
398
+ return s("menu.product_batch_image.format.file");
399
+ default:
400
+ return "";
401
+ }
402
+ }
403
+ const F = () => r.formats.map((p) => {
404
+ const C = e(p.source);
405
+ return {
406
+ id: p.id,
407
+ label: C ? s("menu.product_batch_image.format.chip", {
408
+ label: p.label,
409
+ state: C
410
+ }) : p.label,
411
+ variant: w[p.source],
412
+ ratio: `${p.width} / ${p.height}`
413
+ };
414
+ });
415
+ return (p, C) => (d(), $("div", Xe, [
416
+ (d(!0), $(R, null, V(F(), (h) => (d(), $("span", {
417
+ key: h.id,
418
+ class: D(["batch-format-chip fm-typo-en-body-sm-600", h.variant])
419
+ }, [
420
+ l("i", {
421
+ class: "batch-format-chip__ratio",
422
+ style: oe({ aspectRatio: h.ratio }),
423
+ "aria-hidden": "true"
424
+ }, null, 4),
425
+ X(" " + g(h.label), 1)
426
+ ], 2))), 128))
427
+ ]));
428
+ }
429
+ }), te = /* @__PURE__ */ re(Je, [["__scopeId", "data-v-ed54f76d"]]), Qe = { class: "inline-flex items-center gap-4 whitespace-nowrap rounded-[6px] bg-fm-color-neutral-gray-100 py-[1px] pl-[6px] pr-8 fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, me = /* @__PURE__ */ E({
430
+ __name: "BatchImageLegacyChip",
431
+ setup(y) {
432
+ const { t: r } = P();
433
+ return (s, w) => (d(), $("span", Qe, [
434
+ k(t(u).FmIcon, {
435
+ name: "image",
436
+ outline: "",
437
+ color: "neutral-gray-400",
438
+ size: "sm"
439
+ }),
440
+ X(" " + g(t(r)("menu.product_batch_image.legacy_thumbnail")), 1)
441
+ ]));
442
+ }
443
+ }), Ye = ["src", "alt"], N = /* @__PURE__ */ E({
444
+ __name: "BatchImageThumb",
445
+ props: {
446
+ src: { default: null },
447
+ alt: {},
448
+ size: { default: "md" }
449
+ },
450
+ setup(y) {
451
+ return (r, s) => (d(), j(t(u).FmCard, {
452
+ variant: "outlined",
453
+ class: D([
454
+ "flex shrink-0 items-center justify-center overflow-hidden rounded-md",
455
+ r.size === "sm" ? "w-32 !h-32" : r.size === "lg" ? "w-64 !h-64" : "w-40 !h-40"
456
+ ])
457
+ }, {
458
+ default: B(() => [
459
+ r.src ? (d(), $("img", {
460
+ key: 0,
461
+ src: r.src,
462
+ alt: r.alt,
463
+ class: "h-full w-full object-cover"
464
+ }, null, 8, Ye)) : (d(), j(t(u).FmIcon, {
465
+ key: 1,
466
+ name: "image",
467
+ outline: "",
468
+ color: "neutral-gray-300",
469
+ size: "sm"
470
+ }))
471
+ ]),
472
+ _: 1
473
+ }, 8, ["class"]));
474
+ }
475
+ }), Ze = /* @__PURE__ */ E({
476
+ __name: "BatchImageBadge",
477
+ props: {
478
+ label: {},
479
+ variant: {}
480
+ },
481
+ setup(y) {
482
+ return (r, s) => (d(), $("span", {
483
+ class: D(["batch-image-badge", [
484
+ `is-${r.variant}`,
485
+ r.variant === "cover" ? "" : "fm-typo-en-body-sm-600"
486
+ ]])
487
+ }, g(r.label), 3));
488
+ }
489
+ }), K = /* @__PURE__ */ re(Ze, [["__scopeId", "data-v-10dcba04"]]), et = { class: "flex flex-col gap-4" }, tt = { class: "fm-typo-en-title-sm-600" }, at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ot = { class: "flex flex-col gap-16" }, nt = { class: "flex flex-col gap-8" }, st = { class: "flex justify-between fm-typo-en-body-md-400" }, lt = { class: "fm-typo-en-body-md-600" }, rt = { class: "text-fm-color-typo-secondary" }, it = { class: "flex items-start gap-12" }, ct = { class: "flex flex-col" }, ut = { class: "fm-typo-en-body-md-600" }, dt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, mt = { class: "flex w-full items-center justify-between gap-12" }, pt = { class: "flex flex-col" }, gt = { class: "fm-typo-en-body-md-600" }, ft = {
490
+ key: 0,
491
+ class: "fm-typo-en-body-sm-400 text-fm-color-system-error-300"
492
+ }, _t = { class: "flex w-full items-center justify-between gap-12" }, bt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, yt = /* @__PURE__ */ E({
493
+ __name: "BatchImageProgressDialog",
494
+ props: {
495
+ progress: {}
496
+ },
497
+ emits: ["stop"],
498
+ setup(y, { emit: r }) {
499
+ const s = y, w = r, { t: e } = P(), F = G(), p = O(
500
+ () => s.progress.totalFiles ? Math.round(
501
+ s.progress.uploadedFiles / s.progress.totalFiles * 100
502
+ ) : 0
503
+ ), C = O(() => {
504
+ const v = ["upload", "save", "cleanup"].indexOf(s.progress.step);
505
+ return [
506
+ {
507
+ key: "upload",
508
+ title: e("menu.product_batch_image.progress.step.upload"),
509
+ detail: e("menu.product_batch_image.progress.step.upload_detail", {
510
+ done: s.progress.finishedProducts,
511
+ total: s.progress.totalProducts
512
+ }),
513
+ state: v > 0 ? "done" : "now"
514
+ },
515
+ {
516
+ key: "save",
517
+ title: e("menu.product_batch_image.progress.step.save"),
518
+ detail: e("menu.product_batch_image.progress.step.save_detail"),
519
+ state: v > 1 ? "done" : v === 1 ? "now" : "next"
520
+ },
521
+ {
522
+ key: "generate",
523
+ title: e("menu.product_batch_image.progress.step.generate"),
524
+ detail: e("menu.product_batch_image.progress.step.generate_detail", {
525
+ count: s.progress.generatingFormats
526
+ }),
527
+ state: "next"
528
+ }
529
+ ];
530
+ });
531
+ function h(m, v, x) {
532
+ switch (m) {
533
+ case "done":
534
+ return e("menu.product_batch_image.progress.status.done");
535
+ case "failed":
536
+ return e("menu.product_batch_image.progress.status.failed");
537
+ case "skipped":
538
+ return e("menu.product_batch_image.progress.status.skipped");
539
+ case "uploading":
540
+ return e("menu.product_batch_image.progress.status.uploading", {
541
+ done: v,
542
+ total: x
543
+ });
544
+ default:
545
+ return e("menu.product_batch_image.progress.status.waiting");
546
+ }
547
+ }
548
+ const b = {
549
+ done: "success",
550
+ failed: "critical",
551
+ skipped: "neutral",
552
+ uploading: "info",
553
+ waiting: "neutral"
554
+ };
555
+ return (m, v) => (d(), j(t(u).FmDialog, {
556
+ "model-value": !0,
557
+ "max-width": 620,
558
+ "close-button": !1
559
+ }, {
560
+ "dialog-header": B(() => [
561
+ l("div", et, [
562
+ l("p", tt, g(t(e)("menu.product_batch_image.progress.title")), 1),
563
+ l("p", at, g(t(e)("menu.product_batch_image.progress.keep_open")), 1)
564
+ ])
565
+ ]),
566
+ "dialog-footer": B(() => [
567
+ l("div", _t, [
568
+ l("p", bt, g(t(e)("menu.product_batch_image.progress.stop_hint")), 1),
569
+ k(t(u).FmButton, {
570
+ variant: "secondary",
571
+ disabled: m.progress.stopping || m.progress.step !== "upload",
572
+ label: m.progress.stopping ? t(e)("menu.product_batch_image.progress.stopping") : t(e)("menu.product_batch_image.progress.stop"),
573
+ onClick: v[0] || (v[0] = (x) => w("stop"))
574
+ }, null, 8, ["disabled", "label"])
575
+ ])
576
+ ]),
577
+ default: B(() => [
578
+ l("div", ot, [
579
+ l("div", nt, [
580
+ l("div", st, [
581
+ l("span", lt, g(t(e)("menu.product_batch_image.progress.uploading")), 1),
582
+ l("span", rt, g(t(e)("menu.product_batch_image.progress.counts", {
583
+ files: m.progress.uploadedFiles,
584
+ totalFiles: m.progress.totalFiles,
585
+ products: m.progress.finishedProducts,
586
+ totalProducts: m.progress.totalProducts
587
+ })), 1)
588
+ ]),
589
+ k(t(u).FmProgressBar, { value: p.value }, null, 8, ["value"])
590
+ ]),
591
+ k(t(u).FmList, null, {
592
+ default: B(() => [
593
+ (d(!0), $(R, null, V(C.value, (x) => (d(), j(t(u).FmListItem, {
594
+ key: x.key,
595
+ class: "!px-0"
596
+ }, {
597
+ default: B(() => [
598
+ l("div", it, [
599
+ k(t(u).FmIcon, {
600
+ name: x.state === "done" ? "check_circle" : x.state === "now" ? "pending" : "radio_button_unchecked",
601
+ color: x.state === "done" ? "system-success-300" : x.state === "now" ? "primary" : "neutral-gray-300"
602
+ }, null, 8, ["name", "color"]),
603
+ l("div", ct, [
604
+ l("span", ut, g(x.title), 1),
605
+ l("span", dt, g(x.detail), 1)
606
+ ])
607
+ ])
608
+ ]),
609
+ _: 2
610
+ }, 1024))), 128))
611
+ ]),
612
+ _: 1
613
+ }),
614
+ k(t(u).FmList, {
615
+ separator: "",
616
+ class: "max-h-[240px] overflow-y-auto rounded-md border border-fm-color-neutral-gray-100"
617
+ }, {
618
+ default: B(() => [
619
+ (d(!0), $(R, null, V(m.progress.rows, (x) => (d(), j(t(u).FmListItem, {
620
+ key: x.productId
621
+ }, {
622
+ default: B(() => [
623
+ l("div", mt, [
624
+ l("div", pt, [
625
+ l("span", gt, g(x.name), 1),
626
+ x.error ? (d(), $("span", ft, g(t(F)(x.error)), 1)) : U("", !0)
627
+ ]),
628
+ k(K, {
629
+ variant: b[x.status],
630
+ label: h(x.status, x.doneFiles, x.totalFiles)
631
+ }, null, 8, ["variant", "label"])
632
+ ])
633
+ ]),
634
+ _: 2
635
+ }, 1024))), 128))
636
+ ]),
637
+ _: 1
638
+ })
639
+ ])
640
+ ]),
641
+ _: 1
642
+ }));
643
+ }
644
+ }), ht = { class: "flex flex-col gap-16 py-16" }, vt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, wt = { class: "fm-typo-en-body-md-400" }, kt = { class: "fm-typo-en-body-md-400" }, xt = { class: "fm-typo-en-body-md-400" }, $t = {
645
+ key: 3,
646
+ class: "fm-typo-en-body-sm-400 text-fm-color-system-warning-300"
647
+ }, Ft = { class: "grid grid-cols-2 gap-12 md:grid-cols-4" }, It = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ct = { class: "fm-typo-en-title-sm-600 tabular-nums" }, St = {
648
+ key: 0,
649
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
650
+ }, Bt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, zt = /* @__PURE__ */ E({
651
+ __name: "BatchImageResult",
652
+ props: {
653
+ result: {},
654
+ sourceLabel: {}
655
+ },
656
+ emits: ["retry", "close"],
657
+ setup(y, { emit: r }) {
658
+ const s = y, w = r, { t: e } = P(), F = G(), p = {
659
+ done: ["success", "menu.product_batch_image.result.status.done"],
660
+ generating: ["info", "menu.product_batch_image.result.status.generating"],
661
+ format_failed: [
662
+ "warning",
663
+ "menu.product_batch_image.result.status.format_failed"
664
+ ],
665
+ failed: ["critical", "menu.product_batch_image.result.status.failed"],
666
+ partial: ["warning", "menu.product_batch_image.result.status.partial"]
667
+ }, C = O(() => [
668
+ {
669
+ id: "product",
670
+ header: () => e("menu.product_batch_image.columns.product"),
671
+ enableSorting: !1,
672
+ cell: (b) => {
673
+ const m = b.row.original;
674
+ return c("div", { class: "flex items-center gap-8 py-8" }, [
675
+ c(N, { src: m.coverUrl, alt: m.name }),
676
+ c("div", { class: "flex flex-col" }, [
677
+ c("span", { class: "fm-typo-en-body-md-600" }, m.name),
678
+ m.code ? c(
679
+ "span",
680
+ {
681
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
682
+ },
683
+ m.code
684
+ ) : null
685
+ ])
686
+ ]);
687
+ }
688
+ },
689
+ {
690
+ id: "images",
691
+ header: () => e("menu.product_batch_image.columns.images"),
692
+ size: 100,
693
+ enableSorting: !1,
694
+ cell: (b) => c(
695
+ "span",
696
+ { class: "fm-typo-en-body-md-400" },
697
+ String(b.row.original.imageCount)
698
+ )
699
+ },
700
+ {
701
+ id: "formats",
702
+ header: () => e("menu.product_batch_image.columns.formats"),
703
+ enableSorting: !1,
704
+ cell: (b) => {
705
+ const m = b.row.original;
706
+ return m.error ? c(
707
+ "span",
708
+ { class: "fm-typo-en-body-sm-400 text-fm-color-system-error-300" },
709
+ F(m.error)
710
+ ) : m.formats ? c(te, { formats: m.formats }) : null;
711
+ }
712
+ },
713
+ {
714
+ id: "status",
715
+ header: () => e("menu.product_batch_image.result.columns.status"),
716
+ size: 170,
717
+ enableSorting: !1,
718
+ cell: (b) => {
719
+ const m = b.row.original, [v, x] = p[m.status];
720
+ return c(K, { variant: v, label: e(x) });
721
+ }
722
+ }
723
+ ]), h = O(
724
+ () => s.result.failed.length ? [
725
+ {
726
+ label: e("menu.product_batch_image.result.retry", {
727
+ count: s.result.failed.length
728
+ }),
729
+ click: () => w("retry")
730
+ }
731
+ ] : []
732
+ );
733
+ return (b, m) => (d(), j(le, {
734
+ show: !0,
735
+ title: t(e)("menu.product_batch_image.result.title"),
736
+ "primary-action": { label: t(e)("menu.product_batch_image.result.done") },
737
+ "secondary-actions": h.value,
738
+ onOnPrimary: m[0] || (m[0] = (v) => w("close")),
739
+ onOnCancel: m[1] || (m[1] = (v) => w("close"))
740
+ }, {
741
+ default: B(() => [
742
+ l("div", ht, [
743
+ l("p", vt, g(b.sourceLabel), 1),
744
+ b.result.updated ? (d(), j(t(u).FmCard, {
745
+ key: 0,
746
+ variant: "outlined",
747
+ class: "flex items-center gap-8 p-12"
748
+ }, {
749
+ default: B(() => [
750
+ k(t(u).FmIcon, {
751
+ name: "check_circle",
752
+ color: "system-success-300"
753
+ }),
754
+ l("span", wt, g(t(e)("menu.product_batch_image.result.updated", {
755
+ count: b.result.updated
756
+ })), 1)
757
+ ]),
758
+ _: 1
759
+ })) : U("", !0),
760
+ b.result.saveError ? (d(), j(t(u).FmCard, {
761
+ key: 1,
762
+ variant: "outlined",
763
+ class: "flex items-center gap-8 p-12"
764
+ }, {
765
+ default: B(() => [
766
+ k(t(u).FmIcon, {
767
+ name: "error",
768
+ color: "system-error-300"
769
+ }),
770
+ l("span", kt, g(t(e)("menu.product_batch_image.result.save_failed", {
771
+ reason: t(F)(b.result.saveError)
772
+ })), 1)
773
+ ]),
774
+ _: 1
775
+ })) : b.result.failed.length ? (d(), j(t(u).FmCard, {
776
+ key: 2,
777
+ variant: "outlined",
778
+ class: "flex items-center gap-8 p-12"
779
+ }, {
780
+ default: B(() => [
781
+ k(t(u).FmIcon, {
782
+ name: "error",
783
+ color: "system-error-300"
784
+ }),
785
+ l("span", xt, g(t(e)("menu.product_batch_image.result.failed", {
786
+ count: b.result.failed.length
787
+ })), 1)
788
+ ]),
789
+ _: 1
790
+ })) : U("", !0),
791
+ b.result.cleanupFailed ? (d(), $("p", $t, g(t(e)("menu.product_image.error.cleanup_failed")), 1)) : U("", !0),
792
+ l("div", Ft, [
793
+ (d(!0), $(R, null, V([
794
+ [
795
+ "menu.product_batch_image.result.kpi.updated",
796
+ String(b.result.updated),
797
+ null
798
+ ],
799
+ [
800
+ "menu.product_batch_image.result.kpi.images",
801
+ String(b.result.imagesUploaded),
802
+ null
803
+ ],
804
+ [
805
+ "menu.product_batch_image.result.kpi.formats",
806
+ String(b.result.formats.done),
807
+ t(e)("menu.product_batch_image.coverage.of_total", {
808
+ total: b.result.formats.total
809
+ })
810
+ ],
811
+ [
812
+ "menu.product_batch_image.result.kpi.skipped",
813
+ String(b.result.skippedFiles),
814
+ null
815
+ ]
816
+ ], (v) => (d(), j(t(u).FmCard, {
817
+ key: v[0],
818
+ variant: "outlined",
819
+ class: "flex flex-col gap-4 p-12"
820
+ }, {
821
+ default: B(() => [
822
+ l("span", It, g(t(e)(v[0])), 1),
823
+ l("span", Ct, [
824
+ X(g(v[1]) + " ", 1),
825
+ v[2] ? (d(), $("small", St, g(v[2]), 1)) : U("", !0)
826
+ ])
827
+ ]),
828
+ _: 2
829
+ }, 1024))), 128))
830
+ ]),
831
+ l("p", Bt, g(t(e)("menu.product_batch_image.result.generation_hint")), 1),
832
+ k(t(u).FmTable, {
833
+ "column-defs": C.value,
834
+ "row-data": [...b.result.rows],
835
+ "page-size": b.result.rows.length || 1,
836
+ "get-row-id": (v) => v.productId,
837
+ "hide-footer": "",
838
+ "shrink-at": !1
839
+ }, null, 8, ["column-defs", "row-data", "page-size", "get-row-id"])
840
+ ])
841
+ ]),
842
+ _: 1
843
+ }, 8, ["title", "primary-action", "secondary-actions"]));
844
+ }
845
+ }), Ut = {
846
+ key: 0,
847
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
848
+ }, jt = { class: "flex flex-col gap-16 py-16" }, Tt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Lt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ot = { class: "flex-1 fm-typo-en-body-md-400" }, Rt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, At = /* @__PURE__ */ E({
849
+ __name: "BatchImageReview",
850
+ props: {
851
+ session: {},
852
+ view: {},
853
+ previews: {}
854
+ },
855
+ emits: ["back", "start", "crop"],
856
+ setup(y, { emit: r }) {
857
+ const s = y, w = r, { t: e } = P(), F = G(), p = M("ready"), C = O(() => [
858
+ {
859
+ value: "ready",
860
+ label: e("menu.product_batch_image.review.tabs.ready", {
861
+ count: s.view.counts.ready
862
+ })
863
+ },
864
+ {
865
+ value: "attention",
866
+ label: e("menu.product_batch_image.review.tabs.attention", {
867
+ count: s.view.counts.attentionOpen
868
+ })
869
+ },
870
+ {
871
+ value: "unmatched",
872
+ label: e("menu.product_batch_image.review.tabs.unmatched", {
873
+ count: s.view.counts.unmatchedOpen
874
+ })
875
+ }
876
+ ]), h = O(
877
+ () => {
878
+ var o;
879
+ return [
880
+ (o = s.view.source) == null ? void 0 : o.label,
881
+ s.view.via === "manifest" ? e("menu.product_batch_image.review.via_manifest") : e("menu.product_batch_image.review.via_name"),
882
+ s.view.via === "name" ? s.view.mode === "replace" ? e("menu.product_batch_image.setup.mode.replace") : e("menu.product_batch_image.setup.mode.append") : null,
883
+ s.view.generateMissing && s.view.via === "name" ? e("menu.product_batch_image.review.ai_fills") : null
884
+ ].filter(Boolean).join(e("menu.product_batch_image.separator"));
885
+ }
886
+ ), b = (o) => o.split("/").pop() ?? o;
887
+ function m(o) {
888
+ const a = o.change;
889
+ switch (a.kind) {
890
+ case "replace":
891
+ return e("menu.product_batch_image.review.change.replace", {
892
+ from: a.from,
893
+ to: a.to
894
+ });
895
+ case "replace_legacy":
896
+ return e("menu.product_batch_image.review.change.replace_legacy");
897
+ case "add":
898
+ return e("menu.product_batch_image.review.change.add", {
899
+ count: a.to
900
+ });
901
+ case "append":
902
+ return e("menu.product_batch_image.review.change.append", {
903
+ from: a.from,
904
+ to: a.to
905
+ });
906
+ case "update":
907
+ return e("menu.product_batch_image.review.change.update", {
908
+ count: a.files
909
+ });
910
+ }
911
+ }
912
+ const v = O(() => [
913
+ {
914
+ id: "include",
915
+ header: () => c(u.FmCheckbox, {
916
+ modelValue: s.view.counts.included === s.view.counts.ready,
917
+ value: "",
918
+ "aria-label": e("menu.product_batch_image.review.include_all"),
919
+ "onUpdate:modelValue": (o) => s.session.setAllIncluded(o)
920
+ }),
921
+ size: 48,
922
+ enableSorting: !1,
923
+ cell: (o) => {
924
+ const a = o.row.original;
925
+ return c(u.FmCheckbox, {
926
+ modelValue: a.included,
927
+ value: "",
928
+ "aria-label": e("menu.product_batch_image.review.include", {
929
+ name: a.name
930
+ }),
931
+ "onUpdate:modelValue": (_) => s.session.setIncluded(a.productId, _)
932
+ });
933
+ }
934
+ },
935
+ {
936
+ id: "product",
937
+ header: () => e("menu.product_batch_image.columns.product"),
938
+ size: 220,
939
+ enableSorting: !1,
940
+ cell: (o) => {
941
+ const a = o.row.original;
942
+ return c("div", { class: "flex flex-col gap-4 py-8" }, [
943
+ c("span", { class: "fm-typo-en-body-md-600" }, a.name),
944
+ a.code ? c(
945
+ "span",
946
+ {
947
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
948
+ },
949
+ a.code
950
+ ) : null,
951
+ a.renamedFrom ? c(K, {
952
+ variant: "info",
953
+ label: e("menu.product_batch_image.review.renamed", {
954
+ name: a.name
955
+ })
956
+ }) : null
957
+ ]);
958
+ }
959
+ },
960
+ {
961
+ id: "current",
962
+ header: () => e("menu.product_batch_image.review.columns.current"),
963
+ size: 160,
964
+ enableSorting: !1,
965
+ cell: (o) => {
966
+ const a = o.row.original;
967
+ return a.currentCount ? c("div", { class: "flex items-center" }, [
968
+ ...a.currentImageUrls.map(
969
+ (_, L) => c(N, {
970
+ key: _,
971
+ src: _,
972
+ alt: e("menu.product_batch_image.image_alt", {
973
+ name: a.name,
974
+ index: L + 1
975
+ }),
976
+ class: L ? "-ml-12" : ""
977
+ })
978
+ ),
979
+ a.currentLegacy ? c(me, { class: "ml-8" }) : null
980
+ ]) : c(
981
+ "span",
982
+ { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
983
+ e("menu.product_batch_image.no_image")
984
+ );
985
+ }
986
+ },
987
+ {
988
+ id: "next",
989
+ header: () => e("menu.product_batch_image.review.columns.next"),
990
+ enableSorting: !1,
991
+ cell: (o) => {
992
+ const a = o.row.original, _ = a.changes.filter((S) => S.kind !== "new_image").map(
993
+ (S) => c(
994
+ "div",
995
+ { class: "flex items-center gap-8", key: S.fileKey },
996
+ [
997
+ c(N, {
998
+ src: s.previews.get(S.fileKey) ?? null,
999
+ alt: b(S.path),
1000
+ size: "sm"
1001
+ }),
1002
+ c("div", { class: "flex flex-col" }, [
1003
+ c(
1004
+ "code",
1005
+ { class: "fm-typo-en-body-sm-600" },
1006
+ b(S.path)
1007
+ ),
1008
+ c(
1009
+ "span",
1010
+ {
1011
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
1012
+ },
1013
+ S.kind === "replace_original" ? S.regenerated ? e(
1014
+ "menu.product_batch_image.review.replace_original_ai",
1015
+ {
1016
+ index: S.imageIndex,
1017
+ count: S.regenerated
1018
+ }
1019
+ ) : e(
1020
+ "menu.product_batch_image.review.replace_original",
1021
+ {
1022
+ index: S.imageIndex
1023
+ }
1024
+ ) : e("menu.product_batch_image.review.replace_format", {
1025
+ index: S.imageIndex,
1026
+ ratio: S.formatLabel ?? ""
1027
+ })
1028
+ )
1029
+ ])
1030
+ ]
1031
+ )
1032
+ ), L = a.newImages.map(
1033
+ (S) => c(
1034
+ u.FmCard,
1035
+ {
1036
+ key: S.fileKey,
1037
+ variant: "outlined",
1038
+ class: "flex gap-8 p-8"
1039
+ },
1040
+ () => [
1041
+ c("div", { class: "relative" }, [
1042
+ c(N, {
1043
+ src: s.previews.get(S.fileKey) ?? null,
1044
+ alt: b(S.fileName),
1045
+ size: "lg"
1046
+ }),
1047
+ S.isCover ? c(K, {
1048
+ class: "absolute left-4 top-4",
1049
+ variant: "cover",
1050
+ label: e("menu.product_image.cover_badge")
1051
+ }) : null
1052
+ ]),
1053
+ c("div", { class: "flex flex-col gap-4" }, [
1054
+ c(
1055
+ "code",
1056
+ { class: "fm-typo-en-body-sm-600" },
1057
+ e("menu.product_batch_image.review.new_image", {
1058
+ index: S.position,
1059
+ name: b(S.fileName)
1060
+ })
1061
+ ),
1062
+ S.formats.length ? c(te, { formats: S.formats }) : null
1063
+ ])
1064
+ ]
1065
+ )
1066
+ );
1067
+ return c("div", { class: "flex flex-wrap gap-8 py-8" }, [
1068
+ ..._,
1069
+ ...L
1070
+ ]);
1071
+ }
1072
+ },
1073
+ {
1074
+ id: "change",
1075
+ header: () => e("menu.product_batch_image.review.columns.change"),
1076
+ size: 170,
1077
+ enableSorting: !1,
1078
+ cell: (o) => {
1079
+ const a = o.row.original;
1080
+ return c("div", { class: "flex flex-col items-start gap-4 py-8" }, [
1081
+ c(K, {
1082
+ variant: a.included ? a.change.kind === "add" ? "success" : "info" : "neutral",
1083
+ label: a.included ? m(a) : e("menu.product_batch_image.review.excluded")
1084
+ }),
1085
+ a.included && a.removedImages > 0 ? c(
1086
+ "span",
1087
+ {
1088
+ class: "fm-typo-en-body-sm-600 text-fm-color-system-warning-400"
1089
+ },
1090
+ e("menu.product_batch_image.review.images_removed", {
1091
+ count: a.removedImages
1092
+ })
1093
+ ) : null
1094
+ ]);
1095
+ }
1096
+ }
1097
+ ]), x = {
1098
+ skip: "menu.product_batch_image.attention.actions.skip",
1099
+ add_as_new_image: "menu.product_batch_image.attention.actions.add_as_new_image",
1100
+ use_as_original: "menu.product_batch_image.attention.actions.use_as_original",
1101
+ add_format: "menu.product_batch_image.attention.actions.add_format"
1102
+ };
1103
+ function T(o) {
1104
+ return o.code ? e("menu.product_batch_image.product_option", {
1105
+ name: o.name,
1106
+ code: o.code
1107
+ }) : o.name;
1108
+ }
1109
+ const A = M(""), I = O(() => (s.view, s.session.productOptions(A.value).map((o) => ({
1110
+ label: T(o),
1111
+ value: o.productId
1112
+ }))));
1113
+ function z(o) {
1114
+ return o && !I.value.some((a) => a.value === o.productId) ? [
1115
+ { label: T(o), value: o.productId },
1116
+ ...I.value
1117
+ ] : I.value;
1118
+ }
1119
+ function f(o, a, _, L) {
1120
+ return c("div", { class: "flex items-center gap-8 py-8" }, [
1121
+ c(N, {
1122
+ src: s.previews.get(o) ?? null,
1123
+ alt: b(a)
1124
+ }),
1125
+ c("div", { class: "flex flex-col" }, [
1126
+ c("code", { class: "fm-typo-en-body-sm-600 break-all" }, a),
1127
+ _ && L ? c(
1128
+ "span",
1129
+ { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
1130
+ e("menu.product_batch_image.review.dimensions", {
1131
+ width: _,
1132
+ height: L
1133
+ })
1134
+ ) : null
1135
+ ])
1136
+ ]);
1137
+ }
1138
+ const n = O(() => [
1139
+ {
1140
+ id: "file",
1141
+ header: () => e("menu.product_batch_image.review.columns.file"),
1142
+ size: 280,
1143
+ enableSorting: !1,
1144
+ cell: (o) => {
1145
+ const a = o.row.original;
1146
+ return f(a.fileKey, a.path, a.width, a.height);
1147
+ }
1148
+ },
1149
+ {
1150
+ id: "product",
1151
+ header: () => e("menu.product_batch_image.columns.product"),
1152
+ size: 200,
1153
+ enableSorting: !1,
1154
+ cell: (o) => {
1155
+ const a = o.row.original;
1156
+ return c(
1157
+ "span",
1158
+ { class: "fm-typo-en-body-md-400" },
1159
+ a.product ? T(a.product) : a.candidates.map(T).join(", ") || e("menu.catalog.empty_value")
1160
+ );
1161
+ }
1162
+ },
1163
+ {
1164
+ id: "issue",
1165
+ header: () => e("menu.product_batch_image.review.columns.issue"),
1166
+ enableSorting: !1,
1167
+ cell: (o) => {
1168
+ const a = o.row.original;
1169
+ return c("div", { class: "flex flex-col gap-4 py-8" }, [
1170
+ c(
1171
+ "span",
1172
+ {
1173
+ class: [
1174
+ "fm-typo-en-body-md-600",
1175
+ a.state === "fixed" ? "text-fm-color-system-success-300" : a.state === "skipped" ? "text-fm-color-typo-secondary" : ""
1176
+ ]
1177
+ },
1178
+ F(a.title)
1179
+ ),
1180
+ c(
1181
+ "span",
1182
+ { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
1183
+ F(a.detail)
1184
+ )
1185
+ ]);
1186
+ }
1187
+ },
1188
+ {
1189
+ id: "fix",
1190
+ header: () => e("menu.product_batch_image.review.columns.fix"),
1191
+ size: 320,
1192
+ enableSorting: !1,
1193
+ cell: (o) => {
1194
+ const a = o.row.original;
1195
+ return a.state !== "open" ? c("div", { class: "flex items-center gap-8" }, [
1196
+ c(K, {
1197
+ variant: a.state === "fixed" ? "success" : "neutral",
1198
+ label: a.state === "fixed" ? a.product && a.issue === "ambiguous" ? e("menu.product_batch_image.attention.assigned_to", {
1199
+ name: T(a.product)
1200
+ }) : e("menu.product_batch_image.attention.fixed") : e("menu.product_batch_image.attention.skipped.title")
1201
+ }),
1202
+ a.undoable ? c(u.FmButton, {
1203
+ variant: "tertiary",
1204
+ label: e("menu.product_batch_image.attention.actions.undo"),
1205
+ onClick: () => s.session.resolve(a.fileKey, null)
1206
+ }) : null
1207
+ ]) : a.issue === "ambiguous" ? c("div", { class: "flex items-center gap-8" }, [
1208
+ c(u.FmSelect, {
1209
+ class: "flex-1",
1210
+ modelValue: null,
1211
+ items: a.candidates.map((_) => ({
1212
+ label: T(_),
1213
+ value: _.productId
1214
+ })),
1215
+ placeholder: e(
1216
+ "menu.product_batch_image.attention.choose_product"
1217
+ ),
1218
+ "aria-label": e(
1219
+ "menu.product_batch_image.attention.choose_product_for",
1220
+ {
1221
+ file: b(a.path)
1222
+ }
1223
+ ),
1224
+ "onUpdate:modelValue": (_) => s.session.assign(a.fileKey, _)
1225
+ }),
1226
+ c(u.FmButton, {
1227
+ variant: "tertiary",
1228
+ label: e(x.skip),
1229
+ onClick: () => s.session.resolve(a.fileKey, "skip")
1230
+ })
1231
+ ]) : c("div", { class: "flex flex-wrap items-center gap-8" }, [
1232
+ a.crop ? c(u.FmButton, {
1233
+ variant: "primary",
1234
+ prependIcon: "crop",
1235
+ label: e("menu.product_batch_image.attention.actions.crop", {
1236
+ ratio: a.crop.label
1237
+ }),
1238
+ onClick: () => w("crop", a)
1239
+ }) : null,
1240
+ ...a.actions.map(
1241
+ (_) => c(u.FmButton, {
1242
+ key: _,
1243
+ variant: _ === "skip" ? "tertiary" : "secondary",
1244
+ label: e(x[_]),
1245
+ onClick: () => s.session.resolve(a.fileKey, _)
1246
+ })
1247
+ )
1248
+ ]);
1249
+ }
1250
+ }
1251
+ ]), i = O(() => [
1252
+ {
1253
+ id: "file",
1254
+ header: () => e("menu.product_batch_image.review.columns.file"),
1255
+ size: 300,
1256
+ enableSorting: !1,
1257
+ cell: (o) => {
1258
+ const a = o.row.original;
1259
+ return f(a.fileKey, a.path, a.width, a.height);
1260
+ }
1261
+ },
1262
+ {
1263
+ id: "reason",
1264
+ header: () => e("menu.product_batch_image.review.columns.reason"),
1265
+ enableSorting: !1,
1266
+ cell: (o) => {
1267
+ const a = o.row.original;
1268
+ return c("div", { class: "flex flex-col gap-4 py-8" }, [
1269
+ c("span", { class: "fm-typo-en-body-md-600" }, F(a.reason)),
1270
+ c(
1271
+ "span",
1272
+ { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
1273
+ F(a.detail)
1274
+ )
1275
+ ]);
1276
+ }
1277
+ },
1278
+ {
1279
+ id: "assign",
1280
+ header: () => e("menu.product_batch_image.review.columns.assign"),
1281
+ size: 360,
1282
+ enableSorting: !1,
1283
+ cell: (o) => {
1284
+ var _;
1285
+ const a = o.row.original;
1286
+ return c("div", { class: "flex items-center gap-8" }, [
1287
+ c(u.FmSelect, {
1288
+ class: "flex-1",
1289
+ modelValue: ((_ = a.assigned) == null ? void 0 : _.productId) ?? null,
1290
+ items: z(a.assigned),
1291
+ searchable: !0,
1292
+ onSearch: async (L) => {
1293
+ A.value = L;
1294
+ },
1295
+ clearable: !0,
1296
+ placeholder: e("menu.product_batch_image.attention.choose_product"),
1297
+ "aria-label": e(
1298
+ "menu.product_batch_image.attention.choose_product_for",
1299
+ {
1300
+ file: b(a.path)
1301
+ }
1302
+ ),
1303
+ "onUpdate:modelValue": (L) => s.session.assign(a.fileKey, L ?? null)
1304
+ }),
1305
+ a.assigned ? c(K, {
1306
+ variant: "success",
1307
+ label: e("menu.product_batch_image.unmatched.assigned")
1308
+ }) : a.suggestion ? c(u.FmButton, {
1309
+ variant: "secondary",
1310
+ label: e("menu.product_batch_image.unmatched.use"),
1311
+ onClick: () => s.session.acceptSuggestions([a.fileKey])
1312
+ }) : null
1313
+ ]);
1314
+ }
1315
+ }
1316
+ ]);
1317
+ return (o, a) => (d(), j(le, {
1318
+ show: !0,
1319
+ title: t(e)("menu.product_batch_image.review.title"),
1320
+ "primary-action": {
1321
+ label: t(e)("menu.product_batch_image.review.start", {
1322
+ count: o.view.counts.included
1323
+ }),
1324
+ disabled: o.view.start.state !== "allowed"
1325
+ },
1326
+ "secondary-actions": [
1327
+ { label: t(e)("menu.common.actions.back"), click: () => w("back") }
1328
+ ],
1329
+ onOnPrimary: a[2] || (a[2] = (_) => w("start")),
1330
+ onOnCancel: a[3] || (a[3] = (_) => w("back"))
1331
+ }, {
1332
+ "append-title": B(() => [
1333
+ o.view.counts.attentionOpen ? (d(), $("span", Ut, g(t(e)("menu.product_batch_image.review.unresolved_skipped", {
1334
+ count: o.view.counts.attentionOpen
1335
+ })), 1)) : U("", !0)
1336
+ ]),
1337
+ default: B(() => [
1338
+ l("div", jt, [
1339
+ l("p", Tt, g(h.value), 1),
1340
+ k(t(u).FmTabs, {
1341
+ "model-value": p.value,
1342
+ items: C.value,
1343
+ "onUpdate:modelValue": a[0] || (a[0] = (_) => p.value = _)
1344
+ }, null, 8, ["model-value", "items"]),
1345
+ p.value === "ready" ? (d(), $(R, { key: 0 }, [
1346
+ l("p", Lt, g(t(e)("menu.product_batch_image.review.legend")), 1),
1347
+ k(t(u).FmTable, {
1348
+ "column-defs": v.value,
1349
+ "row-data": [...o.view.ready],
1350
+ "page-size": o.view.ready.length || 1,
1351
+ "get-row-id": (_) => _.productId,
1352
+ "hide-footer": "",
1353
+ "shrink-at": !1
1354
+ }, null, 8, ["column-defs", "row-data", "page-size", "get-row-id"])
1355
+ ], 64)) : p.value === "attention" ? (d(), j(t(u).FmTable, {
1356
+ key: 1,
1357
+ "column-defs": n.value,
1358
+ "row-data": [...o.view.attention],
1359
+ "page-size": o.view.attention.length || 1,
1360
+ "get-row-id": (_) => _.fileKey,
1361
+ "hide-footer": "",
1362
+ "shrink-at": !1
1363
+ }, null, 8, ["column-defs", "row-data", "page-size", "get-row-id"])) : (d(), $(R, { key: 2 }, [
1364
+ o.view.counts.nearMatches ? (d(), j(t(u).FmCard, {
1365
+ key: 0,
1366
+ variant: "outlined",
1367
+ class: "flex items-center gap-12 p-12"
1368
+ }, {
1369
+ default: B(() => [
1370
+ k(t(u).FmIcon, {
1371
+ name: "info",
1372
+ outline: "",
1373
+ color: "system-info-300"
1374
+ }),
1375
+ l("p", Ot, g(t(e)("menu.product_batch_image.unmatched.near_matches", {
1376
+ count: o.view.counts.nearMatches
1377
+ })), 1),
1378
+ k(t(u).FmButton, {
1379
+ variant: "secondary",
1380
+ label: t(e)("menu.product_batch_image.unmatched.use_all"),
1381
+ onClick: a[1] || (a[1] = (_) => o.session.acceptSuggestions())
1382
+ }, null, 8, ["label"])
1383
+ ]),
1384
+ _: 1
1385
+ })) : U("", !0),
1386
+ k(t(u).FmTable, {
1387
+ "column-defs": i.value,
1388
+ "row-data": [...o.view.unmatched],
1389
+ "page-size": o.view.unmatched.length || 1,
1390
+ "get-row-id": (_) => _.fileKey,
1391
+ "hide-footer": "",
1392
+ "shrink-at": !1
1393
+ }, null, 8, ["column-defs", "row-data", "page-size", "get-row-id"]),
1394
+ l("p", Rt, g(t(e)("menu.product_batch_image.unmatched.hint")), 1)
1395
+ ], 64))
1396
+ ])
1397
+ ]),
1398
+ _: 1
1399
+ }, 8, ["title", "primary-action", "secondary-actions"]));
1400
+ }
1401
+ }), Mt = { class: "flex flex-col gap-4" }, Vt = { class: "fm-typo-en-title-md-600" }, Et = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pt = { class: "flex flex-col gap-24" }, Kt = { class: "flex flex-col gap-8" }, Nt = { class: "fm-typo-en-body-lg-600" }, Dt = { class: "flex flex-1 flex-col gap-4" }, Gt = { class: "fm-typo-en-body-md-600" }, qt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ht = {
1402
+ key: 0,
1403
+ class: "flex flex-col gap-4"
1404
+ }, Wt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Xt = { class: "flex flex-1 flex-col gap-4" }, Jt = { class: "fm-typo-en-body-md-600" }, Qt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Yt = { class: "fm-typo-en-body-md-400" }, Zt = { class: "grid grid-cols-4 gap-8" }, ea = { class: "fm-typo-en-title-sm-600 tabular-nums" }, ta = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, aa = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, oa = {
1405
+ key: 0,
1406
+ class: "fm-typo-en-body-md-400 text-fm-color-system-warning-300"
1407
+ }, na = { class: "grid grid-cols-4 gap-8" }, sa = { class: "fm-typo-en-title-sm-600 tabular-nums" }, la = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ra = { class: "flex flex-col gap-8" }, ia = { class: "fm-typo-en-body-lg-600" }, ca = { class: "fm-typo-en-body-sm-600" }, ua = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, da = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ma = { class: "flex flex-col gap-8" }, pa = { class: "fm-typo-en-body-lg-600" }, ga = {
1408
+ key: 1,
1409
+ class: "flex flex-col gap-8"
1410
+ }, fa = { class: "fm-typo-en-body-lg-600" }, _a = { class: "flex w-full items-center justify-end gap-8" }, ba = { class: "mr-auto fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ya = /* @__PURE__ */ E({
1411
+ __name: "BatchImageUpdateSheet",
1412
+ props: {
1413
+ session: {},
1414
+ view: {},
1415
+ productCount: {},
1416
+ reading: {}
1417
+ },
1418
+ emits: ["pick", "clear", "review", "cancel"],
1419
+ setup(y, { emit: r }) {
1420
+ const s = y, w = r, { t: e, n: F, d: p } = P(), C = M(null), h = M(null), b = M(!1);
1421
+ function m(n, i) {
1422
+ var _;
1423
+ const o = n.length === 1 && /\.zip$/i.test(n[0].path), a = (_ = n[0]) != null && _.path.includes("/") ? n[0].path.split("/")[0] : null;
1424
+ return {
1425
+ label: o ? n[0].file.name : a || e("menu.product_batch_image.setup.files_label", {
1426
+ count: n.length
1427
+ }),
1428
+ kind: o ? "zip" : a ? "folder" : i
1429
+ };
1430
+ }
1431
+ function v(n, i) {
1432
+ const o = n.target, a = ie(o.files ?? []);
1433
+ o.value = "", w("pick", a, m(a, i));
1434
+ }
1435
+ async function x(n) {
1436
+ if (b.value = !1, !n.dataTransfer) return;
1437
+ const i = await Fe(n.dataTransfer);
1438
+ w("pick", i, m(i, "files"));
1439
+ }
1440
+ const T = O(() => {
1441
+ const n = e("menu.product_batch_image.setup.naming.sample_name"), i = e("menu.product_batch_image.setup.naming.sample_folder"), o = (a, _) => e("menu.product_batch_image.setup.naming.example_file", {
1442
+ name: a,
1443
+ suffix: _
1444
+ });
1445
+ return [
1446
+ [o(n, ".jpg"), e("menu.product_batch_image.setup.naming.original")],
1447
+ [
1448
+ o(n, "@16x9.jpg"),
1449
+ e("menu.product_batch_image.setup.naming.format")
1450
+ ],
1451
+ [
1452
+ o(n, " #2.jpg"),
1453
+ e("menu.product_batch_image.setup.naming.second")
1454
+ ],
1455
+ [
1456
+ o(i, "/2@4x3.jpg"),
1457
+ e("menu.product_batch_image.setup.naming.folder")
1458
+ ]
1459
+ ];
1460
+ }), A = (n) => F(Math.round(n / 1024 / 1024 * 10) / 10), I = O(
1461
+ () => !!s.view.source && !s.reading && (s.view.counts.ready > 0 || s.view.attention.length > 0 || s.view.unmatched.length > 0)
1462
+ ), z = O(
1463
+ () => s.view.via === "manifest" ? e("menu.product_batch_image.setup.review_changes", {
1464
+ count: s.view.summary.changed + s.view.summary.newFiles
1465
+ }) : e("menu.product_batch_image.setup.review_products", {
1466
+ count: s.view.summary.matchedProducts
1467
+ })
1468
+ ), f = O(
1469
+ () => s.view.manifestExportedAt ? p(new Date(s.view.manifestExportedAt)) : ""
1470
+ );
1471
+ return (n, i) => (d(), j(t(u).FmSideSheet, {
1472
+ "model-value": !0,
1473
+ "max-width": 560,
1474
+ "dismiss-away": "",
1475
+ "onUpdate:modelValue": i[12] || (i[12] = (o) => !o && w("cancel"))
1476
+ }, {
1477
+ "side-sheet-header": B(() => [
1478
+ l("div", Mt, [
1479
+ l("p", Vt, g(t(e)("menu.product_batch_image.setup.title")), 1),
1480
+ l("p", Et, g(t(e)("menu.product_batch_image.scope.all", { count: n.productCount })), 1)
1481
+ ])
1482
+ ]),
1483
+ "side-sheet-footer": B(() => [
1484
+ l("div", _a, [
1485
+ l("p", ba, g(t(e)("menu.product_batch_image.setup.no_changes_yet")), 1),
1486
+ k(t(u).FmButton, {
1487
+ class: "shrink-0",
1488
+ variant: "tertiary",
1489
+ label: t(e)("menu.common.actions.cancel"),
1490
+ onClick: i[10] || (i[10] = (o) => w("cancel"))
1491
+ }, null, 8, ["label"]),
1492
+ k(t(u).FmButton, {
1493
+ class: "shrink-0",
1494
+ variant: "primary",
1495
+ label: z.value,
1496
+ disabled: !I.value,
1497
+ onClick: i[11] || (i[11] = (o) => w("review"))
1498
+ }, null, 8, ["label", "disabled"])
1499
+ ])
1500
+ ]),
1501
+ default: B(() => [
1502
+ l("div", Pt, [
1503
+ l("section", Kt, [
1504
+ l("p", Nt, g(t(e)("menu.product_batch_image.setup.files")), 1),
1505
+ l("div", {
1506
+ class: D([
1507
+ "flex items-center gap-12 rounded-md border border-dashed p-16",
1508
+ b.value ? "border-fm-color-primary" : "border-fm-color-neutral-gray-300"
1509
+ ]),
1510
+ onDragleave: i[4] || (i[4] = J((o) => b.value = !1, ["prevent"])),
1511
+ onDragover: i[5] || (i[5] = J((o) => b.value = !0, ["prevent"])),
1512
+ onDrop: J(x, ["prevent"])
1513
+ }, [
1514
+ k(t(u).FmIcon, {
1515
+ name: "cloud_upload",
1516
+ outline: "",
1517
+ color: "primary"
1518
+ }),
1519
+ l("div", Dt, [
1520
+ l("p", Gt, g(t(e)("menu.product_batch_image.setup.drop_hint")), 1),
1521
+ l("p", qt, g(t(e)("menu.product_batch_image.setup.accepts")), 1)
1522
+ ]),
1523
+ k(t(u).FmButton, {
1524
+ variant: "secondary",
1525
+ label: t(e)("menu.product_batch_image.setup.choose_files"),
1526
+ onClick: i[0] || (i[0] = (o) => {
1527
+ var a;
1528
+ return (a = C.value) == null ? void 0 : a.click();
1529
+ })
1530
+ }, null, 8, ["label"]),
1531
+ k(t(u).FmButton, {
1532
+ variant: "secondary",
1533
+ "prepend-icon": "folder",
1534
+ label: t(e)("menu.product_batch_image.setup.choose_folder"),
1535
+ onClick: i[1] || (i[1] = (o) => {
1536
+ var a;
1537
+ return (a = h.value) == null ? void 0 : a.click();
1538
+ })
1539
+ }, null, 8, ["label"]),
1540
+ l("input", {
1541
+ ref_key: "fileInput",
1542
+ ref: C,
1543
+ class: "hidden",
1544
+ type: "file",
1545
+ multiple: "",
1546
+ accept: "image/*,.zip,application/zip",
1547
+ onChange: i[2] || (i[2] = (o) => v(o, "files"))
1548
+ }, null, 544),
1549
+ l("input", {
1550
+ ref_key: "folderInput",
1551
+ ref: h,
1552
+ class: "hidden",
1553
+ type: "file",
1554
+ webkitdirectory: "",
1555
+ onChange: i[3] || (i[3] = (o) => v(o, "folder"))
1556
+ }, null, 544)
1557
+ ], 34),
1558
+ n.reading ? (d(), $("div", Ht, [
1559
+ l("p", Wt, g(t(e)("menu.product_batch_image.setup.reading", {
1560
+ done: n.reading.done,
1561
+ total: n.reading.total
1562
+ })), 1),
1563
+ k(t(u).FmProgressBar, {
1564
+ value: n.reading.total ? n.reading.done / n.reading.total * 100 : 0,
1565
+ indeterminate: !n.reading.total
1566
+ }, null, 8, ["value", "indeterminate"])
1567
+ ])) : U("", !0),
1568
+ n.view.source && !n.reading ? (d(), j(t(u).FmCard, {
1569
+ key: 1,
1570
+ variant: "outlined",
1571
+ class: "flex items-center gap-12 p-12"
1572
+ }, {
1573
+ default: B(() => [
1574
+ k(t(u).FmIcon, {
1575
+ name: n.view.source.kind === "folder" ? "folder" : "folder_zip",
1576
+ outline: "",
1577
+ color: "neutral-gray-400"
1578
+ }, null, 8, ["name"]),
1579
+ l("div", Xt, [
1580
+ l("p", Jt, g(n.view.source.label), 1),
1581
+ l("p", Qt, g(t(e)("menu.product_batch_image.setup.source_meta", {
1582
+ size: A(n.view.source.totalBytes),
1583
+ count: n.view.source.fileCount,
1584
+ ignored: n.view.source.ignoredCount
1585
+ })), 1)
1586
+ ]),
1587
+ k(t(u).FmButton, {
1588
+ variant: "tertiary",
1589
+ label: t(e)("menu.common.actions.remove"),
1590
+ onClick: i[6] || (i[6] = (o) => w("clear"))
1591
+ }, null, 8, ["label"])
1592
+ ]),
1593
+ _: 1
1594
+ })) : U("", !0)
1595
+ ]),
1596
+ n.view.source && !n.reading ? (d(), $(R, { key: 0 }, [
1597
+ n.view.via === "manifest" ? (d(), $(R, { key: 0 }, [
1598
+ k(t(u).FmCard, {
1599
+ variant: "outlined",
1600
+ class: "flex items-start gap-8 p-12"
1601
+ }, {
1602
+ default: B(() => [
1603
+ k(t(u).FmIcon, {
1604
+ name: "check_circle",
1605
+ color: "system-success-300"
1606
+ }),
1607
+ l("p", Yt, g(t(e)("menu.product_batch_image.setup.manifest_found", {
1608
+ date: f.value
1609
+ })), 1)
1610
+ ]),
1611
+ _: 1
1612
+ }),
1613
+ l("div", Zt, [
1614
+ (d(!0), $(R, null, V([
1615
+ [
1616
+ n.view.summary.changed,
1617
+ "menu.product_batch_image.setup.stat.changed"
1618
+ ],
1619
+ [
1620
+ n.view.summary.unchanged,
1621
+ "menu.product_batch_image.setup.stat.unchanged"
1622
+ ],
1623
+ [
1624
+ n.view.summary.newFiles,
1625
+ "menu.product_batch_image.setup.stat.new_files"
1626
+ ],
1627
+ [
1628
+ n.view.summary.cannotMatch,
1629
+ "menu.product_batch_image.setup.stat.cannot_match"
1630
+ ]
1631
+ ], (o) => (d(), $("div", {
1632
+ key: o[1],
1633
+ class: D([
1634
+ "flex flex-col gap-2 rounded-[8px] px-12 py-8",
1635
+ o[0] > 0 && o[1] === "menu.product_batch_image.setup.stat.cannot_match" ? "bg-fm-color-system-warning-100 text-fm-color-system-warning-400" : "bg-fm-color-neutral-gray-100"
1636
+ ])
1637
+ }, [
1638
+ l("span", ea, g(o[0]), 1),
1639
+ l("span", ta, g(t(e)(o[1])), 1)
1640
+ ], 2))), 128))
1641
+ ]),
1642
+ n.view.formatsEnabled ? (d(), j(t(u).FmCheckbox, {
1643
+ key: 0,
1644
+ "model-value": n.view.redoAi,
1645
+ value: "",
1646
+ label: t(e)("menu.product_batch_image.setup.redo_ai"),
1647
+ sublabel: t(e)("menu.product_batch_image.setup.redo_ai_hint"),
1648
+ "onUpdate:modelValue": i[7] || (i[7] = (o) => n.session.setRedoAi(o))
1649
+ }, null, 8, ["model-value", "label", "sublabel"])) : U("", !0),
1650
+ l("p", aa, g(t(e)("menu.product_batch_image.setup.in_place_hint")), 1)
1651
+ ], 64)) : (d(), $(R, { key: 1 }, [
1652
+ n.view.foreignManifest ? (d(), $("p", oa, g(t(e)("menu.product_batch_image.setup.foreign_manifest")), 1)) : U("", !0),
1653
+ l("div", na, [
1654
+ (d(!0), $(R, null, V([
1655
+ [
1656
+ n.view.summary.matchedProducts,
1657
+ "menu.product_batch_image.setup.stat.matched"
1658
+ ],
1659
+ [
1660
+ n.view.summary.images,
1661
+ "menu.product_batch_image.setup.stat.images"
1662
+ ],
1663
+ [
1664
+ n.view.summary.ownFormatFiles,
1665
+ "menu.product_batch_image.setup.stat.own_formats"
1666
+ ],
1667
+ [
1668
+ n.view.summary.toCheck,
1669
+ "menu.product_batch_image.setup.stat.to_check"
1670
+ ]
1671
+ ], (o) => (d(), $("div", {
1672
+ key: o[1],
1673
+ class: D([
1674
+ "flex flex-col gap-2 rounded-[8px] px-12 py-8",
1675
+ o[0] > 0 && o[1] === "menu.product_batch_image.setup.stat.to_check" ? "bg-fm-color-system-warning-100 text-fm-color-system-warning-400" : "bg-fm-color-neutral-gray-100"
1676
+ ])
1677
+ }, [
1678
+ l("span", sa, g(o[0]), 1),
1679
+ l("span", la, g(t(e)(o[1])), 1)
1680
+ ], 2))), 128))
1681
+ ]),
1682
+ l("section", ra, [
1683
+ l("p", ia, g(t(e)("menu.product_batch_image.setup.naming_title")), 1),
1684
+ k(t(u).FmCard, {
1685
+ variant: "outlined",
1686
+ class: "flex flex-col gap-4 p-12"
1687
+ }, {
1688
+ default: B(() => [
1689
+ (d(!0), $(R, null, V(T.value, (o) => (d(), $("div", {
1690
+ key: o[0],
1691
+ class: "flex justify-between gap-12"
1692
+ }, [
1693
+ l("code", ca, g(o[0]), 1),
1694
+ l("span", ua, g(o[1]), 1)
1695
+ ]))), 128))
1696
+ ]),
1697
+ _: 1
1698
+ }),
1699
+ l("p", da, g(t(e)("menu.product_batch_image.setup.naming_hint")), 1)
1700
+ ]),
1701
+ l("section", ma, [
1702
+ l("p", pa, g(t(e)("menu.product_batch_image.setup.existing_title")), 1),
1703
+ k(t(u).FmRadioGroup, {
1704
+ "model-value": n.view.mode,
1705
+ class: "flex flex-col gap-8",
1706
+ "onUpdate:modelValue": i[8] || (i[8] = (o) => n.session.setMode(o))
1707
+ }, {
1708
+ default: B(() => [
1709
+ k(t(u).FmRadio, {
1710
+ value: "replace",
1711
+ label: t(e)("menu.product_batch_image.setup.mode.replace"),
1712
+ sublabel: t(e)("menu.product_batch_image.setup.mode.replace_hint")
1713
+ }, null, 8, ["label", "sublabel"]),
1714
+ k(t(u).FmRadio, {
1715
+ value: "append",
1716
+ label: t(e)("menu.product_batch_image.setup.mode.append"),
1717
+ sublabel: t(e)("menu.product_batch_image.setup.mode.append_hint")
1718
+ }, null, 8, ["label", "sublabel"])
1719
+ ]),
1720
+ _: 1
1721
+ }, 8, ["model-value"])
1722
+ ]),
1723
+ n.view.formatsEnabled ? (d(), $("section", ga, [
1724
+ l("p", fa, g(t(e)("menu.product_batch_image.setup.missing_title")), 1),
1725
+ k(t(u).FmCheckbox, {
1726
+ "model-value": n.view.generateMissing,
1727
+ value: "",
1728
+ label: t(e)("menu.product_batch_image.setup.generate_missing", {
1729
+ count: n.view.summary.formatsToGenerate
1730
+ }),
1731
+ sublabel: t(e)("menu.product_batch_image.setup.generate_missing_hint", {
1732
+ required: n.view.requiredFormats.join(", "),
1733
+ menu: n.view.menuFormats.join(", ") || t(e)("menu.catalog.empty_value")
1734
+ }),
1735
+ "onUpdate:modelValue": i[9] || (i[9] = (o) => n.session.setGenerateMissing(o))
1736
+ }, null, 8, ["model-value", "label", "sublabel"])
1737
+ ])) : U("", !0)
1738
+ ], 64))
1739
+ ], 64)) : U("", !0)
1740
+ ])
1741
+ ]),
1742
+ _: 1
1743
+ }));
1744
+ }
1745
+ }), ha = /* @__PURE__ */ E({
1746
+ __name: "BatchImageUpdateFlow",
1747
+ emits: ["close"],
1748
+ setup(y, { emit: r }) {
1749
+ const s = r, { t: w } = P(), e = ne(), F = ee(), p = F.productBatchImage.openImport(), C = Y(p), h = O(
1750
+ () => C.value.status === "ready" ? C.value.value : null
1751
+ ), b = Y(F.productBatchImage.overview), m = O(
1752
+ () => b.value.status === "ready" ? b.value.value.productCount : 0
1753
+ ), v = M("setup"), x = pe(/* @__PURE__ */ new Map()), T = M(null);
1754
+ async function A(a, _) {
1755
+ if (a.length) {
1756
+ T.value = { done: 0, total: 0 };
1757
+ try {
1758
+ const L = await Se(a, _, (S, q) => {
1759
+ T.value = { done: S, total: q };
1760
+ });
1761
+ Q(x.value), x.value = L.previews, p.setSource(L.source);
1762
+ } catch {
1763
+ e.open({
1764
+ type: "error",
1765
+ title: w("menu.product_batch_image.setup.read_failed"),
1766
+ position: W.BOTTOM
1767
+ });
1768
+ } finally {
1769
+ T.value = null;
1770
+ }
1771
+ }
1772
+ }
1773
+ function I() {
1774
+ p.clearSource(), Q(x.value), x.value = /* @__PURE__ */ new Map();
1775
+ }
1776
+ async function z() {
1777
+ var _;
1778
+ const a = await p.start();
1779
+ a.kind === "rejected" && e.open({
1780
+ type: "error",
1781
+ title: w(((_ = a.issues[0]) == null ? void 0 : _.code) ?? "menu.error.unexpected"),
1782
+ position: W.BOTTOM
1783
+ });
1784
+ }
1785
+ const f = M(null);
1786
+ async function n(a) {
1787
+ const _ = x.value.get(a.fileKey);
1788
+ if (!_ || !a.crop) return;
1789
+ const L = await (await fetch(_)).blob();
1790
+ f.value = {
1791
+ row: a,
1792
+ file: new File([L], a.path.split("/").pop() ?? "image.jpg", {
1793
+ type: L.type || "image/jpeg"
1794
+ })
1795
+ };
1796
+ }
1797
+ function i(a) {
1798
+ const _ = f.value;
1799
+ if (f.value = null, !_ || !a) return;
1800
+ const L = new Map(x.value), S = L.get(_.row.fileKey);
1801
+ S && URL.revokeObjectURL(S), L.set(_.row.fileKey, URL.createObjectURL(a.blob)), x.value = L, p.replaceFile(_.row.fileKey, Be(a));
1802
+ }
1803
+ function o() {
1804
+ var a;
1805
+ ((a = h.value) == null ? void 0 : a.phase) !== "running" && s("close");
1806
+ }
1807
+ return ge(() => {
1808
+ p.dispose(), Q(x.value);
1809
+ }), (a, _) => {
1810
+ var L, S, q, ae;
1811
+ return h.value ? (d(), $(R, { key: 0 }, [
1812
+ h.value.phase === "draft" && v.value === "setup" ? (d(), j(ya, {
1813
+ key: 0,
1814
+ session: t(p),
1815
+ view: h.value,
1816
+ "product-count": m.value,
1817
+ reading: T.value,
1818
+ onPick: A,
1819
+ onClear: I,
1820
+ onReview: _[0] || (_[0] = (H) => v.value = "review"),
1821
+ onCancel: o
1822
+ }, null, 8, ["session", "view", "product-count", "reading"])) : U("", !0),
1823
+ h.value.phase !== "finished" && v.value === "review" ? (d(), j(At, {
1824
+ key: 1,
1825
+ session: t(p),
1826
+ view: h.value,
1827
+ previews: x.value,
1828
+ onBack: _[1] || (_[1] = (H) => v.value = "setup"),
1829
+ onStart: z,
1830
+ onCrop: n
1831
+ }, null, 8, ["session", "view", "previews"])) : U("", !0),
1832
+ h.value.phase === "running" && h.value.progress ? (d(), j(yt, {
1833
+ key: 2,
1834
+ progress: h.value.progress,
1835
+ onStop: _[2] || (_[2] = (H) => t(p).stop())
1836
+ }, null, 8, ["progress"])) : U("", !0),
1837
+ h.value.phase === "finished" && h.value.result ? (d(), j(zt, {
1838
+ key: 3,
1839
+ result: h.value.result,
1840
+ "source-label": ((L = h.value.source) == null ? void 0 : L.label) ?? "",
1841
+ onRetry: _[3] || (_[3] = (H) => t(p).retryFailed()),
1842
+ onClose: o
1843
+ }, null, 8, ["result", "source-label"])) : U("", !0),
1844
+ f.value ? (d(), j(we, {
1845
+ key: 4,
1846
+ file: f.value.file,
1847
+ "aspect-ratio": ((S = f.value.row.crop) == null ? void 0 : S.aspectRatio) ?? null,
1848
+ "ratio-label": ((q = f.value.row.crop) == null ? void 0 : q.label) ?? null,
1849
+ hint: t(w)("menu.product_batch_image.attention.crop_hint", {
1850
+ ratio: ((ae = f.value.row.crop) == null ? void 0 : ae.label) ?? ""
1851
+ }),
1852
+ mode: "upload",
1853
+ onCancel: _[4] || (_[4] = (H) => f.value = null),
1854
+ onConfirm: i
1855
+ }, null, 8, ["file", "aspect-ratio", "ratio-label", "hint"])) : U("", !0)
1856
+ ], 64)) : U("", !0);
1857
+ };
1858
+ }
1859
+ }), va = { class: "ml-auto flex items-center gap-8" }, wa = {
1860
+ key: 0,
1861
+ class: "flex justify-center py-48"
1862
+ }, ka = {
1863
+ key: 1,
1864
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
1865
+ }, xa = {
1866
+ key: 2,
1867
+ class: "flex flex-col gap-16"
1868
+ }, $a = {
1869
+ key: 0,
1870
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
1871
+ }, Fa = { class: "flex flex-wrap items-center gap-12" }, Ia = { class: "w-[320px]" }, Ca = { class: "min-w-[240px] flex-1" }, Sa = { class: "whitespace-nowrap rounded-lg bg-fm-color-neutral-gray-100 px-12 py-8 fm-typo-en-body-md-600" }, Ba = { class: "overflow-hidden rounded-[10px] border border-solid border-fm-color-neutral-gray-200" }, za = { class: "-mb-px -mr-px grid grid-cols-[repeat(auto-fit,minmax(160px,1fr))]" }, Ua = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ja = { class: "fm-typo-en-title-sm-600 tabular-nums" }, Ta = {
1872
+ key: 0,
1873
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
1874
+ }, La = {
1875
+ key: 0,
1876
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
1877
+ }, Oa = {
1878
+ class: "mt-auto flex h-4 overflow-hidden rounded-full bg-fm-color-neutral-gray-100",
1879
+ "aria-hidden": "true"
1880
+ }, Na = /* @__PURE__ */ E({
1881
+ __name: "ProductInternalTools",
1882
+ setup(y) {
1883
+ const { t: r } = P(), s = G(), e = ee().productBatchImage, F = Y(e.overview), p = O(
1884
+ () => F.value.status === "ready" ? F.value.value : null
1885
+ ), C = M("");
1886
+ let h = null;
1887
+ fe(C, (f) => {
1888
+ h && clearTimeout(h), h = setTimeout(() => e.setFilter({ search: f }), 200);
1889
+ });
1890
+ const b = O(
1891
+ () => {
1892
+ var f;
1893
+ return (((f = p.value) == null ? void 0 : f.categories) ?? []).map((n) => ({
1894
+ label: n.label,
1895
+ value: n.id
1896
+ }));
1897
+ }
1898
+ ), m = M(!1), v = M(!1);
1899
+ function x(f) {
1900
+ return f.state === "disabled" && f.reason ? s(f.reason) : "";
1901
+ }
1902
+ const T = {
1903
+ uploaded: "var(--fm-color-system-green-300)",
1904
+ ai: "var(--fm-color-secondary-plum)",
1905
+ legacy: "var(--fm-color-neutral-gray-300)",
1906
+ none: "var(--fm-color-system-red-300)"
1907
+ }, A = (f, n) => n > 0 ? Math.min(100, f / n * 100) : 0, I = O(() => {
1908
+ const f = p.value;
1909
+ if (!f) return [];
1910
+ const { coverage: n, productCount: i } = f;
1911
+ return [
1912
+ {
1913
+ id: "with-images",
1914
+ label: r("menu.product_batch_image.coverage.with_images"),
1915
+ value: String(n.withImages),
1916
+ total: r("menu.product_batch_image.coverage.of_total", {
1917
+ total: i
1918
+ }),
1919
+ segments: [
1920
+ {
1921
+ colour: T.uploaded,
1922
+ share: A(n.withImages, i)
1923
+ }
1924
+ ]
1925
+ },
1926
+ {
1927
+ id: "legacy",
1928
+ label: r("menu.product_batch_image.coverage.legacy"),
1929
+ value: String(n.legacyOnly),
1930
+ segments: [
1931
+ {
1932
+ colour: T.legacy,
1933
+ share: A(n.legacyOnly, i)
1934
+ }
1935
+ ]
1936
+ },
1937
+ {
1938
+ id: "no-image",
1939
+ label: r("menu.product_batch_image.coverage.no_image"),
1940
+ value: String(n.noImage),
1941
+ segments: [
1942
+ { colour: T.none, share: A(n.noImage, i) }
1943
+ ]
1944
+ },
1945
+ ...n.ratios.map((o) => ({
1946
+ id: `ratio-${o.id}`,
1947
+ label: o.required ? r("menu.product_batch_image.coverage.required_format", {
1948
+ ratio: o.label
1949
+ }) : r("menu.product_batch_image.coverage.menu_format", {
1950
+ ratio: o.label
1951
+ }),
1952
+ value: String(o.uploaded + o.ai),
1953
+ total: r("menu.product_batch_image.coverage.of_total", {
1954
+ total: o.total
1955
+ }),
1956
+ note: r("menu.product_batch_image.coverage.split", {
1957
+ uploaded: o.uploaded,
1958
+ ai: o.ai
1959
+ }),
1960
+ segments: [
1961
+ { colour: T.uploaded, share: A(o.uploaded, o.total) },
1962
+ { colour: T.ai, share: A(o.ai, o.total) }
1963
+ ]
1964
+ }))
1965
+ ];
1966
+ }), z = O(() => [
1967
+ {
1968
+ id: "images",
1969
+ header: () => r("menu.product_batch_image.columns.images"),
1970
+ size: 150,
1971
+ enableSorting: !1,
1972
+ cell: (f) => {
1973
+ const n = f.row.original, i = n.imageUrls.length ? n.imageUrls.map(
1974
+ (o, a) => c(N, {
1975
+ key: o,
1976
+ src: o,
1977
+ alt: r("menu.product_batch_image.image_alt", {
1978
+ name: n.name,
1979
+ index: a + 1
1980
+ }),
1981
+ class: a ? "-ml-12" : ""
1982
+ })
1983
+ ) : [c(N, { alt: n.name })];
1984
+ return c("div", { class: "flex items-center py-8" }, [
1985
+ ...i,
1986
+ n.imageCount > 1 ? c(
1987
+ "span",
1988
+ {
1989
+ class: "ml-8 fm-typo-en-body-sm-600 text-fm-color-typo-secondary"
1990
+ },
1991
+ String(n.imageCount)
1992
+ ) : null
1993
+ ]);
1994
+ }
1995
+ },
1996
+ {
1997
+ accessorKey: "code",
1998
+ header: () => r("menu.product_batch_image.columns.code"),
1999
+ size: 110,
2000
+ cell: (f) => c(
2001
+ "span",
2002
+ { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
2003
+ f.row.original.code ?? r("menu.catalog.empty_value")
2004
+ )
2005
+ },
2006
+ {
2007
+ accessorKey: "name",
2008
+ header: () => r("menu.product_batch_image.columns.name"),
2009
+ cell: (f) => c(
2010
+ "span",
2011
+ { class: "fm-typo-en-body-md-600" },
2012
+ f.row.original.name
2013
+ )
2014
+ },
2015
+ {
2016
+ id: "category",
2017
+ header: () => r("menu.product_batch_image.columns.category"),
2018
+ size: 160,
2019
+ enableSorting: !1,
2020
+ cell: (f) => c(
2021
+ "span",
2022
+ { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
2023
+ f.row.original.categoryLabel ?? r("menu.product_batch_image.no_category")
2024
+ )
2025
+ },
2026
+ {
2027
+ id: "formats",
2028
+ header: () => r("menu.product_batch_image.columns.formats"),
2029
+ enableSorting: !1,
2030
+ cell: (f) => {
2031
+ const n = f.row.original;
2032
+ return n.legacyOnly ? c(me) : n.formats ? c(te, { formats: n.formats }) : c(
2033
+ "span",
2034
+ { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
2035
+ n.imageCount ? r("menu.catalog.empty_value") : r("menu.product_batch_image.no_image")
2036
+ );
2037
+ }
2038
+ }
2039
+ ]);
2040
+ return (f, n) => (d(), j(_e, {
2041
+ heading: t(r)("menu.productInternalTools.title")
2042
+ }, {
2043
+ "append-heading": B(() => {
2044
+ var i, o;
2045
+ return [
2046
+ l("div", va, [
2047
+ k(t(u).FmButton, {
2048
+ variant: "secondary",
2049
+ "prepend-icon": "download",
2050
+ label: t(r)("menu.product_batch_image.actions.download"),
2051
+ disabled: ((i = p.value) == null ? void 0 : i.downloadAction.state) !== "allowed",
2052
+ onClick: n[0] || (n[0] = (a) => v.value = !0)
2053
+ }, null, 8, ["label", "disabled"]),
2054
+ k(t(u).FmButton, {
2055
+ variant: "primary",
2056
+ "prepend-icon": "upload",
2057
+ label: t(r)("menu.product_batch_image.actions.update"),
2058
+ disabled: ((o = p.value) == null ? void 0 : o.update.state) !== "allowed",
2059
+ onClick: n[1] || (n[1] = (a) => m.value = !0)
2060
+ }, null, 8, ["label", "disabled"])
2061
+ ])
2062
+ ];
2063
+ }),
2064
+ default: B(() => [
2065
+ t(F).status === "loading" ? (d(), $("div", wa, [
2066
+ k(t(u).FmCircularProgress)
2067
+ ])) : t(F).status === "unavailable" ? (d(), $("p", ka, g(t(s)(t(F).reason)), 1)) : p.value ? (d(), $("div", xa, [
2068
+ p.value.update.state === "disabled" ? (d(), $("p", $a, g(x(p.value.update)), 1)) : U("", !0),
2069
+ l("div", Fa, [
2070
+ l("div", Ia, [
2071
+ k(t(u).FmSelect, {
2072
+ "model-value": [...p.value.filter.categoryIds],
2073
+ items: b.value,
2074
+ multiselect: "",
2075
+ searchable: "",
2076
+ clearable: "",
2077
+ placeholder: t(r)("menu.product_batch_image.filters.all_categories"),
2078
+ "aria-label": t(r)("menu.product_batch_image.filters.categories"),
2079
+ "onUpdate:modelValue": n[2] || (n[2] = (i) => t(e).setFilter({ categoryIds: i }))
2080
+ }, null, 8, ["model-value", "items", "placeholder", "aria-label"])
2081
+ ]),
2082
+ l("div", Ca, [
2083
+ k(t(u).FmSearch, {
2084
+ modelValue: C.value,
2085
+ "onUpdate:modelValue": n[3] || (n[3] = (i) => C.value = i),
2086
+ placeholder: t(r)("menu.product_batch_image.filters.search")
2087
+ }, null, 8, ["modelValue", "placeholder"])
2088
+ ]),
2089
+ l("span", Sa, g(p.value.filtered ? t(r)("menu.product_batch_image.scope.filtered", {
2090
+ count: p.value.productCount,
2091
+ total: p.value.totalProductCount
2092
+ }) : t(r)("menu.product_batch_image.scope.all", {
2093
+ count: p.value.productCount
2094
+ })), 1)
2095
+ ]),
2096
+ l("div", Ba, [
2097
+ l("div", za, [
2098
+ (d(!0), $(R, null, V(I.value, (i) => (d(), $("div", {
2099
+ key: i.id,
2100
+ class: "flex flex-col gap-4 border-0 border-b border-r border-solid border-fm-color-neutral-gray-200 px-16 py-12"
2101
+ }, [
2102
+ l("span", Ua, g(i.label), 1),
2103
+ l("span", ja, [
2104
+ X(g(i.value) + " ", 1),
2105
+ i.total ? (d(), $("small", Ta, g(i.total), 1)) : U("", !0)
2106
+ ]),
2107
+ i.note ? (d(), $("span", La, g(i.note), 1)) : U("", !0),
2108
+ l("div", Oa, [
2109
+ (d(!0), $(R, null, V(i.segments, (o, a) => (d(), $("i", {
2110
+ key: a,
2111
+ class: "block h-full",
2112
+ style: oe({
2113
+ width: `${o.share}%`,
2114
+ background: o.colour
2115
+ })
2116
+ }, null, 4))), 128))
2117
+ ])
2118
+ ]))), 128))
2119
+ ])
2120
+ ]),
2121
+ k(t(u).FmTable, {
2122
+ "column-defs": z.value,
2123
+ "row-data": [...p.value.rows],
2124
+ "page-size": p.value.rows.length || 1,
2125
+ "get-row-id": (i) => i.id,
2126
+ "hide-footer": "",
2127
+ "pin-header-row": "",
2128
+ "shrink-at": !1
2129
+ }, null, 8, ["column-defs", "row-data", "page-size", "get-row-id"])
2130
+ ])) : U("", !0),
2131
+ m.value ? (d(), j(ha, {
2132
+ key: 3,
2133
+ onClose: n[4] || (n[4] = (i) => m.value = !1)
2134
+ })) : U("", !0),
2135
+ v.value && p.value ? (d(), j(We, {
2136
+ key: 4,
2137
+ overview: p.value,
2138
+ onClose: n[5] || (n[5] = (i) => v.value = !1)
2139
+ }, null, 8, ["overview"])) : U("", !0)
2140
+ ]),
2141
+ _: 1
2142
+ }, 8, ["heading"]));
2143
+ }
2144
+ });
2145
+ export {
2146
+ Na as default
2147
+ };